Smart Localization works with both Unity Pro and Free.
Localizing your game has never been this easy!
Supporting multiple languages in games is becoming increasingly popular, and with Smart Localization you can get full support with just a few mouse clicks!
Smart Localization automatically creates a new folder structure where you can save all your localization data.It 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.
This plugin also supports Automatic Translations with 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
//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<SmartCultureInfo> availableLanguages = thisLanguageManager.GetSupportedLanguages();
Get the smart culture info of the system language if it is supported. otherwise it will return null
SmartCultureInfo systemLanguage = thisLanguageManager.GetSupportedSystemLanguage();
//Check if a language is supported with an ISO-639 language code (string = "en" "sv" "es" etc.)
LanguageManager.Instance.IsLanguageSupported("en");
//Check if a language is supported with an instance of SmartCultureInfo
SmartCultureInfo swedishCulture = new SmartCultureInfo("sv", "Swedish", "Svenska", false);
LanguageManager.Instance.IsLanguageSupported(swedishCulture);
//Change a language with an ISO-639 language code ("en" "sv" "es" etc., Make sure the language is supported)
LanguageManager.Instance.ChangeLanguage("en");
//Change the language with a SmartCultureInfo instance
SmartCultureInfo swedishCulture = new SmartCultureInfo("sv", "Swedish", "Svenska", false);
LanguageManager.Instance.ChangeLanguage(swedishCulture);
//How to register on the event that fires when a language changed
LanguageManager.Instance.OnChangeLanguage += OnLanguageChanged; //OnLanguageChanged = delegate method that you created
//Enable extensive debug logging
LanguageManager.Instance.VerboseLogging = true;
//Check if a localized key exists
LanguageManager.Instance.HasKey("myKey")
Smart Localization 1.1 is submitted to the asset store!
Version 1.1. will add drag drop interface for prefabs, textures and audio clips which will make it extremely easy to localize assets within your game.
It will also copy your assets into an automatic folder structure, keeping track of all your localized assets.
Version 1.1 will be available on the Asset Store soon.
Smart Localization 1.1 is released.
NEW FEATURE: Drag Drop Interface for localized Prefabs
NEW FEATURE: Drag Drop Interface for localized Audio Clips
NEW FEATURE: Drag Drop Interface for localized Textures
NEW FEATURE: Complete automatic folder structure for localized assets
NEW FEATURE: Define keys to a type
NEW FEATURE: Delete languages from editor
Question: I have an excel file with all of the languages, does the package have some sort of batch input so that I donāt have to enter every single entry?
No, thereās unfortunately no feature like that in the package. What you could do however, is to try and convert your .xls file into a .resx file and compare with how the .resx created in the Smart Localization plugin looks and change accordingly.
They should not be that different(if any), depending on how your excel file looks.
However we seem to be having difficulties making this run on Windows phone 8 as the microsoftās version (.NET 4.0) of the CultureInfo class doesnāt have a method called GetCultureInfo. We tried replacing this with new CultureInfo but seem to be getting some weird errors that donāt look even remotely connected to the CultureInfo class.
Could you please assist us with solving this?
Do Windows Phone 8 use some kind of subset of .Net 4.0? If so, can you send me a link to the documentation? Because if iām looking at the .Net 4.0 docs, they do seem to have a function called GetCultureInfo - http://msdn.microsoft.com/en-us/library/yck8b540(v=vs.100).aspx
It is a weird error you are getting though, but read elements and load language should not have anything to do with the culture info class. Does the languages created in the Resources folder look alright?
You can still use all the functions in the editor, right? Itās only when you build to the phone the errors come?
Iām not in a position to try this on WP8 yet, but you could try and put some special cases (that only turns in effect when you run in wp8 ) in the LanguageManager and only use the List availableLanguages in there. (Like in GetAvailableLanguages() in line 291)
Some pseudocode:
#if !WINDOWS_PHONE_PLATFORM
....Any code that's related to the CultureInfo class.
#endif
The Localization System itself is not dependant on the CultureInfo class. What matters is the language strings in the availableLanguages list. That contains the necessary strings like āenā āesā āfrā āsvā to load the languages.
Hope that helps. Let me know if it worked. Iāll also look into the issue some more.
Sorry for the delay. Iāve fixed some of the bugs on this project now, thereās still some things left to be fixed - but overall things should work a lot better now.
Changes:
Sorted the keys in alphabetical order
Saved the language file properly with the XMLWriter
Several bug fixes
Some code refactoring
However, this version is not uploaded to the Asset Store(yet), it needs some testing. I have uploaded the complete project on github until then under the MIT - License, so feel free to use it.
To use it in your project, just download the code from github and replace the contents in the SmartLocalization folder with that. Make sure to backup your project before attempting this.
I will try and find the time within the next few days to test it and upload the latest version to the asset store as well.
Any questions, comments or feedback can be sent in this thread or DM me on twitter.
Iām developing mini games for Windows Phone 8 and I really need SmartLocalization for my next project.
Iāve attached my workaround to be able to use SmartLocalization in WP8, and gladly this tweak worked well! (at least for GetTextValue).
I hope you can merge my packages with your code so that next version of SmartLocalization in asset store will support Windows Phone 8 out of the box + Playmaker.
Looking forward to see this asset grab its popularity!
Unfortunately I do not own playmaker, so I canāt test your addons for that. Maybe thereās a possibility to create a github fork or something for supporting extensions until we can find a more sustainable solution.