Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix and improve translation strings #2471
Pretty much all changes that are not trivial are wrong:
Ugh. No! That's the mortal sin of translation: String concatenation (in the middle of something). Now you force all languages to use the same word order as English. This is wrong and even worse than the previous approach. The correct way would have been to collect each string “White Butterfly”, “Red Butterfly” and “Violet Butterfly” individually, in their FULL form. That way, translators can apply whatever weird grammar rules would change the words and don't have to hack around. If you try to be clever and basically construct the strings programmatically, you make assumptions about other languages and make some translations simply impossible. The word “Butterfly” might not always be translated the same depending on weird grammar rules in other languages.
And now, the butterfly color will not even be collected by scripts …
A proper way would have been:
The same complaints apply for the other string concatenations …
Nooooo! Whyyyyy? That's not how it works! This translation will not work because …
It's completely avoidable. Just add 2 more optional arguments for explicitly specifying the full inner and outer node description. If missing, fall back to the old behaviour (i.e. prepend "Inner"/"Outer"). That's how I did it in MCL2. And obviously, mods are still strongly adviced to provide ALL arguments, but things won't break when they don't.
Yes, it could be avoided. Just don't use the S() in the actual stair API anywhere. Instead, mods that actually call the stair register function are supposed to use the S(). That's how I did it in MCL2.
Great job writing such a negative review when you have no idea what you are talking about.
I'm aware of this limitation, I explicitly preferred doing this instead of excessively repeating strings everywhere.
That's a good idea, I'll do that.
By the way, where do I find this tool?
In theory, yes. In practice, no, because the script won't see it.
Well, but then you just wrote the exact string you wanted to avoid … I don't see the benefit.
Well, the script is not very good and is not finished and lacks features. And you can find multiple versions of it floating around GitHub. Here's one of the versions:
We really need proper and OFFICIAL tools to collect strings. But that's another issue, unrelated to MTG.
The script that I used for my client-side translations: #6325, improved: https://notabug.org/pgimeno/minetest/src/translation-toolchain/util/findtext.lua