This repository has been archived by the owner on Dec 20, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathREADME.txt
76 lines (53 loc) · 3.51 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
NOTE: There is a newer, closed source version available(2.0) at the Unity Asset Store: https://www.assetstore.unity3d.com/en/#!/content/7543
Smart Localization by Niklas Borglund - niklasborglund[at]gmail[dot]com, @NiklasBorglund
---------------------------------------
Localizing your game has never been this easy. Localize your game with only a few mouse clicks.
Just open the Smart Localization Window in Window->Smart Localization and start by pressing
"Create new localization system".
Edit the root language file by adding some keys and base values.
To create a new language, choose a language from the drop down menu and press "Create Language". To edit and
translate a language, press the name of the language in the language list in the main window.
The example scene in Assets->SmartLocalization->Scenes->LoadAllLanguages will load a list of all
the available languages that you have created along with your keys/values.
This plugin also supports Microsoft Translator. All you have to do is to create a Microsoft Translator account
and paste in your credentials in the main window and press "Save" and "Authenticate". The translate language
window will show a drop down menu of languages to translate from if that specific language is supported.
Microsoft Translator gives you 2 million characters to translate each month for free.
Guide to get a Microsoft Translator Account: http://blogs.msdn.com/b/translation/p/gettingstarted1.aspx
To get the values at runtime:
//Returns a text value in the current language for the key
string myKey = LanguageManager.Instance.GetTextValue("MYKEY");
//Gets the audio clip for the current language
AudioClip myClip = LanguageManager.Instance.GetAudioClip("MYKEY");
//Gets the prefab game object for the current language
GameObject myPrefab = LanguageManager.Instance.GetPrefab("MYKEY");
//Gets the texture for the current language
Texture myTexture = LanguageManager.Instance.GetTexture("MYKEY");
//To cache the LanguageManager in a variable
LanguageManager languageManager = LanguageManager.Instance;
//Get a list of all the available languages
List<string> availableLanguages = LanguageManager.Instance.AvailableLanguages;
//Get a list of all the available languages (System.Globalization.CultureInfo)
List<CultureInfo> availableLanguages = LanguageManager.Instance.AvailableLanguagesCulture Info;
//Get the system language( string = "en" "sv" "es" etc.)
string systemLanguage = LanguageManager.Instance.GetSystemLanguage();
//Check if a language is supported(string = "en" "sv" "es" etc.)
LanguageManager.Instance.IsLanguageSupported("en");
//Change a language(string = "en" "sv" "es" etc., Make sure the language is supported)
LanguageManager.Instance.ChangeLanguage("en");
//Set the default language(The language that will be loaded(if it exists) at startup)
//takes System.Globalization.CultureInfo or string
LanguageManager.Instance.SetDefaultLanguage("en");
LanguageManager.Instance.SetDefaultLanguage(currentCultureInfo);
Smart Localization saves the language files in the .resx file format. ResX is commonly used for globalization
and localization. A wide variety of software is used to translate .resx files.
An example of a good editor is: http://resex.codeplex.com/
Video tutorials:
http://www.youtube.com/watch?v=f6f2Osufjno
http://www.youtube.com/watch?v=DABGRPXhooc
Unity forum thread:
http://forum.unity3d.com/threads/173837-RELEASED-Smart-Localization-for-Unity3D
This project is licensed under the MIT License.
contact information:
niklasborglund[at]gmail[dot]com
https://twitter.com/NiklasBorglund