Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to internationalize json domain titles ? #274

Open
rperrot opened this issue Jul 27, 2023 · 1 comment
Open

Is there a way to internationalize json domain titles ? #274

rperrot opened this issue Jul 27, 2023 · 1 comment

Comments

@rperrot
Copy link

rperrot commented Jul 27, 2023

Hi,

first of all, thank you for your really helpful theme/extension.

I' trying to use json domain in a non english document and I'm stuck with the "required/optional" members string. I'd like to change it but I can't find a way to change it using a parameter/option.

I think the issue is because theses strings are hard coded here :

heading = "%s members" % ("Required" if required else "Optional")

Is there a way to customize it or it's impossible ?

Yours,

@2bndy5
Copy link
Collaborator

2bndy5 commented Jul 27, 2023

True, the strings are hardcoded in English, and there is no config option to change or remove them. We could use Sphinx' own translation mechanism, but I think that would require a .po file (in the doc project's source) that defines the translation for the words phrases "Required members" and "Optional members". This idea would be simple to implement on our end:

                heading = "%s members" % ("Required" if required else "Optional") 
                field_list, body = self._make_field(_(heading))

But it will require a message catalog (.po file) of translations on the user's end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants