{{indexmenu_n>50}} ====== Multilingual Game (Translations) ====== One game, one set of statistics, one set of answer codes — and every player reads the text in their own language. Translations live **beside** the game and replace the text when the page is shown; where there is no translation, the player sees the original. A player whose language matches the game's language gets nothing replaced at all. This is the recommended way. The older ''{% match lang %}'' template ([[en:authors_main:task_editor:advanced:edit_templates#how_to_make_a_multilingual_game|Templates]]) keeps working, but new games are better made with translations: the task text does not turn into N copies of itself, a change to the markup does not have to be repeated per language, and the editor shows what is still untranslated. ===== Turning it on ===== In the [[en:authors_main:task_editor:editor|game editor]], the **"Game settings"** tab, the **"Localization"** block: * **Game language** — the language the game is written in. Until it is chosen the game has no localization at all: nothing is counted, nothing is stored, the editor looks exactly as before. * **Translation languages** — checkboxes for the languages the game is translated into. Next to each one is **"falls back to"**: which language to show for what is not translated in this one yet. Empty means straight to the game's own language. * The **"other languages"** row — where to send a player whose language the game does not have at all. Example: the game is written in Russian and translated into Ukrainian and English, while Polish falls back to Ukrainian (closer than Russian). A Polish player sees Polish where it exists, Ukrainian where Polish does not yet, and Russian where neither does. As soon as there is at least one translation language, a **"Translation"** tab appears in the editor. ===== The "Translation" tab ===== It is a table of "original → translation" pairs. The string from the game on the left, a box for the translation on the right. * **The strings are collected automatically.** Big text (the task, a hint, the poster, the finish text) is cut into paragraphs; short fields (game name, task name, code name, hint description, answer format) go in whole. Nothing has to be marked up in the text. * **Identical text is translated once for the whole game.** When a string occurs in several places, **"places: N"** is shown next to it — hover to see where. Editing such a string changes it everywhere. * **The state of a row** is shown by a badge: own translation, //from language X// (came down the chain), //base// (no translation), or //not translated// on purpose. * **Completeness** is shown as two numbers: how much is translated into this language, and how much comes out with the fallback chain. The second number alone is misleading — it hides untranslated text behind another language. * **Two tabs** — "Strings" and "Links and files": addresses are translated rarely and for a different reason, so they do not clutter the main list. The count on a tab tells whether there is anything in it at all. * **Row groups** — "untranslated", "translated", "not translatable". These are not a choice of one out of three but toggles: they add up. Only untranslated is on by default — that is the work; translated is turned on to proofread what is done, not translatable to take a mark off. The groups are the same on both tabs, and their numbers count the current one. ==== Markup inside a string ==== Bold, links, images and templates inside a paragraph are not typed into the translation by hand: in their place stand **chips** — small numbered boxes. Click a chip and it goes into the translation where the caret is. Chips may be reordered (word order differs between languages), but each one has to appear in the translation exactly once — otherwise the translation is not saved and the editor says so. **Substitutions** behave the same way — ''!username!'', ''!task_n!'' and the rest: they stay in the translation as they are, simply where the sentence wants them. A useful consequence: the tags themselves, the link addresses and the classes live only in the original. Fix a link in the task and it changes in every language at once. ==== What is not translated ==== * **Answer codes are never translated.** That is what keeps the statistics common. Answers in other languages are simply added as comma-separated synonyms of the same code. * **Do not translate this string** — a switch at the end of the table row, with two modes: "do not translate in this language" and "do not translate anywhere". For brands, proper names, Latin quotations. Such strings leave the "untranslated" filter and stop the completeness figure from being unreachable. * **''translate="no"''** in the task HTML is the stronger way: such a piece never becomes a string at all, and even the browser's own auto-translation leaves it alone. For code words and answers inside the text this matters more than it sounds: an auto-translated code word breaks the game. ==== Links and files ==== The second tab of the table, with the same groups in it. Addresses of images, sounds, videos and links are **not** translated by default — nearly all of them are language-neutral. But a translation of an address can be set: that is how a player is sent to a page in their own language, or gets the voice-over in it, while the paragraph and the markup stay single. These strings do not count towards completeness. Subtitles do not need the overlay — HTML already does them: several '''' inside one ''