SEP 04, 2024
Gamedev, Game design
<aside> 📒 Localizing is hard. Here are some potential pitfalls.
</aside>
Use explicit names for variables to cut down the time spent explaining. Adding examples makes it easier for the translator :
[Obfuscated variable names]
"{0}{1} of {2}"
[Explicit variable names]
"{Quality}{WeaponType} of {Element}": "Large Sword of Fire"
Provide the ability to change the word order:
[Eng]
"{Modifier}{WeaponType} of {Element}": "Large Sword of Fire"
[Spanish]
"{WeaponType}{Modifier} de {Element}": "Espada Grande de Fuego"
Gender-, plurality-, and grammatical cases-aware conditionals
Gender
{GenderSwitch:
{Male:He is a swordsman.}
{Female:She is a swordstress.}
{Nonbinary:They are a sword master.}
}
Pulling correct forms of the word depending on the passed argument
[Eng]
"{CharName} received {RewardType:nom}": "Bartholomew received a Spear"
"{CharName} hit you with a {Weapon:nom}": "Goblin hit you with a Spear"
[Ukr]
"{CharName} отримав {RewardType:acc}": "Остап отримав Списа"
"{CharName} вдарив вас {RewardType:inst}": "Гоблін вдарив вас Списом"
Plurality: English has two forms of plurality, some languages may have more. Being able to change the form programmatically alleviates the need for workarounds or lengthy if-else statements
[Eng]
"You see {num} {weapon(num)}": "You see 1 sword"
"You see 2 swords"
"You see 5 swords"
[Ukr]
"Ви бачите {num} {weapon(num)}": "Ви бачите 1 меч"
"Ви бачите 2 мечі"
"Ви бачите 5 мечів"
Separate logic and content. In the following example, text fields are marked as changed – but nothing actually needs to be translated. That’s because the text fields contain technical data (string IDs) that is used to pull descriptions. Translators do not need to see such technicalities