[Localization] Certain Formatting of texts is unfriendly for localization
dovisutu opened this issue · 6 comments
code based on 1.16.4
branch when I wrote this, namely, at 1e0fbf2
(Somehow I managed to put the latest commit wrong...)
Problem
Some of the texts in-game are formatted just by joining 2 localized parts together, which may be difficult to localize into a language with different word orders.
For example, see here:
This part of code is used to generate statistics of tracked blocks in the armor HUD.
It generates sentences like 5 Hackables
by joining the number 5 with a translated term. It works for langauges like English, where numerals are put before nouns, and measure words (at least in this circumstance) aren't necessary.
However, in case of a language like Chinese, where measure words are usually needed after numerals, the translation must be prefixed with a measure word, which is somewhat awkward, yet not impossible; to generate a sentence like 5 个可入侵方块
(with the measure word 个
), the translation term should be 个可入侵方块
, which tends to let one think it's wrong, while that's indeed right.
Even worse, in case of a language where numerals are put after nouns, or measure words are put before numerals, or other cases, this sentence cannot be properly translated at all, for in the current code, there's no way of switching the 2 parts. I don't have much knowledge to such language, though. It's said that Japanese is one of those langauges sometimes, but I'm not entirely sure.
Suggestion
Change the current formatting to containing parameters in the translation term itself, like %d Hackables
.
Yes, valid point. I can change the above code to sort that out. If you spot any other places that need fixing please let me know.
Well, upon a search I find a bit more, while not as important as the one mentioned above:
Here, the code used "
to mark the valuable name, while in some languages different quotations may be used (e.g. Chinese “
”
). Not a big deal, but makes it a bit annoying (especially if a language has quotation marks that are really different).
Here, the same thing but for parentheses:
What's interesting is that while searching, I happened to find several instances of hard-coded texts, which I'd like to mention here in addition:
If one of them isn't intended to be shown in-game, just ignore that one. (Since I was in a hurry when doing so...)
After looking back, I find that during the fix, key pneumaticcraft.gui.progWidget.blockCondition.debug.allBlocksMatch
had been rewritten as pneumaticcraft.gui.progWidget.blockCondition..allBlocksMatch
, with debug
dropped. Is that intentional or accidental?
(Yeah, I know I should've posted it in a separate issue and reference this one, but I think it's too minor for one issue.)