Page 1 of 1

Language options

Posted: Wed May 18, 2016 11:15 pm
by supadupa64
How would I go about making all my dialogue into Spanish or Chinese so the player can choose the language they want?

Re: Language options

Posted: Thu May 19, 2016 8:30 am
by Tony Li
Hi,

Info about language localization is here: Localization.

Here are the basic steps:

1. On the Dialogue Editor window's Templates tab, expand Dialogue Entries. Click the "+" to the right of Dialogue Entries twice to create two new fields. Change their Type to Localization. For the Titles, I like to use Microsoft's Table of Language Codes since it's fairly standard. So zh-CN for Chinese, es-ES for Spanish.

2. To translate each dialogue entry node, inspect the node and expand the All Fields foldout. Click the Template button to apply the new template fields. (Any new nodes that you create will automatically have the new fields.) You should see "zh-CN" and "es-ES" fields below the "Dialogue Text" field in the main part of the inspector.

3. To test a translation, set the Dialogue Manager's Localization Settings > Language to one of the codes (e.g., zh-CN).

You can set up a menu to allow the player to choose their language. Hook up your UI button to the DialogueManager.SetLanguage as described in How to Switch Languages using the Dialogue Manager.

To read more about localizing dialogues and localizing quests, read this section.

Your regular (non-dialogue) UI stuff probably has text, too. You can localize that using a Localized Text Table as described here.

Developers often hire or enlist external translators. They usually like to work in a spreadsheet format like MS Excel. You can export localized text tables and dialogue databases as CSV files and then import them into MS Excel, Google Sheets, etc., before handing them off to translators. When you get the files back, you can re-import them back into your project.

Re: Language options

Posted: Thu May 19, 2016 2:35 pm
by supadupa64
This is really great! Thanks! So just to make sure, I can import all the translated text so I don't have to manually add the translation to each specific dialogue node?

Also, would checking the "use system language" box under localization settings default to their computer language settings on start then? Would there be a problem if someone had Russian settings on their computer, but the game didn't support Russian?

Re: Language options

Posted: Thu May 19, 2016 4:55 pm
by Tony Li
supadupa64 wrote:This is really great! Thanks! So just to make sure, I can import all the translated text so I don't have to manually add the translation to each specific dialogue node?
That's right. Before sending your database off to be translated, practice exporting and re-importing a few times to get the hang of it. Since dialogue databases have lots of different kinds of data, the format of the spreadsheet is a little complicated. (It's documented here.) Make sure you can open the CSV file in MS Excel, edit it, and then convert it back into a dialogue database in Unity. (Always keep backups of your database in case something goes wrong.)
supadupa64 wrote:Also, would checking the "use system language" box under localization settings default to their computer language settings on start then?
Yup. It uses the language codes defined by Microsoft. See the link in my previous reply.
supadupa64 wrote: Would there be a problem if someone had Russian settings on their computer, but the game didn't support Russian?
Yes. In this case, it will fall back to using the default, non-localized text (e.g., the Default Text field).