📜 ⬆️ ⬇️

Localization of games and applications in Unity. Quick and convenient

Hello! In this article, I will share my experience in localizing games and applications in Unity, and also talk about my Simple Localization plugin, which is available in the Asse Store. Level of article - Easy. There will be no code at all, it will not be useful to you.



From the point of view of the general concept, everything is simple. We should have a list of dictionaries for each language with the same keys, from which we will get localized values. On the technical side, you need to determine:
')

When implementing, I was guided by two principles: simplicity and convenience. So, the simplest structured format that is suitable for dictionaries is CSV (Comma Separated Values). This is a text file in which all cells are separated by a separator - either a comma (",") or a semicolon (";"), depending on the regional settings. CSV can be opened and edited in any text editor, but Excel is best for this. CSV will be stored, of course, in the Resources folder so that the application can read them at any time.

The format will be as follows: the first column is the keys, all subsequent columns are the dictionaries. The first line is the heading. It is possible to have one common CSV, if there are few texts in the application, but it can be split into several CSV according to some principle, for example: menu, settings, achievements, etc.

Go ahead. Editing the localization in Excel is great, of course, but I suggest uploading them to Google Sheets. Then you can edit them from any place, at any time and from any device. But the most important thing is that localization can be shared with translators, and they will not have any difficulties with translation. You can look at the dictionary by reference .


And the last point is integration with Unity, with uGUI. Here, too, everything is simple - for each text component Text we will add our own component LocalizedText , in which we will specify the key. When launched, this component will receive a localized value and set it to Text .



Then a few questions arise:


Well, the last thing in my asset is that he can automatically download all sheets from Google Sheets and save them in game resources. To do this, there is the LocalizationSync component, which has a Sync button (in the inspector).

You can download it in the Asset Store: Simple Localization .

Source: https://habr.com/ru/post/417675/


All Articles