Skip to content

Russian Translation#13

Merged
Exaxxion merged 7 commits intomasterfrom
ru_lang
Sep 21, 2021
Merged

Russian Translation#13
Exaxxion merged 7 commits intomasterfrom
ru_lang

Conversation

@Exaxxion
Copy link
Copy Markdown

Requested by #12, starting with cherry-pick of the ru_ru.lang file from upstream repo 1.16 branch.

@Exaxxion Exaxxion added the enhancement New feature or request label Jul 31, 2021
@Exaxxion Exaxxion linked an issue Jul 31, 2021 that may be closed by this pull request
@ALongStringOfNumbers
Copy link
Copy Markdown
Member

oh, this has to be a .lang file in 1.12.2. The switch to make lang files into a .json came in later minecraft versions

@Exaxxion
Copy link
Copy Markdown
Author

Exaxxion commented Aug 2, 2021

Yeah I mainly just grabbed the upstream commit and made the draft PR so I didn't forget about it. We'll have to adjust the format for 1.12 and make sure the translation strings line up properly.

@ferreiraalex
Copy link
Copy Markdown

Yeah I mainly just grabbed the upstream commit and made the draft PR so I didn't forget about it. We'll have to adjust the format for 1.12 and make sure the translation strings line up properly.

can i help you with translate?

Exaxxion and others added 5 commits September 20, 2021 23:53
It is now possible to translate both the default Singularities and
custom Singularities via lang files.

Translation strings have been added for the default materials in both
the en_us and ru_ru locales. Thanks to @NotMyWing for verifying the
existing and supplying new Russian translations.

Custom Singularity lang entries will require the use of a helper mod
such as ResourceLoader. Materials without a defined translation will
default to the material name converted to Title Case, e.g.:

lots_of_spaghetti => Lots Of Spaghetti

Co-authored-by: NotMyWing <winwyv@gmail.com>
Don't actually need this in our repo, we could have just referenced it from theirs.
@Exaxxion Exaxxion marked this pull request as ready for review September 21, 2021 08:42
Comment on lines +42 to +44
localizedMaterialName = I18n.translateToLocal("item.ec.singularity." + materialName);
}
return I18n.translateToLocalFormatted("item.ec.singularity.name", localizedMaterialName);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't you just return I18n.translateToLocal("item.ec.singularity." + materialName)? I don't see any formatting being applied that would necessitate using translateToLocalFormatted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The material name translation is two parts.

The first part would find the key for example item.ec.singularity.aluminum, which would return the localized string Aluminum.

The second one translates the key item.ec.singularity.name which resolves to %s Singularity and applies the localized material name with a formatting variable, resulting in the string Aluminum Singularity.

+ "\n- Example: 123456 would color it as whatever that color is."
+ "\n - Use the localization key \"item.ec.singularity.<name>\" to set the name of your custom Singularity."
+ "\n - Example: item.ec.singularity.carrot=Carrot in your resources/extendedcrafting/lang/en_us.lang"
+ "\n - and item.ec.singularity.carrot=морковь in your resources/extendedcrafting/lang/ru_ru.lang");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a note that this will require ResourceLoader or a similar mod.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intended to make a note about the new feature on the mod's CurseForge page once we release it but yeah I should probably add it to the config line as well.

@Exaxxion Exaxxion merged commit 149ac46 into master Sep 21, 2021
@Exaxxion Exaxxion deleted the ru_lang branch September 21, 2021 22:06
NotMyWing pushed a commit that referenced this pull request Jun 3, 2023
Co-authored-by: DStrand1 <DStrand1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you add more trunslate

4 participants