Search Unity

[RELEASED] Smart Localization for Unity3D

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

  1. Fowi

    Fowi

    Joined:
    Dec 2, 2013
    Posts:
    30
    Correct ;)
     
  2. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    200
    Guys, thanks for this awesome tool, but I have some problems. While I work in the smart localization editor, sometimes it gives me a error like "Detected same key so changing key name etc.":) Than everything crashes. Microsoft translator doesn't translate. Do you know why this happens?
     
  3. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    That doesn't sound good. Can you give me steps to reproduce and information about the system/unity version you are using?
     
  4. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    200
    I couldn't manage to reproduce it again:) Everything works great. I already entegrated it to my project. Thanks again bros. Waiting for pro version:)
     
  5. Muckel

    Muckel

    Joined:
    Mar 26, 2009
    Posts:
    436
    Hi,
    well have still this issue on Android:
    Building the player failed. Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    /Users/xxx/AndroidSDK/sdk/build-tools/21.1.1/aapt package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "/Users/xxx/AndroidSDK/sdk/platforms/android-21/android.jar" -F bin/resources.ap_

    stderr[
    invalid resource directory name: res values-zh-CHS
    invalid resource directory name: res values-zh-CHT
    invalid resource directory name: res values-zh-rCHS
    invalid resource directory name: res values-zh-rCHT
    ]
    stdout[

    so updated to the last Store Version but still fails to build...
     
  6. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    200
    I have an suggestion. Maybe you should add lower case and upper case options to your tool. I mean I have some buttons like "BACK" and I want it to be upper case. When I translate from microsoft translator, it translates in lower cases. Maybe your tool can check comment value. If it is upper case, translates value in upper case or vice versa:)
     
    Last edited: Jan 7, 2015
  7. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    200
    I have a question. There are both Hindi-hi and Hindi(India)-hi-IN. All of the languages are same. what are the differences between them and which one should I choose?
     
  8. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Yeah, the google play store presence generator doesn't work on certain regions. I have to figure out a nice solutions for that. To fix your issue:

    1. Disable the "Generate store presence(BETA)" for google play
    2. Delete the directories in your unity project called values-zh-CHS(the ones that gives you errors) etc.

    That should do it.

    The difference is the regions of the cultures. Some languages can have quite a few differences depending on the geographical region we are talking about.

    You can read more about the codes here:
    http://en.wikipedia.org/wiki/ISO_639

    As for what version of Hindi you should choose is entirely dependent on what version of the language you want to support. With that said, I'd stick with with "Hindi-hi" if I didn't know and just wanted to support hindi.
     
    Muckel likes this.
  9. Armageddon104

    Armageddon104

    Joined:
    Sep 14, 2014
    Posts:
    9
    So I don't think the namespace is working?

    Error:
    Code (csharp):
    1.  
    2. UnityException: You are not allowed to call this function when declaring a variable.
    3. Move it to the line after without a variable declaration.
    4. If you are using C# don't use this function in the constructor or field initializers, Instead move initialization to the Awake or Start function.
    5. UnityEngine.GameObject..ctor () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/UnityEngineGameObject.cs:558)
    6. SmartLocalization.LanguageManager.get_Instance ()
    7. SetStringFromLocalLanguage..ctor ()
    My script(trying to be able to set the string in editor so it's not hardcoded):
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4. using SmartLocalization;
    5. using SmartLocalization.Editor;
    6. using System.Collections;
    7.  
    8. public class SetStringFromLocalLanguage : MonoBehaviour {
    9.  
    10.     public string GottenKey;
    11.     //string TextBox = LanguageManager.Instance.GetTextValue("GottenKey");
    12.     Text TextObject;
    13.  
    14.     LanguageManager LangMan;
    15.  
    16.     void Start () {
    17.         LangMan = LanguageManager.Instance;
    18.         TextObject = GetComponent<Text>();
    19.         string TextBox = LangMan.GetTextValue("GottenKey");
    20.         TextObject.text = TextBox;
    21.     }
    22. }
    23.  
     
  10. Crazydadz

    Crazydadz

    Joined:
    Mar 29, 2012
    Posts:
    50
    Hi guys, really awesome FREE plugin! Thanks a lot! I'm just putting here my custom and simple LocalizedTextInspector script for uGUI. I just changed some lines. No more need to click "Use key", the text will also update in your game view and you can select the culture you want to view in the "View Culture" popup. Also, when you unselected the gameObject, the text will be updated to the Root Culture one (you can get rid of that by removing to OnDisable() method in the script). That wasn't a big deal to write it, but it will maybe save 5 minutes to someone :). I didn't test it much too, so please don't be mad if there's error :eek:

    Code (CSharp):
    1. #if UNITY_4_6
    2.  
    3. namespace SmartLocalization.Editor
    4. {
    5.     using UnityEngine.UI;
    6.     using UnityEngine;
    7.     using UnityEditor;
    8.     using System.Collections.Generic;
    9.  
    10.     [CustomEditor(typeof(LocalizedText))]
    11.     public class LocalizedTextInspector : Editor
    12.     {
    13.         private string _selectedKey = null, _lastSelectedKey = null;
    14.         private int _selectedCulture = 0, _lastSelectedCulture = 0;
    15.         private SmartCultureInfo[] _availableCultures;
    16.         private string[] _availableCulturesStringPopup;
    17.  
    18.         void Awake()
    19.         {
    20.             LocalizedText textObject = ((LocalizedText)target);
    21.             if (textObject != null)
    22.             {
    23.                 _selectedKey = textObject.localizedKey;
    24.                 _lastSelectedKey = _selectedKey;
    25.             }
    26.         }
    27.  
    28.         private void OnEnable()
    29.         {
    30.             var allCultures = SmartCultureInfoEx.Deserialize(LocalizationWorkspace.CultureInfoCollectionFilePath());
    31.             var availableCultures = LanguageHandlerEditor.CheckAndSaveAvailableLanguages(allCultures);
    32.             _availableCultures = availableCultures.cultureInfos.ToArray();
    33.             _availableCulturesStringPopup = new string[_availableCultures.Length];
    34.             for (var i = 0; i < _availableCultures.Length; i++)
    35.             {
    36.                 _availableCulturesStringPopup[i] = _availableCultures[i].englishName;
    37.             }
    38.         }
    39.  
    40.         private void OnDisable()
    41.         {
    42.             //Set text to Root culture when Object is unselected
    43.             SetText(true);
    44.         }
    45.  
    46.         //Update text from the Text component when changing selectedKey and selectedCulture
    47.         private void SetText(bool isRootText = false)
    48.         {
    49.             LocalizedText textObject = ((LocalizedText)target);
    50.             textObject.localizedKey = _selectedKey;
    51.             var textUI = textObject.GetComponent<Text>();
    52.             Dictionary<string, LocalizedObject> values = LanguageHandlerEditor.LoadParsedLanguageFile(isRootText ? null : _availableCultures[_selectedCulture].languageCode, isRootText);
    53.             LocalizedObject obj;
    54.             values.TryGetValue(_selectedKey, out obj);
    55.             if (obj != null)
    56.                 textUI.text = obj.TextValue;
    57.             else
    58.             {
    59.                 string error = "No valid key selected!";
    60.                 textUI.text = error;
    61.                 Debug.LogWarning(error);
    62.             }
    63.             EditorUtility.SetDirty(textObject);
    64.         }
    65.  
    66.         public override void OnInspectorGUI()
    67.         {
    68.             base.OnInspectorGUI();
    69.  
    70.             _selectedKey = LocalizedKeySelector.SelectKeyGUI(_selectedKey, true, LocalizedObjectType.STRING);
    71.  
    72.             if(_lastSelectedKey != _selectedKey)
    73.             {
    74.                 _lastSelectedKey = _selectedKey;
    75.                 SetText();
    76.             }
    77.  
    78.             GUILayout.Space(10f);
    79.  
    80.             _selectedCulture = EditorGUILayout.Popup("View culture:", _selectedCulture, _availableCulturesStringPopup);
    81.  
    82.             if (_selectedCulture != _lastSelectedCulture)
    83.             {
    84.                 _lastSelectedCulture = _selectedCulture;
    85.                 SetText();
    86.             }
    87.         }
    88.  
    89.     }
    90. }
    91. #endif
    upload_2015-2-5_16-49-49.png
     
  11. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Hey @NiklasBorglund - just want to send out a huge thanks for this asset, seriously good and FREE!

    This has saved me a heap of work.

    @Crazydadz, thanks for your tweaked LocalizedTextInspector. Great to see people sharing their labour!
     
    NiklasBorglund and Crazydadz like this.
  12. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Fantastic! This is great! :)

    Thank you for the kind words! :)
     
  13. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Hey @NiklasBorglund,

    I have a few of questions:

    1. The documentation (the README not the html docs) mentions LanguageManager.Instance.SetDefaultLanguage(...) methods but the html docs don't have this nor can I locate equivalent functionality. No big issue, I've implemented it myself using PlayerPrefs as it's trivial to do - just curious if I was over looking something though.

    2. It seems that I need to call LanguageManager.Instance.ChangeLanguage(...) in each scene (ie, it doesn't appear to remember the chosen language between scene loads). Is this expected?

    3. Is there any way to 'batch' translate all languages? Currently I need to individually translate each language manually after I modify the 'Root Language File'. My current work flow is:

      - Edit the root language (which is in English for me)
      - Translate 'English', here I just click the 'Copy All Values From Root' button and then save.
      - Then for each language I Translate, Select 'Translate From' English then select 'Translate all text', then save.

      This is rather laborious when you have many languages. The ideal work flow for myself (selfish me!!) would be:
      1. Set the Root Language File's 'language' (for instance to english)
      2. Allow a 'Copy and translate all text from the Root Language File for all languages' - this would do all languages we have defined.

    Is there any way to do something similar to what I describe in (3)? Please don't take this as a complaint or criticism, I'm grateful to use your asset regardless and my workflow needs are probably different to that of others. But I figured there is no harm in expressing my preferred workflow and asking if there is any way to achieve this with the current free asset.

    Thanks again for sharing your great work.
     
    Last edited: Feb 11, 2015
  14. Ignisor

    Ignisor

    Joined:
    Jan 14, 2015
    Posts:
    3
    Hi, I can't understand what about javascript? How can i use your Smart Localization in javascript?
     
  15. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Hi Ignisor, I don't use Java Script with Unity, but as I understand it, it should be no different than using it from C#. Just make your calls to the LanguageManager just as you would any other object. The runtime does not care if it's written in C# or JS as it's all converted to IL before being used.
     
    Last edited: Feb 16, 2015
  16. Ignisor

    Ignisor

    Joined:
    Jan 14, 2015
    Posts:
    3
    Thx, larku.

    This is for those who don't want or couldn't understand.

    Code (csharp):
    1.  
    2. var thisLanguageManager:SmartLocalization.LanguageManager;
    3.  
    4. function Start ()
    5. {
    6.     thisLanguageManager = SmartLocalization.LanguageManager.Instance;
    7.     TestText1.text = thisLanguageManager.GetTextValue('KEY');
    8. }
    9.  
     
    Last edited: Feb 15, 2015
  17. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262

    Hi

    1) I'm not sure that method is still there. We'll have a look in the docs and see what's actually up to date. I'm sorry about this. :/ Good catch though ;)

    2) You can use this ( http://bit.ly/1DUi3Mw) method to set the DontDestroyOnLoad flag.

    3) No there's currently no batch translate feature available. But I do think it's a reasonable request. So I've added it as a feature request in our trello page.

    Thanks! :)

    You add code by removing the first forward slash in this [code/] and replace your backslash to a forward one in the last one [\code]

    Code (csharp):
    1.  
    2. //Hello world!
    3.  
     
    mslinklater likes this.
  18. Crazydadz

    Crazydadz

    Joined:
    Mar 29, 2012
    Posts:
    50
    Hi @NiklasBorglund,

    It will be useful to add a parameter in LocalizedKeySelector method to filter the key that will be shown in the popup. This way we could only show all keys that contains a certain string or that begin with a certain string. Ex: "Item.A, Story.A, Item.B, Story.B" are some keys in the dictionary, but I have a custom editor script for my InteractableItem, and I will like to be able to only show keys that have "Item." in the popup list. At a certain point, if you have hundreds of keys, it will be annoying to see all the keys when you only need some.

    Thank you,
    David
     
    Last edited: Feb 22, 2015
  19. Shii

    Shii

    Joined:
    Nov 23, 2014
    Posts:
    11
    Hello! Started using SmartLocalization and faced the problem. After integrating SmartLocalization to the project all AudioSource componens got corrupted. Here is screenshots. Using latest Unity 4.6.3. How to fix this?

    How it should look:
    audiosource_normal.jpg

    How it looks after integrating SmartLocalization:
    audiosource_corrupted.jpg
     
  20. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Hey @NiklasBorglund,

    Any word on Unity 5 support? I'm not getting any text showing for text objects that use localized text.

    EDIT: it seems that it's just an issue with the #if UNITY_4_6 guards around the cs scripts - removing these has made things work but now I've lost all of my key associations (hundreds!!) so I'll need to start upgrading my project to Unity 5 again from scratch :(

    - not a complaint, just a heads up!

    Regards,
    Larku
     
    Last edited: Mar 4, 2015
  21. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Ah, this is so bad, I did not realized I have only 1.2 source, not 2.0 Now there is no way to recompile this for Unity 5.0 properly =(
     
  22. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    We are planning to do some work on your issues this weekend. Stay tuned for more info and sorry for the delay.
     
  23. Nazarick

    Nazarick

    Joined:
    Jan 29, 2014
    Posts:
    27
    Salut NiklasBorglund,

    Sorry in advance if some points have already been answered above, at 2:55 am, I'm a little bit lazy I ^^ "

    So, I was wondering if SmartLocalization would evolve soon with regard to the new Unity 5 ? SmartLocalization script for new ui ON Unity 5 ?

    By cons, small question in passing. Is it possible to move "SmartLocalizationWorkSpace" in a subfolder? I am a maniac of the organization in my files.

    Hoping for good news ^^ Good luck for the future and very quickly.



    Edit 1:

    I come back to you a little mistake. Whenever I make a sound (AudioPlay) the following error is returned to me:

    I run "AudioPlay" via PlayMaker loading Audio Clip from SmartLocalization backup system. Similarly, if I touch any values to a AudioSource, the same mistakes are linked.

    EDIT : 3 (J'aime vraiment les edit en fait >.<)

    The new version of the SmartLocalization Addon for PlayMaker is now ready and updated on GitHub.

    GitHub Repository : https://github.com/LudlowFx/PlayMaker_SmartLocalization
    PlayMaker Topic : http://hutonggames.com/playmakerforum/index.php?topic=8146.0
    New WebPlayer Demonstration : http://urlz.fr/1Gyy
     
    Last edited: Mar 7, 2015
    NiklasBorglund likes this.
  24. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    Hey @NiklasBorglund, @Shii,

    I can verify that I also have this issue (Unity 4.6.3p1).
     
  25. Styval

    Styval

    Joined:
    Feb 4, 2014
    Posts:
    6
    Hi, I use 4.6.3 and I have this error.

    I have no more dropdown menu on Localized Text Inspector to change localized key.

    Any help will be great.

    Thx and take care

    Code (CSharp):
    1. VerificationException: Error verifying SmartLocalization.Editor.LocalizedKeySelector:SelectKeyGUI (string,bool,SmartLocalization.LocalizedObjectType): Object not compatible with constrained type at 0x00c0
    2. SmartLocalization.Editor.LocalizedTextInspector.OnInspectorGUI () (at Assets/SmartLocalization/Scripts/uGUI/Editor/LocalizedTextInspector.cs:25)
    3. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/Inspector/InspectorWindow.cs:1093)
    4. UnityEditor.DockArea:OnGUI()
     
  26. ram_saa

    ram_saa

    Joined:
    Feb 18, 2014
    Posts:
    3
    Hi, Ignisor and larku, I'm coding with JavaScript and your answer didn't work for me, but this is working great:

    Code (JavaScript):
    1. //Variables privadas / private variables
    2. private var thisLanguageManager : SmartLocalization.LanguageManager;
    3. private var TestText1 : String;
    4.  
    5. functionStart () {
    6.     thisLanguageManager = SmartLocalization.LanguageManager.Instance;
    7.     TestText1 = thisLanguageManager.GetTextValue('KEY');
    8.     //Puede verse en la ventana de Smart Localization / It can be view in the Smart Localization window
    9. }
    10.  
    11. functionOnGUI ()
    12. {
    13.      //Las ventanas / the windows
    14.      GUI.Box(ventanaGUI, TestText1, estiloGUIVentanaTitulo);
    15.      // GUI.Box(posición, texto, estilo) / GUI.Box(position, text, style)
    16. }
    Thank you!
     
  27. InfinityCoder88

    InfinityCoder88

    Joined:
    Oct 4, 2013
    Posts:
    243
    Hi uniters :D,

    Good job @NiklasBorglund with Smart Localization Plugin, very useful & very powerful, I got one question if is possible to change also the text font when changing the language ? Because I got a few languages in my game project including RUSSIAN , which is a pain in the a*s (sorry for my french) when I'm changing the language to russian the whole text get "crazy" in size, aspect etc. ...and the only solution I think is to use a default only russian font...it's possible to achieve this ?

    Thanks in advance !
     
  28. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    That's great!

    Unfortunately, you cannot move the folder right now. But we have it in our backlog as a feature request :)

    Sorry for the late reply, we are currently making some changes. Stay tuned for more info.

    You cannot localize pure font files as it is now. Easiest would probably be to create an easy system that registers on the language changed callback and switches the font in your label(s) depending on the ISO-639 language code. You can get the current language code from the LanguageManager.
     
    InfinityCoder88 likes this.
  29. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412

    Are you using the new Unity UI in >= 4.6.2, this has best fit text resizing that works really well with Smart Localization - I'm doing Russian, Chinese, Japanese, Spanish, French, German, etc and all resize and work really well.
     
  30. InfinityCoder88

    InfinityCoder88

    Joined:
    Oct 4, 2013
    Posts:
    243
    Hi @larku ,
    Actually I migrated to Unity 5 from Unity 4.6.3 , yes I do using best fit but get this kind of displaying text : HERE
    What font do you use for russians text, is there a possibility to change the text font when changing the language (I want to try an idea via Unity.UI) ...if I can fix this, also and I have Chinese, Japanese, Spanish, French, German and others languages, but only russian text is the "bad guy" here :D
     
  31. Nazarick

    Nazarick

    Joined:
    Jan 29, 2014
    Posts:
    27
    Oh happy to read it. ^^
    Good luck to you for the rest ;-)
     
  32. lemmiwinks

    lemmiwinks

    Joined:
    Nov 19, 2013
    Posts:
    4
    Hey, thanks for making this plugin free for everyone to use.

    I've been using it for a couple of weeks now, but have ran into the same issue multiple times, which forces me to clear all the workspace data and start from scratch (which is a pain as you can imagine).

    It happened again just now, everything was fine with two languages, I added a new key to the root language file and the whole thing stopped working:

    Code (CSharp):
    1.  
    2. XmlException: Referenced character was not allowed in XML. Normalization is True, checkCharacters = True  Line 97, position 154.
    3. Mono.Xml2.XmlTextReader.ReadCharacterReference ()
    4. Mono.Xml2.XmlTextReader.ReadReference (Boolean ignoreEntityReferences)
    5. Mono.Xml2.XmlTextReader.ReadText (Boolean notWhitespace)
    6. Mono.Xml2.XmlTextReader.ReadContent ()
    7. Mono.Xml2.XmlTextReader.Read ()
    8. System.Xml.XmlTextReader.Read ()
    9. System.Xml.XmlReader.ReadStartElement ()
    10. System.Xml.XmlReader.ReadElementContentAsString ()
    11. SmartLocalization.LanguageParser.ReadData (System.Xml.XmlReader reader, System.Collections.Generic.SortedDictionary`2 loadedLanguageDB)
    12. SmartLocalization.LanguageParser.ReadElements (System.Xml.XmlReader reader, System.Collections.Generic.SortedDictionary`2 loadedLanguageDB)
    13. SmartLocalization.LanguageParser.LoadLanguage (System.String languageData)
    14. SmartLocalization.Editor.LanguageHandlerEditor.LoadParsedLanguageFile (System.String languageCode, Boolean isRoot)
    15. SmartLocalization.Editor.SmartLocalizationWindow.OnRootEditClick ()
    16. SmartLocalization.Editor.SmartLocalizationWindow.DrawAvailableLanguageItem (Rect position, SmartLocalization.SmartCultureInfo info)
    17. SmartLocalization.ReorderableList.GenericListAdaptor`1[T].DrawItem (Rect position, Int32 index)
    18. SmartLocalization.Editor.SmartCultureInfoListAdaptor.DrawItem (Rect position, Int32 index)
    19. SmartLocalization.ReorderableList.ReorderableListControl.DrawListItem (EventType eventType, Rect position, IReorderableListAdaptor adaptor, Int32 itemIndex)
    20. SmartLocalization.ReorderableList.ReorderableListControl.DrawListContainerAndItems (Rect position, Int32 controlID, IReorderableListAdaptor adaptor)
    21. SmartLocalization.ReorderableList.ReorderableListControl.DrawLayoutListField (Int32 controlID, IReorderableListAdaptor adaptor)
    22. SmartLocalization.ReorderableList.ReorderableListControl.Draw (Int32 controlID, IReorderableListAdaptor adaptor, SmartLocalization.ReorderableList.DrawEmpty drawEmpty)
    23. SmartLocalization.ReorderableList.ReorderableListControl.Draw (IReorderableListAdaptor adaptor)
    24. SmartLocalization.Editor.SmartLocalizationWindow.ShowCreatedLanguages ()
    25. SmartLocalization.Editor.SmartLocalizationWindow.OnGUI ()
    26. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    27.  
    So now it can't parse any of the language files, any ideas what might be triggering this and how to fix it without having to delete everything?

    If it's of any use, the special characters I'm using are: # < > " ' !

    EDIT:
    Manually editing the .txt and .resx files to remove the newly created keys and values restores the files to they're readable again.
    I'm guessing I'm using a character that sometimes breaks the xml parsing?

    Thanks!
     
    Last edited: Mar 23, 2015
  33. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    What version of Smart Localization are you using? And what version of Unity + what OS?

    I'm unable to reproduce your issue. Can you give me steps to reproduce?

    Are you altering the .resx files from a script?
     
  34. lemmiwinks

    lemmiwinks

    Joined:
    Nov 19, 2013
    Posts:
    4
    Running the latest Smart Localization version as of writing, Unity 4.6.3 on Mac OS 10.9.5

    I will try to find reproduction steps, it's happened 3 times so far, always when adding a new key to the root language file, often including the special characters mentioned above.
    I've added many keys so far and the vast majority of the time it's fine, so I haven't been able to figure out what triggers the issue.

    I am not altering the .resx files.

    Once the issue occurs, and I edit the language files to remove the offending keys, I wasn't able to find a misplaced character or anything, the keys looked just like they're supposed to, but maybe I missed something since removing them fixes the issue.

    Will report back next time it happens and look more into it.
     
  35. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Hi,
    SmartLocalization will support Unity5?? And support Japan Kanji or Chinese?
     
    alvaro-em likes this.
  36. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    29
    Hi, I ran into a problem where I cannot create zh-CHS and ch-CHT at the same time! I added zh-CHS first, then when I click on create for zh-CHT, nothing happens. Is this intended or a bug? Please allow adding both languages as they have different character sets and are for different markets.

    Thanks!
     
  37. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    29
    It seems to be a problem of the button, as even if I click on zh-CHT first, zh-CHS was added instead.
     
  38. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Thanks, I'll look some more as well and see if I can manage to reproduce it.

    Yes, we are working on it.

    Yeah, I get that too. Good catch :) I've added it as a bug to our trello page.

    In the mean time you can try and duplicate the created zh-CHS file and rename it to zh-CHT as it shows on the image I've attached to this post.

    Hope that helps
     

    Attached Files:

  39. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Hello everyone!

    We have just released a PRO version of Smart Localization! It is live on the asset store - here's a link to where you can find it: https://www.assetstore.unity3d.com/en/#!/content/32055

    The main differences from the FREE and PRO versions are:
    • Bulk import/export to and from .csv and .xls
    • File watcher that reloads csv/xls files in real time
    • Plural support
    • Full source
    • Your contributions will enable us to buy coffee :)
    And we can't stress this enough, the free version will still be fully supported and updated, the only difference between FREE and PRO is that the latter will contain extended convenience features along with the full source.

    We are submitting an updated FREE version with Unity 5 support as we speak.

    Hope these versions can suit all types of projects. @zuric and I would like to thank you for your continued and amazing support! :)
     
  40. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    444
    Congrats on the PRO release! Quick question about the file watcher: Does it work in the editor only, or will users be able to modify the file at runtime on their own machines and be able to see the updates?
     
  41. zuric

    zuric

    Joined:
    May 22, 2014
    Posts:
    10
    Thanks!
    The file watcher is editor only but it does work in play mode as long as you click on the watch file button after starting play mode.
     
  42. Nazarick

    Nazarick

    Joined:
    Jan 29, 2014
    Posts:
    27
    Hi,

    Congratulations for this Pro Release Version ;) - I have two quick questions.

    Perhaps because of the fact that I am French and I translate (and understand with my... basic English) "Plural" the wrong way, but I have not quite capture what it concerns exactly.

    Have you ever thought about the integration of dynamic variables within the texts ? For example, (ahem example sentence ...) "I have 8 apples". In Example 8, an example would be dynamic variable and it would add a specific pointer in the text to replace it with the desired value.

    Ex : So, "I have [var] apples" becomes "I have 8 apples".

    I hope that I have not too tangled in the explanation to be understood ^^

    I do not know if this has already been said, or maybe this is out of your goals for the moment.

    Good luck for the future ;)
     
  43. shloob

    shloob

    Joined:
    Jun 1, 2013
    Posts:
    10
    Hello,

    To echo the others, congrats on your release! The tool looks very nice! I am considering a purchase, but I had one quick question. Does Smart Localization support tokenization?

    Thanks!
     
  44. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,412
    By tokenization are you referring to having {0} type tokens in your strings?

    If so then I'd say yes since I have many strings like this and have had no issues.
     
    zuric likes this.
  45. zuric

    zuric

    Joined:
    May 22, 2014
    Posts:
    10
    Thanks!

    The plural support is for defining different sentences depending on the number passed in. For example:
    Code (csharp):
    1.  
    2. AppleSentence_0 = "I have {0} apple" //gets returned if n=0 || n>1
    3. AppleSentence_1 = "I have {0} apples" //gets returned if n>1
    4.  
    using the function:
    Code (csharp):
    1.  
    2. languageManager.GetTextValue("AppleSentence", numberOfApples);
    3.  
    English is a fairly simple example since it only has two plural forms; one plural form for n=0 and n>1 and one plural form for n=1. Other languages have many more plural forms such as Arabic which has six forms.

    We have decided to leave this to the user at the moment since there is a fairly straightforward way to do that using String.Format. Example:

    Code (csharp):
    1.  
    2. string s = String.Format("I have {0} apples and you have {1}.", myApples, yourApples);
    3.  
    Where the string with the variables comes from Smart Localization. This should work well for most occasions since you can reorder the variables depending on the language.
     
    Last edited: Apr 9, 2015
  46. zuric

    zuric

    Joined:
    May 22, 2014
    Posts:
    10
    Can you describe more in detail what kind of tokenization you are referring to? Tokenization can mean different things in different contexts.
     
  47. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Hi I have a problem with the plugin. The audio Source editor is modified by Smart Localization but I have a problem because I lost a feature of the Audio Source Editor ( the graphics of the Audio Source).

    Any Solution to this?

    Thanks
     
    Last edited: Apr 10, 2015
  48. NiklasBorglund

    NiklasBorglund

    Joined:
    Feb 9, 2012
    Posts:
    262
    Update your Smart Localization version to 2.2.0. This issue was resolved in the latest version.
     
  49. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    Thanks.
     
  50. lavz24

    lavz24

    Joined:
    Mar 14, 2013
    Posts:
    45
    I updated to the last version (Smart Localization 2.2.0 free) and I still have the same problem, audio source show the graphics now but not show all variables for the graphics.

    Why you can put the audio source editor script for smart localization optional? And only add If I need?

    What can I do?
    Unity version: 5.0.1 Windows
     

    Attached Files: