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

Add comments for obsolete strings in translations #77549

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

Uwuewsky
Copy link
Contributor

@Uwuewsky Uwuewsky commented Nov 3, 2024

Summary

I18N "Obsolete strings now have a comment with an explanation"

Purpose of change

Objects in the game may be declared obsolete, but their text is still extracted into translations and these obsolete strings are hard to distinguish. The only hint is the file path (in the red box).
s

Describe the solution

Transifex apparently doesn't support syntax for deprecated entries from gettext, so replace the comment (in the green box) with a warning for those strings that only occur in obsoleted files.

  1. A warning is added to lines whose file path has obsolet[e|ion] in it.
  2. In the lang/update_pot.sh file, you can explicitly specify a substring via a new argument.
  3. Manually added obsolete mods.
  4. Added description of this feature in the documentation.

Describe alternatives you've considered

Remove obsolete strings from translations?

Testing

The translations are extracted successfully, the comment has been replaced only in the right strings.
Comment replaced for a line with an obsolete source:

#. ~ [DEPRECATED] Don't translate this line.
#. ~ This string is from an obsolete source and will no longer be used in the game.
#: data/mods/BlazeIndustries/recipes/blaze_construction_recipes.json
msgid ""
"Converts a fridge to run off of vehicle power.  You can 'e'xamine it "
"afterwards to take it down for mounting."

Comment replaced for a string with multiple obsolete sources:

#. ~ [DEPRECATED] Don't translate this line.
#. ~ This string is from an obsolete source and will no longer be used in the game.
#: data/json/obsoletion_and_migration_0.I/gun.json
#: data/mods/Generic_Guns/recipes/recipe_obsolete.json
msgid "PPSh-41 submachine gun"

The string is used somewhere else, the original comment remains:

#. ~ Name of body part
#. ~ Mutation name
#: data/json/body_parts.json
#: data/json/obsoletion_and_migration_0.I/prosthetics.json
#: data/mods/Limb_WIP/mutations/mutations.json
msgid "right arm"

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. Translation I18n [Markdown] Markdown issues and PRs [Python] Code made in Python astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 3, 2024
@Maleclypse Maleclypse merged commit 30e1ca4 into CleverRaven:master Nov 9, 2024
17 of 23 checks passed
@Uwuewsky Uwuewsky deleted the i18n-obsolete branch November 9, 2024 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Documentation> Design documents, internal info, guides and help. json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs [Python] Code made in Python Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants