Search Unity

[RELEASED] Smart Localization for Unity3D

Discussion in 'Assets and Asset Store' started by NiklasBorglund, Mar 13, 2013.

  1. JEDressler

    JEDressler

    Joined:
    Apr 18, 2015
    Posts:
    7
    I think the problem is the .Instance
    Using a Singleton throws the same error for me on my Windows Phone
     
  2. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Ok - that sounds odd :p Can you try adding the LanguageManager script to a GameObject in your scene before you build your WP8 project and see if that works? Maybe it's something about creating it like that at runtime that's the problem.
     
  3. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
    Hi,

    LanguageManager.Instance.GetSupportedSystemLanguage() is returning null on my Android . The device is set to Portuguese (Portugal) and I have a pt-PT translation set in Smart Localization settings, am I doing something wrong?
     
  4. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Oh yeah, I've been meaning to rename that method - got thing you reminded me. I'll add it to my todo list ;)

    What it does is that it get's the system language culture info IF the language is supported. And how it does that is to use the Application.systemLanguage and maps that with the english name. And the Application.systemLanguage doesn't support regions in their enum. So Portuguese have to map to pt only to work.

    So change your pt-PT to only pt Portuguese to make it work.

    P.S I have never tried this myself, but I know this plugin that reportedly got region support for ios/android with SmartLoc - https://www.assetstore.unity3d.com/en/#!/content/33320 - maybe that can help if you must have auto detection for regions.
     
  5. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
    Thank you,

    I ended up iterating through all available languages via LanguageManager.Instance.GetSupportedLanguages() and pick the best one for the device's language and country
     
    NiklasBorglund likes this.
  6. Rienhl

    Rienhl

    Joined:
    Nov 14, 2013
    Posts:
    42
    Hello guys, thanks a lot for this Asset, I've found it extremely useful.

    One thing I can't find (or maybe it is not included) is how should I do when one text component can have more than one possible string.

    I usually attach the LocalizedText.cs script to the gameobject that contains the UI Text and then select the desired key.

    For cases when the UI Text can show from an array of localized strings (for example item names on a character creation instance), I just create an array in script, fill it with the different possible names by doing:

    Code (CSharp):
    1. array.Add(LanguageManager.Instance.GetTextValue("key00");
    2. array.Add(LanguageManager.Instance.GetTextValue("key01");
    3. array.Add(LanguageManager.Instance.GetTextValue("key02");
    and then depending on the item i choose the correct key.

    My question is, does Smart Localization already bring a solution for when one text component can have several different localized values? I mean, in a way that I can avoid working with keys on my scripts, justhaving my designer input them on the inspector.

    I can creat a custom script to do this, it's not complciated, but does Smart Localization already have something like that?
     
  7. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    No, Unfortunately we do not have something like that in the Smart Localization package yet.

    But I'm sure we could work something out :)

    However, I'm not really sure I understand how it would work. How would the LocalizedText script choose what key to use in the array of keys?
    I think I understand the use case you are looking for, but how would you want something like this to work in the editor?

    Thanks,
    /Niklas
     
  8. Nergard

    Nergard

    Joined:
    Oct 20, 2015
    Posts:
    2
    Hi there. Is it possible to import root language as a csv? I see such an option for other languages, but not for root.
     
  9. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Hey - I'm having a problem with Chinese on Android. (Unity 5.2.3f1)

    If I select any of the Chinese langauges on my Android devices

    LanguageManager.Instance.GetSystemLanguageEnglishName() returns 'Unknown'

    and

    LanguageManager.Instance.GetSupportedSystemLanguage()
    returns null.

    whereas

    Application.systemLanguage returns 'ChineseSimplified' | 'ChineseTraditional'

    This works perfectly fine on iOS.

    Any ideas?

    I've tried this on two devices with the same result:

    Type: Galaxy Note 10.1 tablet
    Model: GT-N8010
    Android Version: 4.1.2
    Kernel version: 3.0.31-805288

    and

    Type: OnePlus One
    Model: A0001
    Android Version: 5.1.1
    CyanogenMod Version: 12.1-YOG4PAS3JL
     
    Last edited: Nov 22, 2015
  10. Schromercy

    Schromercy

    Joined:
    Oct 26, 2013
    Posts:
    4
    Hello, I am having problem with localize sprite..
    I am developing game for 2D. My assets (sprite) using power of two concept. so for example, the image size is 256x128, but the actual content size is only 200x120. Assets imported with Sprite (2D and UI) texture type and multiple sprite mode, then i slice it manually with Unity Sprite Editor.
    The problem is. When choosing texture in SmartLocalization window, i cannot choose the sliced image (200x120 image on the example), instead of only the full image (256x128 image on the example).. As the result, the size of the texture is not the same as i wanted, it will always be smaller..
    Am i doin it the wrong way? or is it another solution to solve this problem? thanks
     
  11. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    No, Unfortunately we don't have that option. There's a lot of logic behind adding a key in the root file and reading that from a file to detect which keys were changed/deleted/added would be a mediocre script at best (since the root is what all the other languages are governed by) - causing a lot of overhead. We have plans of making it easier to add keys though :)

    Hmm, the GetSupportedSystemLanguage tries to match the English name of the Cultures in SmartLocalization with the enum value of Application.systemLanguage. And a string returning both 'ChineseSimplified' | 'ChineseTraditional' would probably not match with anything.

    Maybe that helps. I've also added it to our todo list.

    Sprites are unfortunately not supported in SmartLocalization. We have it in our backlog, but I'm afraid that it could take a while before that feature is inserted since Sprites does not go well with the fundamental structure of Smart Localization and we need to figure out a good way to insert it without it becoming a hackish job ;)
     
  12. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Edited: Thanks NiklasBorglund I've just done the matching for those and set them explicitly (don't know why I didn't just do that before).

    Thanks.
     
    Last edited: Nov 24, 2015
    NiklasBorglund likes this.
  13. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Ok, great! :) I was planning on making an early beta version with a fix later and email it to you tonight, but if you fixed it yourself that's better. I'll try to get that fix into a release soon anyway :)
     
    larku likes this.
  14. rafaellop

    rafaellop

    Joined:
    Feb 4, 2015
    Posts:
    26
    Hi, please tell me if the store presence gebnerator for iOS works correctly? I've got 15 languages supported in my game, but if I build for iOS the info.plist file contains no CFBundleLocalizations key with the languages items and the Project / Info tab in xcode contains only few languages like English, French, German, Japanese. If I try to add the CFBundleLocalizations key manually in the xcode the list of available languages to select is also limited to just few. How to solve this please?
     
  15. Miguel-Ferreira

    Miguel-Ferreira

    Joined:
    May 8, 2015
    Posts:
    90
    Hi,

    I was wondering if it's possible to import a root language file from a csv file. The thing is that I'm basically converting a ton of translations from Apple's Localizable.strings to .csv files but I need a way to add all the keys to the root file. So, is there any way to import root language keys from a .csv?
     
  16. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    We'll look into it. Thanks for the report :)

    We don't have a feature like that, but If you could convert your .csv into a resx file - I think you should be able to create a completely new SmartLocalization workspace and simply replace the Languages.resx file that resides there.

    Hope that helps :)
     
  17. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Smart Localization PRO is now on sale during Cyber Weekend! I you like the free version - then I think you'll like the PRO version as well. 50% off!

    https://www.assetstore.unity3d.com/en/#!/content/32055

    Also, If you like our product, please consider writing a review. It would be much appreciated by @zuric & me.
     
  18. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Got it! :)

    While exploring the PRO features I encountered a issue with exported *.xls files, these cannot edited with Excel!?
    Export and import with xls-format works, but I would like to edit the exported file with EXCEL 2013. When I open the file with Excel I get a info-message: "..problem with *.xls detected. Should we recover? If you trust the file press Yes.." but nothing happens :(

    Also I have another question: will "watch file" even work with a standalone build (if I put the xls/csv inside the StreamingAssets folder)? Is it possible to import xls/csv while the game is already running?
     
    Last edited: Dec 1, 2015
  19. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Thank you for purchasing Smart Localization PRO :)

    I'll have a deeper look at the excel issue, but I found some steps that you can try:

    Code (csharp):
    1.  
    2. 1) Right click on File, Properties, now you can see an option of unblock at the lower part of the dialogue box, uncheck the box and click on OK.
    3.  
    4. 2) a) Open Excel 2013,click on File, Options, Trust Center, Trust center settings.
    5. b) Select Protected view, uncheck all the options under Protected View, OK.
    6. c) Restart Excel 2013 andtry to open Excel documents and verify the result.
    7.  
    8.  
    As for the watch file - it is an editor only feature. It's intended use is to have like a .csv file editor up along side while you play it in the editor to see your changes instantly in the game when you save the .csv file.
    I guess you've already seen this tutorial, but In case you haven't - here it is :) - http://www.janetech.co/blog/2015/3/15/using-the-watch-file-feature-in-smart-localization-pro

    How to append new data on an already built game executable can be explained in a post I wrote a while ago here in the forum: http://forum.unity3d.com/threads/released-smart-localization-for-unity3d.173837/page-6#post-2124825
     
  20. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Thanks Niklas!
    Yes, I've already seen the tutorials. Did not know about the resx runtime feature, thanks for that!
    I followed your instructions to open/edit the xls-file in exel 2013, unfortunatly without success. Any idea what's the problem with these xls-files? I would like to send those generated xls-files to our customer (for filling the text information / translation), after that I want to import those modified xls-files.
     
  21. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Ok, we'll look into this. I'll keep you updated on any news we might find. Sorry for the inconvenience.
     
    MS80 likes this.
  22. Rienhl

    Rienhl

    Joined:
    Nov 14, 2013
    Posts:
    42
    Hey! Sorry for the late reply! I've been using another account and forgot about this one.
    For now, I'm doing the following thing.
    When I add my text to the asset, I do something like this:
    KEY: GameResults.Prize.CoinsWon | VALUE: You won (amount) coins!
    Then, I use string.Substring() to separate the "(amount)" from the rest, and change "(amount)" for a custom string which can be: "1", "999", "eleven", "giant unicorn", etc...

    Actually this is the custom script in order to extend the asset to suit my need:
    Code (CSharp):
    1.  
    2. public class LocalizedVariableText : MonoBehaviour {
    3.     public string textKey = "";
    4.     public string customVariable = "";
    5.     public bool setByInspector = false;
    6.     private string localizedText = "";
    7.  
    8.  
    9.     /// <summary>
    10.     /// Includes a custom string in the position between "(" and ")" of the localized text string set by the key on the inspector.
    11.     /// </summary>
    12.     public string setVariableAndReturn(string variableString)
    13.     {
    14.         localizedText = LanguageManager.Instance.GetTextValue(textKey);
    15.         localizedText = localizedText.Substring(0, localizedText.IndexOf('(')) + variableString + localizedText.Substring(localizedText.IndexOf(')') + 1, localizedText.Length - localizedText.IndexOf(')') - 1);
    16.         return localizedText;
    17.     }
    18.  
    19.     /// <summary>
    20.     /// Pass the key of the localized text string and the variable (text, int, float, whatever) and returns the localized string with the variable text included.
    21.     /// </summary>
    22.     public string setKeyAndVariable(string key, string variable)
    23.     {
    24.         textKey = key;
    25.         string temp = setVariableAndReturn(variable);
    26.         return temp;
    27.     }
    28.  
    29.     void OnEnable()
    30.     {
    31.         if (setByInspector)
    32.         {
    33.             setKeyAndVariable(textKey, customVariable);
    34.         }
    35.     }
    36. }
    37.  
    This can then be accesed from script or set from Inspector.

    Has this anything to do with the Plural Support?
     
  23. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    You can use string.Format to do what you want to achieve.
    Your key/value pair would then look like this instead:
    KEY: GameResults.Prize.CoinsWon
    VALUE: You won {0} coins!

    And in code, you'd use it like this
    Code (csharp):
    1.  
    2. int myAmount = 5000;
    3. string myLocalizedString = string.Format(LanguageManager.Instance.GetTextValue("GameResults.Prize.CoinsWoin"), myAmount);
    4.  
    The localized output of this would be "You won 5000 coins".

    The plural support is in using different keys dependent on how many coins you send in. As if it were 1 coin, you'd like it to say "You won 1 coin" and with more than that - you'd want it to say "You won X coins".
    The plural rules can be very different between different cultures. Anyway - here's a guide on how our system works: http://www.janetech.co/blog/2015/4/19/using-the-plural-support-in-smart-localisation-pro

    Hope that helps
     
    Rienhl likes this.
  24. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
  25. hansadler

    hansadler

    Joined:
    May 12, 2014
    Posts:
    50
    Hello,

    With your plugin, is there a way to get the two letter country code and two letter language code. There doesn't appear to be any way to get this in Unity C#.

    Thanks
     
  26. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Hi,

    It's in the languageCode member of the SmartCultureInfo. It contains both the language and the region. (like "en-GB" and "pt-BR")

    I've added it as a feature request to add some convenience methods to extract those in an easier way.

    We've submitted version 2.4.0 to the asset store yesterday. I added a fix that will hopefully solve your issue.
     
  27. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi @NiklasBorglund , I got one question for you, can the root language to be exported and imported ?
    Thanks!
     
  28. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    No, Unfortunately you cannot. You can just change the values in the .resx files in the Workspace and it should be automatically changed though - but don't change the keys, that will just cause other problems.

    Just out of curiosity - why would you want to import/export the root?
     
  29. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Thank you! It seems 2.4.0 fixed the issue, but I can only test it with an older excel version here at home. I will come back and report next year when I will be at the office again. So far 2.4.0 xls feature works great, I can export, import, edit the xls files without any issues. Good job!
     
  30. rafaellop

    rafaellop

    Joined:
    Feb 4, 2015
    Posts:
    26
  31. Rienhl

    Rienhl

    Joined:
    Nov 14, 2013
    Posts:
    42
    Thanks man! That's exactly what I was looking for! Looks like I got confused and reinvented the wheel haha

    I really appreciate all the hard work you out on this asset and supporting everybody!
    Cheers!
     
    NiklasBorglund likes this.
  32. Skelnox

    Skelnox

    Joined:
    Dec 23, 2015
    Posts:
    4
    Hello,

    In my UI, all logos and other sprites are stored in a .PSD file and they are marked as "Sprite (2D and UI)" in the inspector.

    I noticed in your asset, creating a value type "Texture" it is impossible to choose a Sprite (which is logical given the name). Will it be possible in the future to have the opportunity to use 2D sprites in addition Textures?

    It would be great practice for me ^^ "

    Thank you for your response.
     
  33. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    We are still looking at it - but we have unfortunately no solution yet. I'm afraid unity 5.3 support of Smart Localization got priority. Sorry about the inconvenience.

    I want to support Sprites - but I cannot say when we'll do that. Sprites are usually a part of a larger spritesheet and since Smart Localization copies assets to a special folder structure - we would need to design a system around this, which would take some time.

    So hopefully in the future, yes. But we have other features that we are developing at the moment which we prioritize higher.
     
  34. broask

    broask

    Joined:
    Aug 27, 2015
    Posts:
    2
  35. Lhg

    Lhg

    Joined:
    Sep 1, 2014
    Posts:
    3
    Hi, I've started using your plugin a couple hours ago.
    I did create a microsoft azure account successfully, it does authenticate in the smart localization plug-in, and I managed to translate keys/texts... But when I added more texts and tried to translate it gives me this error
    <html><body><h1>TranslateApiException</h1><p>Method: Translate()</p><p>Message: Cannot find an active Azure Market Place Translator Subscription associated with the request credentials.</p><code></code><p>message id=3444.V2_Rest.Translate.51E6C59B</p></body></html>

    I have tried reopening Unity and it does authenticate once again but the error persists...
    In the azure website it says my application is Active and working...

    I have changed my secret, re opened everything and then it worked! For a couple new sentences... after a few minutes the same error appears once again...

    What can I do?
     
  36. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Yeah, you can get the SmartCultureInfo from the device with GetDeviceCultureIfSupported() - That will get your device culture IF your game supports the language. It only maps with the potential values in the Application.systemLanguage - so it's not optimal.

    I've heard about this plugin though that might be useful (Although I have never tried it my self) - https://www.assetstore.unity3d.com/en/#!/content/33320

    Yeah, microsoft does that and I have no idea why. If you put in the wrong credentials and authenticate - it will let you translate a few sentences until you get a message back that you need to use the correct ones.

    So you need to create a specific application for Microsoft Translator if you haven't already.

    I wrote a guide for it not too long ago that explains how to use it with Smart Localization: http://www.janetech.co/blog/2015/12/19/how-to-use-microsoft-translator-with-smart-localization

    Hope that helps
     
  37. lrasomattos

    lrasomattos

    Joined:
    Aug 22, 2015
    Posts:
    29
    Hi! First of all, thanks for the Asset, it's awesome.

    So, we are creating a simple dialogue system by heavily using custom inspector and property drawers. Right now we have to enter the keys as strings, which is not the best. It would be awesome if we could create a property drawer for the string type that would let us select the key just like in your custom inspector, and fill the string with the key.

    Also (this might be harder), but it would be really cool as well, to be able to get a translated text (or at least the root comment text) from the id key, so we could preview the dialogue on our custom inspector.

    Of course you are able to get all that for your own editor window and custom inspector. But I couldn't find a way to access it through your open API. I would like to know if there is an open way to access this information (Keys and Texts) on editor/inspector code, or maybe just leave the idea for adding that feature in the future ;). At least the property drawer would already be great, since we can use it in our own Monobehaviors.
     
    Last edited: Jan 3, 2016
  38. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Hi - I'm glad you like the plugin.

    I took the opportunity to write a short written guide on the method you can use to get values from the editor.

    Here's the link: http://www.janetech.co/blog/2016/1/...localization-getting-language-values-and-keys
     
  39. lrasomattos

    lrasomattos

    Joined:
    Aug 22, 2015
    Posts:
    29
    Ahhh so it was in the LanguageHandlerEditor.
    Thank you so much for the help!
     
  40. MS80

    MS80

    Joined:
    Mar 7, 2014
    Posts:
    346
    Just wanted to report that *.xls import / export works perfectly in SmartLocalizationPro 2.4! Now Excel opens the exported files without any issues / errors, many thanks for your investigation and solving this issue!
     
    NiklasBorglund likes this.
  41. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    That's great! I'm glad to hear that :)
     
  42. akhabaiev

    akhabaiev

    Joined:
    Jan 5, 2016
    Posts:
    4
    Hey, I'm considering to use the plugin to handle i18n in my game, but I have a question that I can't find the answer to, I already shoot you an email, but I'll just post here too in case someone might find it useful. I was wondering what's the best way to set language on the application start to the current device language, and this should obviously work for iphone/andriod/wp8. Maybe a short guide/code snippet would be great, or just simple guidelines?
    Should I create a manager object that will have don't destroy on load and put it into initial scene and do it in the Start() of that object? How do I get the current device language(not the language that's set in the manager of the smart loc)?
     
  43. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Hi, sorry for the late answer.

    You can check the a method called GetDeviceLanguageIfSupported in the LanguageManager

    Code (csharp):
    1.  
    2. SmartCultureInfodeviceCulture=languageManager.GetDeviceCultureIfSupported();
    3. if(deviceCulture !=null)
    4. {
    5. languageManager.ChangeLanguage(deviceCulture);
    6. }
    7. else
    8. {
    9.   //Load Default Language
    10. }
    11.  
    And yeah, doing this in the start method at application start is probably a good idea and setting the languagemanager instance to DontDestroyOnLoad()

    One thing to note though, is that the device language method is based on Application.systemLanguage which lacking in information - especially regional information. The only languages that can be retrieved by default this way with Smart Localization are the ones found at this page: http://docs.unity3d.com/ScriptReference/SystemLanguage.html

    Hope that helps
     
    akhabaiev likes this.
  44. GroundCombo

    GroundCombo

    Joined:
    Jan 23, 2015
    Posts:
    29
    Hi,

    I'm trying to test the plugin, but I can't seem to get started on my Mac (running El Capitan, Unity 5.2.3f1). This is what I've done:

    1) Import Smart Localization free
    2) Open the window -> click Create localization workspace
    3) Click Edit root language file
    At this point, this happens:

    Code (csharp):
    1.  
    2. FileUtility.cs: File to read from does not exist!
    3. UnityEngine.Debug:LogError(Object)
    4. SmartLocalization.Editor.FileUtility:ReadFromFile(String, String&)
    5. SmartLocalization.Editor.LanguageHandlerEditor:LoadParsedLanguageFile(String, Boolean)
    6. SmartLocalization.Editor.SmartLocalizationWindow:OnRootEditClick()
    7. SmartLocalization.Editor.SmartLocalizationWindow:DrawAvailableLanguageItem(Rect, SmartCultureInfo)
    8. SmartLocalization.ReorderableList.GenericListAdaptor`1:DrawItem(Rect, Int32)
    9. SmartLocalization.Editor.SmartCultureInfoListAdaptor:DrawItem(Rect, Int32)
    10. SmartLocalization.ReorderableList.ReorderableListControl:DrawListItem(EventType, Rect, IReorderableListAdaptor, Int32)
    11. SmartLocalization.ReorderableList.ReorderableListControl:DrawListContainerAndItems(Rect, Int32, IReorderableListAdaptor)
    12. SmartLocalization.ReorderableList.ReorderableListControl:DrawLayoutListField(Int32, IReorderableListAdaptor)
    13. SmartLocalization.ReorderableList.ReorderableListControl:Draw(Int32, IReorderableListAdaptor, DrawEmpty)
    14. SmartLocalization.ReorderableList.ReorderableListControl:Draw(IReorderableListAdaptor)
    15. SmartLocalization.Editor.SmartLocalizationWindow:ShowCreatedLanguages()
    16. SmartLocalization.Editor.SmartLocalizationWindow:OnGUI()
    17. UnityEditor.DockArea:OnGUI()
    18.  
    There's nothing under Autogenerated/Resources. On Windows it seems to generate the correct files and works as intended (at least as far as adding new strings and languages). Any ideas?
     
  45. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Are you using the latest version found in the asset store? (2.4.0?)

    You can also try and delete the whole "SmartLocalizationWorkspace" folder and try again.

    I failed to reproduce your issue with the steps you just mentioned. I tried also on El Capitan, but I used 5.2.2 of Unity.
    Let me know if the problem persists and I'll try and download the exact unity version you used to try and reproduce your issue with matching unity versions as well.
     
  46. GroundCombo

    GroundCombo

    Joined:
    Jan 23, 2015
    Posts:
    29
    I should have made some more sanity checks before posting. The problem turned out to be some Android lib dependencies in that particular project, and now after fixing those everything seems to work. Thanks anyway. :)
     
    NiklasBorglund likes this.
  47. akhabaiev

    akhabaiev

    Joined:
    Jan 5, 2016
    Posts:
    4
    After looking into this further, I have additional question. So how will this work on mobile devices(ios, android, wp8)? Will all types of Chinese zones fall under chinese? and which chinese language should I localize in this case: ch-CHT, ch-CHS, ch-TW etc. Same goes for French, Spanish, Russian, Ukrainian, Italian, Korean, Serbian.
     
    Last edited: Jan 13, 2016
  48. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    For Chinese the Application.systemlanguage also got ChineseSimplified and ChineseTraditional.

    But yeah, If you want automatic detection using the basic functionality in unity, you will have to use the languages without a region. like "en", "fr", "es" etc.

    If you want more control than that, you will have to create a native plugin for each platform - extracting the exact ISO-639 code from the underlying Objective-C/Java/.Net.
    More information about native plugins can be found here - http://docs.unity3d.com/Manual/NativePlugins.html

    For example, the method you'd wanna use for Objective-C/Swift for an IOS plugin is one of the ones you can find in NSLocale - https://developer.apple.com/library.../Reference/Foundation/Classes/NSLocale_Class/

    Hope that helps
     
  49. akhabaiev

    akhabaiev

    Joined:
    Jan 5, 2016
    Posts:
    4
    So just to clarify, for localization in chinese I should cover "Chinese-zh-CHT"(Traditional), "Chinese-zh-CHS"(Simplified), and Chinese - zh-CHS(Chinese)? I seem to understand others like for spanish it's just Spanish - es.
     
  50. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Yeah, for example the spanish ones and you want spanish detection like the way in the example - you should just use "es".
    For the chinese - I don't know from the top of my head. I guess the best answer is if you do some research and see which of the ISO-639 codes/cultures of china are most widely used.