TIPS FOR DEVELOPERS

Avoiding Common Issues in Your Russian Localization From the Start: Part 2

While these tips may seem obvious, they will help you avoid the common issues I come across in almost every project I work on.

In part 2 of my Tips for Developers series, I discuss the importance of not hard-coding around your source-language grammar where possible and recommend some points to consider before localizing variables

2.1. Concatenation

English is an analytic language, meaning it primarily conveys relationships between words in sentences by way of things like particles, prepositions, and word order as opposed to utilizing inflections.

This means that if you craft a phrase out of words which have been translated separately, the concatenation of the sentence will likely be logical in English (and, incidentally, in a language like Chinese), but probably isn't going to work for Russian. This is because Russian, and other languages like it, are synthetic languages, and when you combine words that have been translated without regard to inflections of gender, number, case, etc., you're going to end up breaking grammar rules.

Best-case scenario, you'll be left with a translation full of clumsy workarounds. Worst-case scenario, you'll need to alter your code in order to prepare your strings for localization.

In the example below, the terms "Common" and "Guild Gift" have clearly been translated separately: "Common" has been translated in the singular form, while "Guild Gift" is in the plural form. This indicates that one or both of the terms is a variable which has been coded using English grammar rules, leading to a single/plural mismatch. Additionally, the word "Guild", which should not be capitalized in Russian since it appears within a sentence, has remained capitalized as it would be in English.
Another concatenation issue in the same image is that the word "MORE" has been translated separately from "+600%." Phrases cannot often (or even usually) be translated word-for-word into your target language: for this term, we need to add a particle before "+600%" and remove the "+" sign in order to make the Russian phrase grammatically correct, e.g. "НА 600% БОЛЬШЕ".

My general advice on this point is to try and avoid hard-coding around English grammar when possible and don't be tempted to cut costs by doing so.

Incidentally, the poor overall quality of the localization in this game suggests that machine translation may have been involved. This is something I'll discuss further in part 3 of my series.

2.2. Variable Descriptors

Always be sure to label your variables descriptively and/or provide comments describing the character, item, etc. they represent.

Instead of labeling your variables {1}, {2}, and {3}, try to label them using unambiguous, real-world terms, e.g.: {hero_male}, {player_any_gender}, {tower1}, {time_ago}, {enemy_name}, {ally_rank} etc.

Avoid giving 2 different variables in a single sentence the same designation, for example, %s and %s. This is very likely to lead to confusion if the order of the variables gets switched in translation. And on that point — make it possible for your translator(s) to change the order of your variables according to target language grammar rules. This may seem obvious, but all of the issues I list here are things I've come across in the past.

While the variables themselves may not get translated, knowing what they stand for makes it considerably easier to translate the parts around them correctly.
It can also help to provide your translator with some or all of the values the variable stands for, as this will help them choose the correct grammatical form of the word in the target language.

If you follow these rules when creating variables, your translator will get it right, you won't need to spend time answering language questions, and ultimately, your end users will enjoy the result!

2.3. Plural Rules
(For Language Ninjas Only!)

If you're a true language ninja, keep reading! If not, scroll on down to 2.4.

While there are only two possible forms of the noun or unit expression in English (singular and plural), other languages, such as Russian, can have multiple forms.

Here's what I mean. This is English:
{0} Crystal
{1} Crystals
Simple, isn't it?

You just add -s (or -es) to the end of the noun to make it plural and… that's it! Then, you can simply write two forms into your code: a singular form for 1 and a plural form for any other number.

In Russian, on the other hand, we have this:
{0} кристалл
A singular form is used for all numbers ending in 1 except those ending in 11:
1, 21, 31, 41, ... 101, 121, 131... (yes, even a number like 51 is singular!)

{1} кристалла
Then, we need a paucal form for numbers ending in 2–4 except those ending in 12–14:
2–4, 22–24, 32–34, 42–44, ... 102–104, 122–124, 132–134...

{2} кристаллов
And finally, there is a plural form for all other numbers except those ending in 1–4:
0, 5–20, 25–30, 35–40, 45–50, ... 95–100, 105–120, 125–130...
Looks complicated, right? Well, that's how the Russian language works.

And did I mention that the numbers also change their form depending on gender and case? Well, they do, but that's a topic for another time :)

You don't need to know Russian grammar inside out to get this right — just make sure you take the variable number system above into account when writing your code.

The only (non-Russian) products I've seen that had this element implemented correctly were creations by Google, Airbnb, and a few other large multinationals. Almost none of the developers I've worked with (either directly or indirectly) have ever even heard of these plural rules, and it tends to come as a big surprise to learn they've been doing it wrong.

Here's an example from a game that has 10M+ installs:
Obviously, this combo counter reads: 21 hits, 22 hits, 23 hits, 24 hits, 25 hits.

In Russian, this should be localized as: 21 удар (singular form for numbers ending in 1), 22–24 удара (paucal form for numbers ending in 2–4), and 25 ударов (plural form for all other numbers).

However, the string has been localized using English grammar rules, meaning that ударов has been incorrectly applied to all three situations.
All of this means that the strings below will work perfectly in English, but will probably be a mess in Russian:
Win {0} PvP Matches
Get {0} Headshots in PvP
Get {0} Headshots in Campaign
Get {0} Headshots in Arena
Do {0} Weapon Upgrades
Do {0} Gear Upgrades
Do {0} Perk Upgrades
Open {0} Supply Chests
When code does not include a smart count feature, we end up having to use clumsy workarounds like these to avoid grammar issues:
Кристаллов: {0}
Кристаллов: {1}

or

{0} кристалл
Кристаллов: {1}
When used in the middle of a sentence, that workaround looks like this:
English:
Collect {0} Crystals to get a reward.

Russian:
Собери кристаллы ({0}), чтобы получить награду.
To avoid breaking grammar rules, the variable number has to be placed after the word "crystals". The result is comprehensible, but it doesn't flow naturally. What's more, a workaround solution like this may create layout issues in the localized version of a product (as in the first example above), as well as ruining the invisibility of the translation.

Check out how to handle Russian plural rule properties for iOS and Android. For other languages, see this comprehensive chart.

2.4. Adjectives Within Variables

Never use adjectives as variables!

Let's say you have several strings which are used as rarity names or league tiers:
Bronze
Silver
Gold

Common
Rare
Legendary

and so on...
Often, developers will code these words individually and insert them, unchanged, into other strings as adjectives, for example:
You've got {number} {adj_tier1} Medals
You've been promoted to {adj_tier2} League

Selling 5 {adj_rarity1} Players gives you a {adj_rarity2} Coach
This works perfectly for English, and presumably, is also a timesaver when coding. Which must be why every developer loves to do it...!

Unfortunately, however, this approach breaks tons of grammar rules when you apply it to a synthetic language like Russian.

To avoid teaching you the entirety of Russian grammar right now, let me just say that Russian adjectives have singular and plural forms and can change case just like their nouns. So, just because "Bronze" stays the same in all of these lines in English:
Bronze
Bronze Medals
1 Bronze Soldier
1 Bronze Medal
2 Bronze Medals
5 Bronze Medals
No Bronze rewards
You've been promoted to Bronze League
…is absolutely no guarantee that it won't be changing in Russian (or any other language):
As you can see, there are multiple word endings, as well as a different set of rules for capitalization (a topic I'll touch on again in part 3). This means that if we translate "Bronze" strictly as "Бронза" (noun) or "Бронзовый" (adj.) and then insert this translation into strings such as "You've got {number} {adj_tier1} Medals" or "You've been promoted to {adj_tier2} League", we'll be using the wrong part of speech and creating a disagreement in number in Russian every time.

But there is good news! And here it is: you don't need to know all of these rules :)

Here's what you do need to do:

1. If you must use adjectives as stand-alone strings, try to use them (and their translations) in that context only

2. Then, create a bunch of set strings describing the various possible uses of each item, like so:
You've been promoted to Bronze League
You've been promoted to Silver League
You've been promoted to Gold League

You've been demoted to Bronze League
You've been demoted to Silver League
You've been demoted to Gold League

You've got {number} Bronze Medals
You've got {number} Silver Medals
You've got {number} Gold Medals

For true ninjas:

You've got {singular} Bronze Medal||||You've got {paucal} Bronze Medals||||You've got {plural} Bronze Medals
You've got {singular} Silver Medal||||You've got {paucal} Silver Medals||||You've got {plural} Silver Medals
You've got {singular} Gold Medal||||You've got {paucal} Gold Medals||||You've got {plural} Gold Medals
And don't worry about paying for all the repeated strings when it comes time to localize! Any good translator will offer you a significant discount on text with a high number of repetitions.

2.5. Other Examples of Bad Hard-Coding

Here's another example of hard-coding that makes localization difficult:
English:
Cannot %@ a club while a round is in progress
Cannot %@ while a round is in progress
Save and %1$@ %2$li Clubs

Russian:
Не удается %@ клюшку, пока идет раунд
Не удается %@, пока идет раунд
Сохранить и %1$@ клюшки: %2$li
In this case, a verb has been translated separately and is being used as a variable. This creates the same issues as the adjective-variables described above; the way the verb is translated in isolation may not fit with its grammatical and contextual usage everywhere in the text.

2.6. Good Variable Coding in Action

Here's just one example of what smart variable usage looks like in practice – I came across this code in a popular game:
English:
{0.FirstName} is going through a phase. {M0.He}{F0.She}'s found a spirit animal. {0.FirstName} will only want to wear {M0.his}{F0.her} Bear suit.

Russian:
{0.FirstName} проходит одну из стадий. {M0.Он нашел}{F0.Она нашла} свое тотемное животное. {0.FirstName} теперь хочет носить только {M0.}{F0.}костюм медведя.
Here, the client has implemented a pair of gender-specific variables, allowing the string to flow freely for either a male or female character. What's more, the English verb in red also changes in Russian depending on the gender of the character, but with the flexible variable system, this challenge is easily solved by including the appropriately-gendered translation of the verb in the bracket for each gender. Finally, the his/her pronoun encompassed by the second set of variables should be omitted entirely according to Russian grammar, and thanks to the flexible coding, this is also easy to do.

I'll be updating this space with more examples of good variable coding from time to time, so stay tuned!
If you like this article, feel free to comment or share it with your colleagues.

In the meantime, be sure to check out my other articles on what to consider when localizing your game or app:
You can also find out more about some of the projects I've worked on in the past:
If you have questions, comments, or a project that needs localizing, get in touch!