|
1 | | -Unity Localization |
2 | | -================== |
| 1 | +**DFT Games Localization Solution** |
3 | 2 |
|
4 | | -This project is meant to provide a no-nonsense, |
5 | | -[KISS](https://en.wikipedia.org/wiki/KISS_principle) compliant implementation of |
6 | | -a Localization System for Unity. The main requirements we try to satisfy here |
7 | | -are: |
| 3 | +[TOC] |
8 | 4 |
|
9 | | -- Use simple text files, easy to send to translators, no Unity required for |
10 | | - them |
| 5 | +# Introduction |
11 | 6 |
|
12 | | -- Allow full UI localization (including sprites) |
| 7 | +This package delivers 2 independent features: |
13 | 8 |
|
14 | | -The code is published “as is”, exactly the way we use it. Feel free to use it |
15 | | -the way you see fit. |
| 9 | +- Text localization (both UGUI and Text Mesh Pro) |
| 10 | +- UI Image localization (2D Sprites) |
16 | 11 |
|
17 | | -DFT Games Localization Solution |
18 | | -=============================== |
| 12 | +Two are the steps to implement localization: |
| 13 | + 1) Prepare the localized files |
| 14 | + 2) Add the script to the UI elements you want to localize |
19 | 15 |
|
20 | | -This package delivers 2 independent features: *) Text localization (both UGUI |
21 | | -and Text Mesh Pro)* ) UI Images localization (2D Sprites) |
| 16 | +# Localized Files Location |
22 | 17 |
|
23 | | -Two are the steps to implement localization: 1) Prepare the localized files 2) |
24 | | -Add the script to the UI elements you want to localize |
| 18 | +The necessary files must be located in the following folders: |
25 | 19 |
|
26 | | -### Localized Files |
| 20 | +**Resources\localization** |
27 | 21 |
|
28 | | -The necessary files must be located in the following folders: |
| 22 | +Here you add the language files. Each file must be named following the scheme **LanguageName.txt**, so for English, you'll create a file named **English.txt**; for Italian, the file will be **Italian.txt** and so on. |
| 23 | + |
| 24 | +The file content is structured this way: **one key/value per line**. |
| 25 | + |
| 26 | +Valid key/value separators are: |
29 | 27 |
|
30 | | -**Resources\\localization** |
| 28 | +- the equal sign |
| 29 | +- the Tab character |
31 | 30 |
|
32 | | -Here you add the language files. Each file must be named following the scheme |
33 | | -\<languageName\>.txt, so for English you'll create a file named English.txt, for |
34 | | -Italian the file will be Italian.txt and so on. |
| 31 | +To add a new line simply use the sequence **\n** in the text |
35 | 32 |
|
36 | | -The file content is: |
| 33 | +Example: |
37 | 34 |
|
38 | | -one key/value per line. valid key/value separator are the equal sign (=) and the |
39 | | -Tab character (0x09). To add a newline simply use the sequence **\\n** |
| 35 | + Resources\localization\UI\<LanguageName> |
| 36 | + |
| 37 | + Be sure to use the same sprite name for all its version and store each sprite in its language specific folder. |
40 | 38 |
|
41 | | -**Resources\\localization\\UI\\\<LanguageName\>** |
42 | | -Be sure to use the same sprite name for all its version and store each sprite in |
43 | | -its language specific folder. |
| 39 | +The language name **must be** one of those listed here: https://docs.unity3d.com/ScriptReference/SystemLanguage.html |
44 | 40 |
|
45 | | -The **language name** must be one of those listed here: |
46 | | -https://docs.unity3d.com/ScriptReference/SystemLanguage.html |
| 41 | +# Scripts to use |
47 | 42 |
|
48 | | -Once you have prepared the files all you have to do is to add the correct script |
49 | | -component to the UI element you want to localize. LocalizeImage for the UI |
50 | | -Images Localize for the UGUI Text LocalizeTM for Text Mesh Pro UGUI |
| 43 | +Once you have prepared the files all you have to do is to add the correct script component to the UI element you want to localize. |
| 44 | + **LocalizeImage** for the UI Images |
| 45 | + **Localize** for the UGUI Text |
| 46 | + **LocalizeTM** for Text Mesh Pro UGUI |
0 commit comments