Conversation
|
oh, this has to be a |
|
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? |
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.
| localizedMaterialName = I18n.translateToLocal("item.ec.singularity." + materialName); | ||
| } | ||
| return I18n.translateToLocalFormatted("item.ec.singularity.name", localizedMaterialName); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Make a note that this will require ResourceLoader or a similar mod.
There was a problem hiding this comment.
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.
Co-authored-by: DStrand1 <DStrand1@users.noreply.github.com>
Requested by #12, starting with cherry-pick of the ru_ru.lang file from upstream repo 1.16 branch.