Search Unity

I2 Localization ( The most complete Localization solution for Unity )

Discussion in 'Assets and Asset Store' started by Inter-Illusion, Feb 27, 2014.

  1. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    If you are using the latest TextMeshPro (free version), then you need to download I2 Localization 2.6.10f1 or newer.

    TextMeshPro is no longer having its source in the free package, so earlier versions of I2 Localization can't detect it. In 2.6.10f1 I added a fix for that.

    Hope that helps,
    Frank
     
  2. Xan-Ko

    Xan-Ko

    Joined:
    Apr 12, 2016
    Posts:
    14
    Hello! I just purchased your extension
    How can use a dropdown to change the language?
    Only see examples with buttons and i searched both forums with no luck.

    Thanks!
     
  3. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    The plugin didn't have any example of setting the language change with a dropdown, but it was easy to add.
    I created this script and also added it to the new beta 2.6.11b8

    Assets\I2\Localization\Scripts\Utils\SetLanguageDropdown.cs
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4. using System.Linq;
    5.  
    6. namespace I2.Loc
    7. {
    8.    [AddComponentMenu("I2/Localization/SetLanguage Dropdown")]
    9.    public class SetLanguageDropdown : MonoBehaviour
    10.    {
    11.        void OnEnable()
    12.        {
    13.            var dropdown = GetComponent<Dropdown>();
    14.            if (dropdown==null)
    15.                return;
    16.  
    17.            var currentLanguage = LocalizationManager.CurrentLanguage;
    18.            if (LocalizationManager.Sources.Count==0) LocalizationManager.UpdateSources();
    19.            var languages = LocalizationManager.GetAllLanguages();
    20.  
    21.            // Fill the dropdown elements
    22.            dropdown.ClearOptions();
    23.            dropdown.AddOptions( languages );
    24.  
    25.            dropdown.value = languages.IndexOf( currentLanguage );
    26.            dropdown.onValueChanged.RemoveListener( OnValueChanged );
    27.            dropdown.onValueChanged.AddListener( OnValueChanged );
    28.        }
    29.  
    30.        
    31.        void OnValueChanged( int index )
    32.        {
    33.            var dropdown = GetComponent<Dropdown>();
    34.            if (index<0)
    35.            {
    36.                index = 0;
    37.                dropdown.value = index;
    38.            }
    39.  
    40.            LocalizationManager.CurrentLanguage = dropdown.options[index].text;
    41.         }
    42.     }
    43. }
    44.  
    upload_2017-3-31_13-34-3.png

    Hope that helps,
    Frank
     
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,433
    Hi, I would like to inform you that the latest version of Unity (5.6.0f3) produces this error on every compilation.



    The cause is that at around the code in the pic , this enum now have "Switch" in it but Nintendo Switch is not available in build settings yet.

    Code (CSharp):
    1. foreach (BuildTargetGroup target in System.Enum.GetValues(typeof(BuildTargetGroup)))
    So I added an if to silence the error.

    Code (CSharp):
    1. if(target != BuildTargetGroup.Switch)
    2.  {
    3.        EnablePluginsOnPlatform( target );
    4.  }
     
    Kurius likes this.
  5. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    Thanks for finding this problem and a workaround!
    However, I have been trying the latest 5.6.0f3 with the latest I2Loc and haven't got this error. Normally the attribute check surrounding that call works when a platform hasn't been installed or is in preview, but I guess Switch is the exception!
    I will try reproducing this error in another computer, and possible a mac as well. Nonetheless, thanks for letting me know about this and I hope it helps anyone else facing that message!
     
  6. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    460
    Hi Frank, I have the same error as @5argon using 2.6.11b8 in Unity 5.6.0f3 on Windows 10. I deleted the I2 folder and imported the beta and have the same error in the console.
     
  7. Mirgan

    Mirgan

    Joined:
    Feb 2, 2016
    Posts:
    24
    Have same error using 2.6.10 f1 in Unity 5.6.0f3 on Windows 10. And i have same issue as Kurius. All work fine in editor but doesn.t work on android. Reinstall doesn.t help( Now i try remove all my localizations and create new one.
     
  8. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    129
    Hi,
    just loaded the plugin into my project and I am getting the same error:

    PlayerSettings Validation: Requested build target group (27) doesn't exist; #define symbols for scripting won't be added.
    UnityEditor.PlayerSettings:SetScriptingDefineSymbolsForGroup(BuildTargetGroup, String)
    I2.Loc.UpgradeManager:EnablePluginsOnPlatform(BuildTargetGroup) (at Assets/I2/Localization/Scripts/Editor/UpgradeManager.cs:111)
    I2.Loc.UpgradeManager:EnablePlugins(Boolean) (at Assets/I2/Localization/Scripts/Editor/UpgradeManager.cs:83)
    I2.Loc.UpgradeManager:CheckPlugins(Boolean) (at Assets/I2/Localization/Scripts/Editor/UpgradeManager.cs:32)
    I2.Loc.UpgradeManager:AutoCheckPlugins() (at Assets/I2/Localization/Scripts/Editor/UpgradeManager.cs:21)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  9. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    129
    Could you tell us how to silence this error, or can you tell us if there's a fix coming?
     
  10. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    Hi @hellobard
    Go to Assets -> I2 -> Localization -> Scripts -> Editor
    Open UpgradeManager.cs
    Replace Line #81 with this instead:
    if (target!=BuildTargetGroup.Unknown && target != BuildTargetGroup.Switch && !target.HasAttributeOfType<System.ObsoleteAttribute>())
     
    Last edited: Apr 21, 2017
    zhuchun likes this.
  11. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    EDIT: This is actually becoming a pain in the @$$ It really seems to be a sporadic issue on Android when trying to switch term at runtime. Most of the time it doesn't work. I think I might just have to create multiple text objects, each with a hard coded term. It's just to risky and unstable to rely on just one text object being used with swapped terms at runtime.

    EDIT #2: I just learned that you should not have your text object as part of a prefab, or else that screws up the localization terms of each instance of that prefab
     
    Last edited: Apr 24, 2017
  12. hellobard

    hellobard

    Joined:
    Sep 26, 2012
    Posts:
    129
    Thank you Kurius!
     
  13. FallenTreeGames

    FallenTreeGames

    Joined:
    Jun 22, 2016
    Posts:
    25
    Hi, we have just bought this asset for use in our game. It looks a great system but I have a question about one point which doesn't seem to be working at per the manual.

    http://www.inter-illusion.com/assets/I2LocalizationManual/I2LocalizationManual.html

    In there, it says any auto translated terms are saved in the Google Spreadsheet with the GoogleTranslate function, but that isn't happening for me. For example, I enter a English phrase, click Translate on the French and it generates a term. I export to Google docs and see the English and French, "hard data", so if I update the English the French won't be updated.

    I tried changing the formula in the Google spreadsheet and that worked fine, importing the changes into Unity... but then when I export again it will wipe out my changes and go back to the "hard data".

    I see the auto translation as really useful tool when first implementing the localisation of our game, we have a lot of text and so to auto translate working so I can see the text is changing correctly in game is really important. Obviously we'll get the translated checked or done professionally later, but being able to auto do them at the start would be great.
     
  14. FallenTreeGames

    FallenTreeGames

    Joined:
    Jun 22, 2016
    Posts:
    25
    Also, the auto generating ScriptLocalisation is really useful, but I think I'm right in thinking the properties give access to the translated strings. Would it be possible to auto-generate just the IDs so we could pass them into SetTerm?
     
  15. Mirgan

    Mirgan

    Joined:
    Feb 2, 2016
    Posts:
    24
    Hi. So I can't use prefabs in my game if I use I2 Localization? Then the simplest way is delete I2...
     
  16. FallenTreeGames

    FallenTreeGames

    Joined:
    Jun 22, 2016
    Posts:
    25
    I see on your company forum that this is old functionality, and the docs are out of date.

    Regarding my auto generating script to provide the key (not the translation), I have changed the plugin script to do what I require.

    Thanks
     
  17. TobyYe

    TobyYe

    Joined:
    May 25, 2013
    Posts:
    24
    the editor width is not right (unity5.6), I can't adjust the width, every time I need to use the scroll bar below
     
  18. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    340
    It looks like you're using a retina Mac. If so, this is a known issue with Unity (although I thought they'd fixed it).

    Quit Unity and do a Get Info on the application. Check "Open in low resolution" and start Unity. You'll get full functionality back, although the UI will look like s@#$.
     
  19. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    Sorry for the delay in answering the support questions. These last couple weeks I was on a vacation out of the country and wasn't able to check the forums/email!
    I will be catching up with support in the next days.

    @hellobard
    This has been fixed in 2.6.11 f1 (Its already in the beta folder and I also sent it today to the AssetStore, so it should be live in the next days).

    @FallenTreeGames
    That's correct, to improve Import/Export performance, a couple versions ago I made that the auto-translated terms not longer get set with the GOOGLETRANSLATE formulae, instead, the translation is stored.
    I will prioritize updating the docs as that obviously creates confusion. Thanks for remaining me this task!!

    @Kurius
    Can you please provide more detail about your setup. Most developers are relying in the SetTerm to change terms at runtime (e.g. WINNER or LOOSER, PLAY or PAUSE, etc). I also checked and this is working reliably for me, so, most likely is a setup issue, I can help you with that if you provide me more details.
    e.g. Are all your localizations in I2Langauges.prefab (without been instantiated in the scene) or do you have LangaugeSources in your Scenes?
    Are you using Google Live Synchronization? and if so, can you double check that your spreadsheets are in sync with the I2Language.prefab.
    Are you calling the SetTerm in the Start() or the Awake() ?
    If you could provide me an example project showing this issue I can check it out and find the problem for you!

    In my own game, all my UI is in prefabs, and everything is localized with I2Localization. Could you please provide me an example to see if there is a setup issue?

    @tobytarottstudio
    I will check this up and try adding a workaround in the next release. My major issue here is that I don't own a Mac with a Retina Display, so its hard to reproduce this.
    I'm going to modify the code around this and upload a new beta with the changes. It will help me a lot If you could try that beta and see if the problem is fixed!

    Hope that helps,
    Frank
     
  20. FallenTreeGames

    FallenTreeGames

    Joined:
    Jun 22, 2016
    Posts:
    25
    Welcome back, I hope you had a good vacation.

    I've been using the asset last week and all our text is now localised in game. It was really easy to do, thanks a lot!

    I've got one more question though, is it possible to use SetTerm() to set the text to an empty string. With some of our UI elements, I need to set the text to " " but I can't see to do that with SetTerm. I was hoping that doing something like SetTerm("") or SetTerm( null ) might work but I can't seem to figure it out. I even tried creating an 'empty' translation ( So None = ""), and then callling SetTerm( "None" ) but that didn't work either.

    In some case I can just turn off the Text gameObject, but with some of the UI animations we've got it would be easier to set the text to nothing, via SetTerm.

    If you've any suggestions I'd really appreciate that.
     
    Last edited: May 2, 2017
  21. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    This is now fixed in v2.7.0 a1.
    Previously, empty and null translations were used to define missing terms. Now I changed the code to allow empty translations and I'm using just null for those cases.

    If you download 2.7.0 a1 from the beta folder, it will work as expected.
     
  22. FallenTreeGames

    FallenTreeGames

    Joined:
    Jun 22, 2016
    Posts:
    25
    Brilliant, thanks a lot.
     
  23. a-bottosso

    a-bottosso

    Joined:
    Nov 13, 2015
    Posts:
    11
    Hi @Inter-Illusion
    We have 2 separated CSV files, one that contains the localization data for the in-game dialogues, the other that contains the localization data for all the UI elements.
    I know that I can merge them in the Language Source, but I would like to keep them separate (this should be useful in some cases, i.e. if I will add some terms later directly in Unity and then re-export them keeping the two spreadsheets separate).
    It is possible to do that?
    Thanks
    Alessio
     
  24. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    By default I2 Localization stores all localizations in the I2Languages.prefab. You could have more LanguageSources in your scenes, but I2Languages is a "Global" source that can be accessed everywhere.

    If you need to have 2 or more "Global" prefabs, you could create a duplicate of I2Languages.prefab (e.g. InGameTranslations.prefab) and then you should tell I2 Localization that it should use that source as a Global source.

    You can do that easily by adding its name to the GlobalSources array in LocalizationManager.cs line 208:
    Code (csharp):
    1.  
    2. public static string[] GlobalSources = {"I2Languages", "InGameTranslations"};
    3.  
    Hope that helps,
    Frank
     
  25. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    460
    Hi Frank,

    I have my I2Languages prefab's "Auto Update Frequency" set to "Never". However, in a build, a few seconds after startup I'm finding that I2 Localization is still attempting to do a Google Live Sync, as found in line 157 - Debug.Log("Done Google Sync" in LanguageSource_Import_Google.cs being output to an in-game debug console.

    I'm importing at runtime from a generated .csv file, and would prefer not to override it. Shouldn't it being set to "Never" mean that it won't attempt to update from Google sheets at runtime?

    Also, would it be possible to use the prefix/suffix fields even for Localize components whose terms are set to <None>? Those fields only appear when I have the term set, but there are cases, for example in a loading screen where I'm outputting a bunch of stuff to one Text component and would like to put ... after the text, where the suffix could come in handy. As of now, I've added the ... after all the terms I'm manually setting to the text component.
     
  26. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Sorry for this, it seems that I forced importing for a test, and never reverted it!
    I'm adding the fix to the new beta.

    To correct it, just remove the (true) from the source.Import_Google( true ); call on the Delayed_Import_Google function.

    Or better yet, change the AddSource and Delayed_Import_Google functions (LocalizationManager.cs line 465-489) by this one that also verifies before running the delay coroutine.
    Code (csharp):
    1.  
    2.        internal static void AddSource ( LanguageSource Source )
    3.        {
    4.            if (Sources.Contains (Source))
    5.                return;
    6.  
    7.            Sources.Add( Source );
    8. #if !UNITY_EDITOR || I2LOC_AUTOSYNC_IN_EDITOR
    9.             if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never)
    10.            {
    11.                Source.Import_Google_FromCache();
    12.                if (Source.GoogleUpdateDelay > 0)
    13.                        CoroutineManager.pInstance.StartCoroutine( Delayed_Import_Google(Source, Source.GoogleUpdateDelay) );
    14.                else
    15.                    Source.Import_Google();
    16.            }
    17. #endif
    18.  
    19.            if (Source.mDictionary.Count==0)
    20.                Source.UpdateDictionary(true);
    21.        }
    22.  
    23.        static IEnumerator Delayed_Import_Google ( LanguageSource source, float delay )
    24.        {
    25.            yield return new WaitForSeconds( delay );
    26.            source.Import_Google();
    27.        }
    28.  
    Hope that helps,
    Frank
     
    Korindian likes this.
  27. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    460
    Great thanks. Also did you see the last paragraph in my post about the prefix/suffix feature?
     
  28. Deleted User

    Deleted User

    Guest

    Hi,

    I would like some assistance in using this asset. I followed the document tutorials (setting language in I2Languages prefab, creating my keys, putting localize script on gameObject...) but upon attempting to change from English to Chinese, it doesn't change. I get this error too.

    StackOverflowException
    UnityEngine.GameObject.GetComponent[LanguageSource] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GameObjectBindings.gen.cs:35)
    I2.Loc.LocalizationManager.RegisterSourceInResources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:597)
    I2.Loc.LocalizationManager.UpdateSources () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:568)
    I2.Loc.LocalizationManager.InitializeIfNeeded () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:107)
    I2.Loc.LocalizationManager.set_CurrentLanguage (System.String value) (at Assets/I2/Localization/Scripts/LocalizationManager.cs:21)
    I2.Loc.LocalizationManager.SelectStartupLanguage () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:177)
    I2.Loc.LocalizationManager.InitializeIfNeeded () (at Assets/I2/Localization/Scripts/LocalizationManager.cs:108)

    I am working in Unity 5.5.3f1; I2 version is 2.6.12 f2.
    Any help is greatly appreciated! If this was a previous issue that was fixed, my apologies. I went through a couple pages and the closest issue to this was back in 2015.


    UPDATE:
    Soooo I updated the I2 asset to the newest version and all is dandy. Nevermind! Your work here is immeasurable, thanks so much for the asset! :D
     
    Last edited by a moderator: Jun 14, 2017
  29. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,433
    Hi, I found a small bug. I appreciate the function that when you click one of the language name in the Localize component it translates the whole page as a preview for you, but if some text's key was successfully auto-inferred from text content, it seems that they are not registered to this preview function. I have to select the key manually (the same key) to make it previewable.
     
  30. Luckofbuck

    Luckofbuck

    Joined:
    Jul 25, 2012
    Posts:
    13
    2 questions.

    When building my game to launch on mobile devices, does I2 require the user to have a least an internet connection to get the localized text shown? Are the Terms being downloaded/loaded from the Google Spreedsheet file only, or is there a local stored instance as well that is loaded? What's that process look like and what should I know?

    Also, in the marketing material it sounds like I can update the Google Sheets file with all the localized text. How often is that refreshed and let's say Google makes changes to their Sheets API, will the game still work if the game can't get anymore info from Google?

    Loving the product so far! Thanks :D
     
  31. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Will look into that ASAP

    I2 Localization doesn't REQUIRE internet.
    All your localizations are stored in the LanguageSource prefab (or gameobjects) and are built into the game.

    Said that, you can optionally, link a Google Spreadsheet and setup I2 Localization to keep the game up-to-date with that Spreadsheet at runtime.
    This is called Google Live Synchronization. Here you can find more information and how to set it up.
    http://inter-illusion.com/assets/I2LocalizationManual/GoogleLiveSynchronization.html

    What will happen, is that if the player has internet, the LanguageSource will contact google and download any update IF THERE WAS A CHANGE. But if there was no change, then nothing is downloaded. Also, if there is no internet or the internet permission is denied, then the built-in localizations are used.

    During set up of the Google Live Synchronization, you can specify how often to check and download new updates. It can be NEVER, ALWAYS, DAILY, WEEKLY, etc.



    The first time the game starts, it will use the built-in localization (the last localization you used in the Editor). Then will contact google to see if there was any change.
    If there were changes, it will download them, and saved them in a cache. From that point on, instead of using the built-in, it will always load the localization from that cache (even if there is no more internet).
    And every so often (depending on your settings) it will try downloading new data.

    Hope that helps,
    Frank
     
  32. TailoraSAS

    TailoraSAS

    Joined:
    Jul 18, 2015
    Posts:
    5
    Hi,
    I found a fix for the mac retina display problem.

    In the LocalizationEditor_Terms_Description.cs, you have to use EditorGUIUtility.pixelsPerPoint to correct the screen width at the line 321.

    Code (CSharp):
    1. bool autoTranslated = false;// termdata.IsAutoTranslated(i, GUI_SelectedInputType == 1);
    2.  
    3.                     Translation = EditorGUILayout.TextArea(Translation, Style_WrapTextField, GUILayout.Width(Screen.width/EditorGUIUtility.pixelsPerPoint-260 - (autoTranslated ? 20 : 0)));
    4.                     if (GUI.changed)
    5.                     {
    I don't know if i need to make this fix somewhere else, or if it is the right place to do it. But know it worked.

    It will be nice to have this fix in the futur release.

    Thanks
     
  33. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Thanks for finding that out. I add it and check if it needs to be included in the other places where the GUILayout.Width/Height is used
     
  34. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    123
    For the auto update frequency, is it possible to set it to only initially when the app opens up?
     
  35. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    I like that suggestion, so I added it to the new version (2.7.0 a11) which can be downloaded now from the beta folder.

    There is a few ways to implement this, but the easiest is to add a new frequency option ("OnlyOnce") in
    Assets\I2\Localization\Scripts\Google\LanguageSource_Import_Google.cs line 16
    Code (csharp):
    1.  
    2. public enum eGoogleUpdateFrequency { Always, Never, Daily, Weekly, Monthly, OnlyOnce }
    3.  
    And then, skip the download if there has been a previous download:
    Assets\I2\Localization\Scripts\Google\LanguageSource_Import_Google.cs line 119
    Code (csharp):
    1.  
    2.                        case eGoogleUpdateFrequency.Monthly : if (TimeDifference<31) return;
    3.                                            break;
    4.                        case eGoogleUpdateFrequency.OnlyOnce: return;
    5. }
    6.  
    7.  
    Hope that helps,
    frank
     
    5argon likes this.
  36. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    982
    Hi. I bought the asset long time ago but I just started using it. I have a couple of questions:

    1. I have a lot of "dynamic" strings with parameters. Example: I need a string that says "Time Remaining: 2H 3M 10S". I define a term "TimeRemaining" with the value "Time Remaining: {[remainingTime]}". I add a Localize component to my TextMeshPro label and set the "TimeRemaining" term. What would be the best way to update the time on that string every second? Is there a "refresh" method on the Localize component which would pick up a new value for the parameter from my global parameters class? TLDR: What is a quick and efficient way to force update a Localize component?

    2. When exactly does the Localize component requests a value from the global parameters class? How do I make sure the value I return in my global parameters class is already up-to-date when a Localize component requests it?
    Thanks!
     
    Last edited: Jul 3, 2017
  37. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    How the system works, is that whenever there is a language change, new scene loaded or similar event, the LocalizationManager calls the function LocalizeAll().
    That function searches for all Localize components and calls cmp.OnLocalize(), which then gets the translation for that term, applies the parameters and other modifiers and sets the values.

    If you want to update the text of a localize component, you can call Localize.OnLocalize(true).
    e.g.
    Code (csharp):
    1.  
    2. IEnumerator Start()
    3. {
    4.     var cmp = gameObject.GetComponent<I2.Loc.Localize>();
    5.     while (true)
    6.     {
    7.         cmp.OnLocalize(true);   // "true" forces the localization to happen
    8.         yield return new WaitForSeconds(1);
    9.     }
    10. }
    11.  
    It requests the parameter value in the LanguageManager.ApplyLocalizationParameters functions that is been called from the Localize.OnLocalize method.
    You can see the code in:
    Assets\I2\Localization\Scripts\Localize.cs line 165
    Assets\i2\localization\scripts\localizationmanager.cs line 516

    Hope that helps,
    Frank
     
    Devil_Inside likes this.
  38. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,433
    Seems that Unity has removed a skin that you use to draw the UI in the 2017.1 beta. The error logged rapidly when Localize component is in view.

    Code (CSharp):
    1. Unable to find style 'AS TextArea' in skin 'LightSkin' Repaint
    2. UnityEngine.GUIStyle:op_Implicit(String)
    3. I2.GUITools:DrawShadowedTabs(Int32, String[], Int32, Boolean) (at Assets/I2/Common/Editor/EditorTools.cs:169)
    4. I2.Loc.LocalizationEditor:OnGUI_Keys_Language_SpecializationsBar() (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:244)
    5. I2.Loc.LocalizationEditor:OnGUI_Keys_Languages(String, Localize, Boolean) (at Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:197)
    6. I2.Loc.LocalizeInspector:OnGUI_PrimaryTerm(Boolean) (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:307)
    7. I2.Loc.LocalizeInspector:OnGUI_Terms() (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:218)
    8. I2.Loc.LocalizeInspector:OnInspectorGUI() (at Assets/I2/Localization/Scripts/Editor/Inspectors/LocalizeInspector.cs:147)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Currently it looks like this

    Screenshot 2017-07-04 12.36.22.png
     
  39. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    I fixed all incompatibilities with unity 2017 in one of the latest betas.
    If you download the latest one from the beta folder, it will work fine.

    I'm adding a couple more features and will release a new version to the AssetStore as soon as possible.
    Hope that helps,
    Frank
     
    Last edited: Jul 4, 2017
  40. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    982
    Thanks for the quick reply!
     
  41. arlefreak

    arlefreak

    Joined:
    Nov 28, 2013
    Posts:
    5
    Hi I just bought the plugin and I have a couple of questions:

    - I have multiple Scriptable objects to initialize some things, is there a way I can set a Term Key as a parameter? currently I'm using LocalizedString but I'm not sure it's the correct way of doing things.

    - I'm using Text mesh pro and everything work's perfectly on the Editor, but when I build on mobile none of my Text objects appear, is there something special I have to do to build on mobile?

    Thanks!
     
  42. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    LocalizedString are meant to behave as a normal C# string. But instead of keeping the value you assign, they return the translation to the current language.
    Code (csharp):
    1.  
    2. LocalizedString locString;
    3.  
    4. locString = "TERM_Greeting";    // sets a term (which should be already defined in the LanguageSource)
    5.  
    6. LocalizationManager.CurrentLanguage = "English";
    7. Debug.Log( locString );  // will print "Good Morning"
    8.  
    9. LocalizationManager.CurrentLanguage = "Spanish";
    10. Debug.Log( locString );  // will print "Buenos Dias"
    11.  
    LocalizedString, have a custom property drawer, so they will show as popup in the inspector, allowing you to select the term.

    However, if you just need to have a string that holds the term, so that later you could call the SetTerm of any other Localize component. You could use a regular C# string, but add the [TermsPopup] attribute.

    Code (csharp):
    1.  
    2. [TermsPopup] string _MyTerm;
    3.  
    In the inspector, it will look as Popup with all the loaded terms, instead of as a text field.

    Can I ask which version of TextMeshPro and I2Localization are you using?
    Do you have all your terms in I2Languages.prefab or are there any other source in your scene?
    Is the "TextMeshPro" script define enabled for your Android/IOS builds?
    If you are changing fonts based on the language, are those fonts in the Resources folder, or referenced from the Localize or LanguageSource component?
    Are you getting any error or warning in the logs?

    Hope that helps,
    Frank
     
    5argon likes this.
  43. arlefreak

    arlefreak

    Joined:
    Nov 28, 2013
    Posts:
    5
    [TermsPopup] is exacty what I needed.

    - Text Mesh Pro 1.0.55.0b10
    - I2Localization 2.6.12f5
    - I have all my terms on I2Languages prefab
    - The Text Mesh Pro Script define is enabled on my build.
    - I'm using only one font, it's not on resources but it was working before I2 localization.
    - Localize component
    I'm going to try get some debug output
     
  44. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    391
    When I try to upgrade the plugin by doing a clean install of it (deleting the old I2 folder and then importing again) I now get errors that ScriptLocalization can not be found in the namespace. That script seems to not be part of the asset store package anymore. If I restore that script from my git repo then the plugin seems to work fine. What is the proper way of upgrading?
     
  45. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    The ScriptLocalization.cs and I2Languages.prefab are the files where you store the translations for your project. That's why the plugin doesn't include them, otherwise you could loose your translations everytime you update.

    What I2L does, is that after the plugin is installed, it checks if those files exist in your project. If they don't exist, then the plugin creates them for you (outside the I2 folder).

    The issue you are seeing, is that the ScriptLocalization.cs file was moved in your project to the inside the I2 folder, and got deleted, so it is preventing the plugin for compiling and auto-generating the file.

    Before updating, you should move your ScriptLocalization.cs and I2Languages.prefab to outside the I2 folder, and then delete that folder. After you reinstall I2L, everything will work fine.

    At this moment (for 2.7.1) I'm working on moving the plugin to the Plugins folder (to improve your compile times), as part of that movement, I have to make several changes to how the plugin connects to the targets (e.g. NGUI, 2DToolkit, etc) because some of them are not by default inside the plugin folder. As part of this restructure, I will see if I can remove the dependency between I2L and ScriptLocalization.cs. That way, even if you delete that file, the plugin will compile fine.

    Hope that helps,
    Frank
     
  46. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    391
    Ok thank you, but this would be good to add to the upgrade guide on your website, I read the guide and saw the note about the languages prefab but nothing about the script file. I've been using the plugin for a few years now and wasn't aware of this requirement.
     
    Inter-Illusion likes this.
  47. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    481
    Is there a way to explicitly specify a fallback language? We support "Chinese (Simplified)" but not "Chinese (Traditional)" and we want to fall back to English for Traditional. For now I'm just forcing it in code but it would be great if there were a way to specify a fallback in the editor.
     
  48. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    476
    Hi,
    By default, if the device's language is not found in your I2Languages.prefab, then, I2L tries to find a language without the variant (e.g. "Chinese" instead of "Chinese (Traditional)").
    That will match the "Chinese (Simplified)" that you already have.

    If for some reason, you don't have any Chinese language in your LanguageSource, then the plugin fallbacks to the first language in the I2Languages.prefab. (which normally is set to English)

    These steps are described here:
    http://inter-illusion.com/assets/I2LocalizationManual/InitialLanguage.html

    Hope that helps,
    Frank
     
  49. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    481
    Thanks for the quick reply. Yep, I understand all that. In my case, I do have Chinese simplified set up, but when the device is set to "Chinese (Traditional)" I want to fall back to English instead of simplified. So to do that I've changed `SelectStartupLanguage` in LocalizationManager.cs to:

    Code (csharp):
    1. if (SysLanguage=="ChineseTraditional") SysLanguage = "English";
    because I couldn't see any other way to configure a fallback. It's not crucial issue, I just thought it might be nice to have a feature where you can specify which fallback language to use in the editor.
     
    Inter-Illusion likes this.
  50. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    396
    On Andoid I'm getting a build error and it looks like these files/folder structure don't even exist in my project:

    stderr[
    res\values-de\strings.xml:3: error: Error parsing XML: not well-formed (invalid token)]

    ANy ideas?
     
unityunity