Support localized mutation point percentages#6948
Support localized mutation point percentages#6948RyuDanuer wants to merge 4 commits intoRevolutionary-Games:masterfrom
Conversation
|
Could you put the screenshot here on Github to show the test result? |
|
But isn't that incorrect? In Turkish the percentage sign must be before the number. So that's basically the whole root problem of #6584 And in the image your percentage sign is after the number. |
hhyyrylainen
left a comment
There was a problem hiding this comment.
On the screenshot it does look like it works, but the code change is extremely messey in the way it splits the format string.
I believe that it will be much more maintainable to have multiple translation keys and formats for all of the different combined parts. That way the translators will be able to make whatever is needed for their language.
hhyyrylainen
left a comment
There was a problem hiding this comment.
You either need to put a lot more effort into making your PRs fit into the Thrive architecture and code style, or start picking purely small bugs that don't need any code refactoring as otherwise I will just stop reading these really badly made PRs that take way longer for me to read multiple times than to just do the fix myself.
| msgstr "{0}" | ||
|
|
||
| msgid "MUTATION_POINTS_CURRENT_WITH_PERCENTAGE" | ||
| msgstr "{0}%" | ||
|
|
||
| msgid "MUTATION_POINTS_CURRENT_WITH_RESULT" | ||
| msgstr "{0}" | ||
|
|
||
| msgid "MUTATION_POINTS_CURRENT_WITH_RESULT_WITH_PERCENTAGE" | ||
| msgstr "{0}%" | ||
|
|
||
| msgid "MUTATION_POINTS_RESULTING" | ||
| msgstr "{0}" | ||
|
|
||
| msgid "MUTATION_POINTS_RESULTING_WITH_PERCENTAGE" | ||
| msgstr "{0}%" |
There was a problem hiding this comment.
These are literally all totally pointless because they are either the equivalent of a value to string conversion, or the percentage format.
Also you have directly edited this en.po file without using our localization script which is absolutely required when adding text.
There was a problem hiding this comment.
By the way, here is a documentation on how to work with Thrive's translation system. The system automatically adds these entries based on what translation tokens are present in the code.
| freebuildingText = Localization.Translate("FREEBUILDING"); | ||
| } | ||
|
|
||
| public override void _Notification(int what) |
There was a problem hiding this comment.
Did you check if this was necessary?
There's already code in editors that should re-trigger the mutation points bar build.
See: UpdateMutationPointsBar called in CellEditorComponent.OnTranslationsChanged.
This is coded extremely sloppy. This is the kind of AI output I absolutely do not want to read.


Brief Description of What This PR Does
This PR makes the mutation points bar support the full
PERCENTAGE_VALUEformatting string instead of only showing the percent sign when it appears at the end.I split the localized percentage format around
{0}and place the prefix before the current mutation point value and the suffix after the base mutation point value. This lets formats like%{0}work while keeping the existing separate labels / arrow layout for pending mutation point changes.I also made the bar refresh its cached percentage format parts when the active translation changes.
Manual testing:
--language tr) to check that the bar still loads and renders correctly..test-artifacts/issue-6584-mp-bar-tr-2.pngI also ran:
Related Issues
Closes #6584
Progress Checklist
Note: before starting this checklist the PR should be marked as non-draft.
break existing features:
https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
(this is important as to not waste the time of Thrive team
members reviewing this PR). This includes gameplay testing by the PR author.
styleguide.
Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.