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

Improve item name presentation in translation comments #51989

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

BrettDong
Copy link
Member

Summary

I18N "Improve item name presentation in translation comments"

Purpose of change

Some item names are displayed as a JSON object in translation comments:

#. ~ Description for {'str_sp': 'garnet and gold cufflinks'}
#. ~ Description for {'str_sp': 'garnet and silver cufflinks'}
#. ~ Description for {'str_sp': 'garnet and platinum cufflinks'}
#: lang/json/ARMOR_from_json.py
msgid "A pair of cufflinks with inset garnets."
msgstr ""

This is more desirable:

#. ~ Description for garnet and gold cufflinks
#. ~ Description for garnet and silver cufflinks
#. ~ Description for garnet and platinum cufflinks
#: lang/json/ARMOR_from_json.py
msgid "A pair of cufflinks with inset garnets."
msgstr ""

Describe the solution

  • Create a helper function get_singular_name to extract singular name string from either name JSON object or string
  • Use return value from get_singular_name() for translation comments

Describe alternatives you've considered

Testing

Run ./lang/update_pot.sh. JSON objects are gone from translation comments in the new generated translation template.

Additional context

@BrettDong BrettDong added Translation I18n [Python] Code made in Python labels Sep 30, 2021
@kevingranade kevingranade merged commit fdf705e into CleverRaven:master Sep 30, 2021
@BrettDong BrettDong deleted the comment branch October 1, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Python] Code made in Python Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants