Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

I2 Localization ( The most complete Localization solution for Unity )

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

  1. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    180
    Hello! Just wanted to give everyone a heads up on this issue, for those using older versions of Unity with I2Loc.

    I've just updated my project from 2018.2 to latest LTS (2018.4.36f1), and also updated I2Loc to latest (2.8.15 f2).

    However, I then got several compile errors related to string interpolation, which is only available in C# 4.0:


    Assets/I2/Localization/Scripts/Configurables/PersistentStorage.cs(103,48): error CS1644: Feature `interpolated strings' cannot be used because it is not part of the C# 4.0 language specification


    For anyone else with this issue, you can fix it by updating the Scripting Runtime Version to ".NET 4.x Equivalent" in Project Settings

    More info here: https://docs.unity3d.com/2018.4/Documentation/Manual/CSharpCompiler.html
     
  2. Rs

    Rs

    Joined:
    Aug 14, 2012
    Posts:
    74
    Hello, not sure if this has been asked before. Does this asset have a built-in functionality to remember what language was selected the last time the application was used?
    Thanks
     
  3. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Rs likes this.
  4. Rs

    Rs

    Joined:
    Aug 14, 2012
    Posts:
    74
    Thanks for the quick reply. Another question: how do I pragmatically add a translation to a TermData that is non-text?
    Since I have lots of assets and scenes, I did an Editor script that populates the LanguageSourceAsset for me.
    For text it's easy. Once I created a TermData td I just call `td.SetTranslation(idx: mynewid, translation: myDefaultText);`
    but how do I do this for Sprites, AudioClips, Textures and the other managed types?
    What I want is to reproduce, in C#, the steps I would do when adding a term, setting its type to, say, Texture and then set the Texture value.
    I'm scratching my head because the translation field is always a string, no matter what they eTermType.
     
    Last edited: Aug 25, 2021
  5. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi,
    This is how non-string translations work in I2 Localization:
    http://inter-illusion.com/assets/I2LocalizationManual/AssetsTab.html

    Basically
    - If the object is in a Resources folder, then term's string is the path to that object
    - Otherwise, the object is added to the LanguageSource or the Localize component, and the string becomes the object name.

    To add the object to the LanguageSource, just use:
    Code (csharp):
    1.  
    2. LocalizationManager.Sources[0].Assets.Add( obj );
    3.  
    and then change the TermData to include the obj.Name.

    Hope that helps,
    Frank
     
    ricknexus and Rs like this.
  6. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    84
    Quick ping on this, any progress on the refactoring of the editor tools?
     
  7. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Unfortunately I haven't been able to complete that task yet. I have been doing a big refactoring to better handle AssetBundles/Addressables.
    As soon as I release that change, I will continue refactoring the editor to separate those tools.
     
    Falondrian and Grumpy-Dot like this.
  8. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    401
    What do i do if a UI needs a different material on top of a different font asset with text mesh pro?

    For example my new game here has a special material preset
    upload_2021-9-6_18-20-18.png

    But when I change the language it goes to normal.

    upload_2021-9-6_18-20-36.png

    how do I correct this?
     
  9. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi,
    You can change the material in a TMPro text in a couple ways:

    1- Instead of setting the Font as the secondary term, set the Material. When the plugin finds the secondary term is a material it will find the Font associated with that material (as they are named similarly) and then it will set both the material and the name

    or

    2- If your material is named very differently than your font, or you want to use an special material, then you can set the Font as the secondary term and then in your translated text, add the material name like this:
    (e.g. instead of "This is an example", add "[MaterialName]This is an example"
    That way the plugin changes the font (as its the secondary term), and then looks for a material with the name in the tag and sets it.

    Hope that helps,
    Frank
     
  10. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    72
    I'm getting a whole bunch of compiler errors when I import this into my project.
    Am I missing something?
    upload_2021-9-20_22-8-17.png

    Unity version: 2020.3.18f1

    Edit: I tried importing it in a clean project, and that works fine. Something in my project must clash with the asset
     
  11. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    289
    Sometimes in text I want to read a value from code by calling a function with a string parameter, such as "Zombies have {[FUNCTION="STRINGPARAMETER"}] health" How do I call a particular function in C#, passing it a string, from localized text?
     
  12. ricknexus

    ricknexus

    Joined:
    Aug 26, 2021
    Posts:
    1
    Hello,
    I am having a hard time trying to localise images. I created a new term and set it to Texture but whenever I try to drop an image into one of the language slots I get a NullReferenceException and the slot reports the file name in red.

    Full error here:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. I2.Loc.LocalizationEditor.OnGUI_Keys_LanguageTranslations (System.String Key, I2.Loc.Localize localizeCmp, System.Boolean IsPrimaryKey, I2.Loc.TermData& termdata, I2.Loc.LanguageSourceData source) (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:546)
    3. I2.Loc.LocalizationEditor.OnGUI_Keys_Languages (System.String Key, I2.Loc.TermData& termdata, I2.Loc.Localize localizeCmp, System.Boolean IsPrimaryKey, I2.Loc.LanguageSourceData source) (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:238)
    4. I2.Loc.LocalizationEditor.OnGUI_Keys_Languages (System.String Key, I2.Loc.Localize localizeCmp, System.Boolean IsPrimaryKey) (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:229)
    5. I2.Loc.LocalizationEditor.OnGUI_KeyList_ShowKeyDetails () (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms_Description.cs:42)
    6. I2.Loc.LocalizationEditor.OnGUI_KeysList (System.Boolean AllowExpandKey, System.Single Height, System.Boolean ShowTools) (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Terms.cs:145)
    7. I2.Loc.LocalizationEditor.OnGUI_Main () (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Localization/LocalizationEditor.cs:81)
    8. I2.Loc.LocalizationEditor.OnInspectorGUI () (at Assets/_ProjectLeo/Plugins/I2/Localization/Scripts/Editor/Inspectors/LocalizationEditor.cs:178)
    9. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:526)
    10. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:197)
    It really doesn't accept any textures. All of the ones I am trying are set as Default 2D textures. I tried to switch them to Sprites but the result is the same.

    Is it a path issue perhaps? Does the plugin want the full path of the texture in the Assets? Do they absolutely have to be located in the Resources folder? What is causing this??

    Edit: Aha! Perhaps I found out myself that I need to add the images to the Assets using the Assets tab right?
    It would be nice to have a meaningful error when this happens. Feature request?
     
    Last edited: Sep 22, 2021
  13. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    282
    How to make the languages used in my project appear in the store listing as "Supported Languages" when I generate a WSA project.

    I'm having a discussion about it, but I haven't found a solution yet.

    WSA Build - Languages supported by your packages - Unity Forum

    Everything works as expected for iOS and Android.
     
  14. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    107
    Hi @Inter-Illusion,

    I posted a number of bug reports with Arabic in the I2 Localization forum nearly 4 months ago but there haven't been any replies yet.

    Can you please look to address these issues?

    http://inter-illusion.com/forum/i2-...e-break-bottom-right-aligned-incorrectly#4353

    http://inter-illusion.com/forum/i2-...xt-max-line-length-breaks-rich-text-tags#4352

    http://inter-illusion.com/forum/i2-...adjust-alignment-option-breaks-rich-text-tags

    http://inter-illusion.com/forum/i2-...indnexttag-doesn-t-handle-nested-tags-causing

    I have also emailed the Support email 3 weeks ago to alert you to these unanswered issues but as of yet have received no reply.

    I thought that perhaps this asset had been abandoned as many 1 star Asset Store reviews have gone unanswered and it seems lots of people are struggling to get a response from the developer.

    I really don't want to be pushed into leaving a bad review as the system itself works well, it just has some bugs that need to be addressed.

    Thank you.
     
  15. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi,
    Sorry for not replying earlier.
    Unfortunately, I have had so much spam in the inter-illusion forum and email, that sometimes I have missed valid posts. Please, if you see I haven't replied in a day or two, post in here as Unity forum will warm me and not throw too much spam!
    Regarding the Line Breaks in RTL texts, It seems that TextMeshPro is now requiring the texts to be reversed per line and not entirely reversed as before.
    I have a fix for that issue and is already available for download on the AssetStore. (v2.8.16)
    Hope that helps, and again, sorry for not replying earlier.

    At this moment, the plugin only supports exporting the languages to the store listing for the Android and IOS stores.
    But, I will check on how the WSA handles the store listing and send an update to allow exposing the languages.
     
    wagenheimer likes this.
  16. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    107
    Hi @Inter-Illusion

    The latest version fixes the issue with manual line breaks vertically flipping the text, thank you for fixing that! (http://inter-illusion.com/forum/i2-...h-line-break-bottom-right-aligned-incorrectly)

    Two other issues I reported are still occurring and mean rich text tags cannot be used for Arabic.
    Can these be looked into, please?

    Thank you!
     
  17. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi
    I'm looking at those two issues, will upload a fix as soon as possible!
     
    nindim likes this.
  18. Falondrian

    Falondrian

    Joined:
    Nov 1, 2017
    Posts:
    31
    Hello,

    I have some questions/requests:

    1. How is the improved LocalizedString editor (that provides the same options as the component) coming along? This would really be a huge convenience feature
    2. It was already suggested previously - I would also like to see a deepl integration for auto translations, its just so much better than google translate, there is no comparison.
    3. I need to be able to provide different translations based on gender and would like to use the same approach you used for plurals - by inserting a [i2p_male] or [i2p_female] tag (one of the two would actually suffice by making the other gender the default). The gender could be provided by the getParam callback via a special keyword like "__GENDER__". I know this isn't optimal for all languages but would absolutely suffice for my use case.

    Now the problem is that it is not possible to globally hook into ApplyLocalizationParams so my only option is to modify I2L source code. I would really like to avoid that for update compability, so it would be great if you could add support for this tag or a global hook that can be used to modify the translation.

    Here a quick implementation (doesnt simultaneously work with the plural tag):

    Code (CSharp):
    1.  
    2.             string gender = getParam("__GENDER__") as string;
    3.             if (gender == null || (gender != "male" && gender != "female" && gender != "neuter"))
    4.             {
    5.                 #if UNITY_EDITOR
    6.                 if (gender != null || translation.Contains("[i2p_male]") || translation.Contains("[i2p_female]") || translation.Contains("[i2p_neuter]"))
    7.                     Debug.LogWarning($"No (valid) gender provided in localization param, defaulting to male. Param: {gender}. Translation: {translation}");
    8.                 #endif
    9.                 gender = "male";
    10.             }
    11.  
    12.             string genderTag = "[i2p_" + gender + "]";
    13.             idx0 = translation.IndexOf(genderTag, StringComparison.OrdinalIgnoreCase);
    14.             if (idx0 < 0)
    15.                 idx0 = 0;
    16.             else
    17.                 idx0 += genderTag.Length;
    18.  
    19.             idx1 = translation.IndexOf("[i2p_", idx0 + 1, StringComparison.OrdinalIgnoreCase);
    20.             if (idx1 < 0)
    21.                 idx1 = translation.Length;
    22.  
    23.             translation = translation.Substring(idx0, idx1 - idx0);
    24.  
     
    Last edited: Oct 13, 2021
  19. BAIZOR

    BAIZOR

    Joined:
    Jul 4, 2013
    Posts:
    96
    I have Term named "continue" and just used Code Generation feature for terms. You may super simply fix it. Just need to add @ at the variable start. It will work! Please do this natively into the plugin! Thanks!
    upload_2021-10-17_0-43-21.png
     
  20. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,099
    @Inter-Illusion Hi, I'm using the latest asset store version & I'm trying to add some new languages my customers are asking for, I add them under the languages tab and press the Translate all terms button, it says it's translating (353).... then just stops. No errors or anything. If i go to each term I can translate all languages but it would take a long time.
     
  21. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi,
    @Falondrian, I just added a way to set up a custom hook into the ApplyLocalizationParams that could be set to either preprocess the translation before calling ApplyLocalizationParams or completely replace it

    Check LocalizationManager.CustomApplyLocalizationParams in the next version (v2.8.17)

    I like the idea of also adding gender to the customizations, but first I have to figure out how to organize the inspector to allow plurals for different genders.

    That's now fixed. All variables matching a C# keyword have now a @ before them.

    The problem there is that given that we are using the FREE version of Google Translate, there is a limit on how many words can be translated per minute/day.
    To solve the issue, the plugins send the translations in batches, and waits a moment between each batch. But sometimes (not always) google doesn't like how often that happens (when translating a big list of terms) and doesn't allow more translations until 5-10 seconds later.
    The plugin keeps trying for a few times, but eventually stops.

    You could keep clicking Translate All. Every time you do, a few terms will be translated (the first batch almost always succeeds). The longer you wait between clicking the Translate All button, the more terms will succeed.

    But this could become a hassle, so, the best way to solve the issue when translating a lot of terms, is to upload to a google spreadsheet, then replace each cell in that column with a GOOGLETRANSLATE function, that will translate all the columns, and then import back to Unity the translations.

    Sorry about all of this, Google gives this free tier, but the more translations you do, the more it pushes for switching to a paid tier.


    This was a bigger change than I expected to support tags split into multi-lines and reversed. Mainly because there are many ways to nest them and TMPro doesn't require closing tags, so there are many edge cases on which tags should be swapped and which shouldn't now that the line is kept in the same order, but inside the lines the text is reversed.
    I already have a fix for the Adjust Alignment issue, but still working on the Max Line Length.
     
    Falondrian likes this.
  22. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    107
    Thank you for the update.

     
  23. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,099
    Thank you. I ended up manually going through all 300+ terms and clicking the translate all manually.
     
  24. apprenticegc

    apprenticegc

    Joined:
    Apr 21, 2012
    Posts:
    17
    Hello,

    I am trying to use I2Localize component on the gameobject with text mesh pro. I notice that no mater how much I try, I can not change LanguageSourceAsset to the location I want. It always loads the one under Resources folder. I have several scenes, and I want to make LanguageSourceAsset for different scene. Is there any setting I can adjust? Thanks.

     
  25. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    107
    Hey @Inter-Illusion ,

    I hope you are doing well.

    Is there any update on the status of these bugs?

    Many thanks!
     
  26. Kojote

    Kojote

    Joined:
    May 6, 2017
    Posts:
    112
    Hi! I bought the I2 today and just tried to set up Google. I have the web service URL. Verify also works, even changing it.

    My question is, above "In Google Drive" it says "Password". I should change this. What kind of password do I have to enter?

    Greetings from Kojote
     
  27. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    That is an optional password for extra security.
    You first need to set a password in the webservice and then use that password in unity.
    The password is located in the Main.gs file of the webservice (line 20)
    upload_2021-11-17_10-38-23.png

    I think I have both issues fixed, I just need to write the tests for them and if I don't see any case that still breaks the wrapping, I will include the fixes in the next release.

    Hope that helps,
    Frank
     
    Kojote likes this.
  28. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    401
    I'm having a problem where it seems like the font asset isn't changing for Chinese and Japanese languages. As a result I get errors (squares) in the font.

    upload_2021-11-18_5-5-28.png

    This should be the correct setup right?
     
  29. Skyline520

    Skyline520

    Joined:
    Jan 14, 2016
    Posts:
    8
    Hi, the asset works fine in Editor and Android device. But Thai language has display error in iOS device, while other languages (include Arabic) display no problem. All Thai texts become question mark in box ⍰⍰⍰
    I use Unity 2020.3.21, Xcode 12.5, iOS 14.3. Font: Arial
     
  30. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Hi, That happens because the font you are using doesn't contain those characters.
    To have the Tai, Chinese and other language's characters, you would need to use the ArialUnicode font instead.
    The ArialUnicode is a larger version of Arial and contains all the characters used in the different languages.

    @sacb0y That setup seems correct.
    Can you verify if when you switch fonts, the actual asset is not changed, or is it that it changes the font asset, but the TMP font fallbacks system redirects to use the wrong font?
     
    Skyline520 likes this.
  31. Funtyx

    Funtyx

    Joined:
    May 3, 2017
    Posts:
    23
    What am I doing wrong? I created a test script in the editor, it works, but if you build the build, then only rewardCoins are displayed on the screen, the rest of the Reward_Coins_First and Reward_Coins_Last are displayed empty. And how can I add a term that has different fonts for example "Fonts" to this script? Through the I2 Localize script, I use the Secondary field for the fonts named "Fonts".

    Code (CSharp):
    1.     public TextMeshProUGUI textLabel;
    2.     public string rewardCoins = "50";
    3.  
    4.     void Start()
    5.     {
    6.         string Reward_Coins_First = LocalizationManager.GetTranslation("Reward Coins First");
    7.         string Reward_Coins_Last = LocalizationManager.GetTranslation("Reward Coins Last");
    8.  
    9.         SetText($"{Reward_Coins_First} {rewardCoins} {Reward_Coins_Last}"); //You earned 50 coins!"
    10.     }
    11.  
    12.     public void SetText(string text)
    13.     {
    14.         textLabel.text = text;
    15.     }
     
  32. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    529
    Hello is there any way to lock export button, to not override exported files by mistake?
     
  33. Mighcty

    Mighcty

    Joined:
    Jan 6, 2019
    Posts:
    2
    Hi there, is it possible to add custom fields in the csv file?
    I want to store the character that's speaking the line alongside the line, and probably the icon with different emotions of the character as well.
    Something like this:
    [Key] [Type] [Desc] [Language 1] [Language 2] [character_id] [character_icon]

    Some of the keys will not have the above data, because non-dialogue text is put in the same file. If it's not possible, is there any way I can get around with it?

    Thanks for the plugin, it's great :D
     
  34. Mighcty

    Mighcty

    Joined:
    Jan 6, 2019
    Posts:
    2
    Ok I found the way haha.
    I added a new language "Char_key", and whenever I want to use the "Key" to get a translation, I also use the "Key" to get the translation of the language "Char_Key", by using overrideLanguage: "Char_Key"
     
  35. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Adding a new column is possible, but you would have to modify several parts of the code to support it. (e.g. TermData class to add the extra columns as variables, CSV and i2CSV loading, etc)
    The easiest way I have used to add extra data per term. Is to use the Desc column as a metadata field.
    So, just add "[DATA]character=Hero,emotion=Sad" and then parse it in your code.
    Or set a JSON and decode it when you need it.
    That way you will see that if the Desc starts with [DATA] or {, then its a Desc is a Metadata field and not a Description text.


    Not at the moment. But I'm not sure I fully understand this suggestion.
    Are you suggesting adding a button on the top of the LanguageSource to turn it ReadOnly? or at least to disable the Import/Export buttons? So that to export, you have first to click that button to unlock, then click to Import, and then click again to Lock?

    That setup seems correct.
    Are you sure that the term "Reward Coins First" has translations set in the language used in the build?
    Are you using multiple LanguageSources, or just the default I2Languages? If using multiple Languages, please verify that the source is included in the scene and that this script runs after the language source is loaded.

    BTW, there is an easier and more robust way of handling parameters:
    http://inter-illusion.com/assets/I2LocalizationManual/Parameters.html

    So, you can create a term "Reward Coins" with a translation like "You earned {[COINS]} coins!".
    And then set either a global ParamsManager to hold the number of coins (that way you don't need this script, just the I2Localize). or you can do in the script:
    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     string translation = LocalizationManager.GetTranslation(mTerm);
    5.     LocalizationManager.ApplyLocalizationParams(ref translation, new Dictionary<string, object>{{"COINS", rewardCoins}});
    6.    
    7.     SetText(translation); //You earned 50 coins!"
    8. }
    9.  
    Also, it will be better if the variable rewardCoins is an int instead of a string.
    That way, the plugin can understand it and apply Plural rules and allow you to customize it to show:
    You earned 50 coins!
    You earned 1 coin!
    You earned no coins!

    Hope that helps
    Frank
     
  36. diego_pocketpinata

    diego_pocketpinata

    Joined:
    Apr 28, 2021
    Posts:
    1
    Hello, I want to be able use the localization by only using the Key for terms. In our team, we want to have multiple tabs in the localization sheet but all keys would be unique so we can get the translation with only the key (not the category) in code.

    So far, I was able to achieve this by adding the parameter "allowCategoryMistmatch" to both LocalizationManager.TryGetTranslation and LocalizationManager.GetTranslation so we can pass it to LanguageSourceData.TryGetTranslation inside LocalizationManager.TryGetTranslation but the problem is that now the option "Case Insensitive Terms" is not working (from what I've seen it should still work but I'm not sure).

    My question is, is there a better way out of the box to get translations using keys ignoring their category?
     
  37. TanyaKogan

    TanyaKogan

    Joined:
    Oct 27, 2020
    Posts:
    2
    Hi! I need to change fonts according to language but not in the prefab but in script.

    I have defined the following class to get the translation:

    Code (CSharp):
    1.     public static class ScriptLocalization
    2.     {
    3.  
    4.         public static string Get(string key)
    5.         {
    6.             return LocalizationManager.GetTranslation (key)?? key;
    7.         }
    8.  
    9.         public static string AutomateGeneratorTypeGoal         { get{ return LocalizationManager.GetTranslation ("AutomateGeneratorTypeGoal"); } }
    10.         public static string AutomateGeneratorsGoal         { get{ return LocalizationManager.GetTranslation ("AutomateGeneratorsGoal"); } }
    11.  
    12. ...
    13. }
    This is the example how I use it in the code:

    Code (CSharp):
    1. public TextMeshProUGUI TitleText;          
    2. TitleText.text = ScriptLocalization.Get(currencyLocId);
    How can I get/set the secondary term to set the fonts to this TextMeshProUGUI?

    I created the fonts term like in the example (I know it has blanks):
    upload_2021-12-23_11-11-20.png
     
  38. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    529

    The thing is that sheet with loclsation could be formated in pretty way, you could add colour sections etc. and that works perfectly for us. the problem is that if someone by mistake will export it again from i2 loclisation asset all formating/ order etc will be gone in sheet, so we are always importing. But its quite easy to make a mistake and click export it to sheet instead of import.
     
  39. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,269
    @Inter-Illusion
    hey there. I'm currently porting a game to different platforms and there is a slight problem with the PlayerPrefs for Xbox Consoles.
    Is it possible to disable I2 Localisation PlayerPrefs? And what could I save instead? Which API (Method, Property, Value) can I save in my savesystem and pass back to I2 Localisation at application start?

    Edit: To be more clear, what I personally only need is the last used language.
     
    Last edited: Jan 6, 2022
    TonyLi likes this.
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,793
    I've been meaning to request that, too. On Xbox, PlayerPrefs is not immediately available at application start. Would you please add an option to manually initialize from PlayerPrefs at a later time and/or manually initialize from some other source?
     
  41. OdedJelly

    OdedJelly

    Joined:
    Jan 4, 2021
    Posts:
    2
    Hi @Inter-Illusion
    I apologize if this was asked before, I didn't find an answer to this issue
    We want to use two different files - one for development and one for production. Currently we use the google web service. (we prefer to be able to update remotely and not rely on app version update for localization changes. Also ,the file is comprised of many categories (tabs)).
    The only option we have, if I understand correctly, is to divide the file into Csv's and hosting it on our servers. Then we need to manage each csv as its own category and do some extra work to extract category by some means at run time...
    Is there another way? maybe is it possible to use two google web services? (or two I2 scriptable objects?)
     
  42. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,144
    hi, I have 2 questions, 3 request.

    Q1. How to update my already made i2 language prefab? from old version (few months past) to newest.
    Tried package manager - update, but not applied to existed prefab.

    Q2. If periodic update from google sync is blocked by reason of user's device's internet connection (I am making for nintendo switch platform), what happened? no error and no application crash?

    Request 1. Need function for make bulk of new keys.

    Request 2. Why always return to everything status in Term section after doing make new key? Even after I narrowed down the categories, it return back to everything. This become serious stucks because I have many terms (over thousand).
    So don't make it return to everything category or give me option.

    Request 3. Selection bulk of keys. For change category for all of them chosen.
     
    Last edited: Jan 13, 2022
  43. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,144
    7 errors after update newest, 2.8.17

    Assets\I2\Localization\Scripts\Editor\EditorTools.cs(42,17): error CS0149: Method name expected

    Assets\I2\Localization\Scripts\Editor\Localization\LocalizationEditor_Languages.cs(155,42): error CS1660: Cannot convert lambda expression to type 'Action' because it is not a delegate type

    this sort of...
     
  44. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,144
    i2 error.JPG
    I need 2.8.13 version file. I can't use this 2.8.17 cuz of error. These errors consumes my time... Why I should debug this? I even don't know.
     
  45. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    You could disable the formatting of the spreadsheets by opening the I2GoogleWebService from your google drive, and commenting line 132 of the ImportCSV.gs to avoid calling SetupSheetFormat( sheet, range );
    After that, you would need to deploy the web service again and it will not clear the format and colors you set.

    The plugin allows you to replace the PlayerPrefs calls with your own system.
    You just need to implement a new I2CustomPersistentStorage and assign it to
    PersistentStorage.mStorage

    see the I2CustomPersistentStorage for an example of what functions to redefine and
    I2BasePersistentStorage shows how they are defined by default.
     
  46. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    Q1. If you install the latest version of I2 Localization, the old I2Languages.prefab should work just fine.
    If for some reason it doesn't (please email me details as I don't have any report of issues updating to a new version), then a safe way would be, to export I2Languages->Google Spreadsheet and then open the I2Languages asset from the latest version and import the Google Spreadsheet back to unity.

    Q2. The plugin tries to download from google as often as you have set in the settings (Weekly, Daily, etc).
    If at any point, it fails to contact google (no internet, blocked, etc), then it just uses the previously downloaded spreadsheet.
    If it hasn't been able to contact google at all, then it uses the spreadsheet that was downloaded in the editor at the moment the game build was made.
    But it would never fail to show translations because it can't connect to google. The plugin always shows the translation from its internal cache, and it just updates the cache whenever possible.

    Request 1. can you please elaborate a bit more about this? By default, if you assign a I2Localize to a GameObject it will automatically suggest the term from the object's text an then in the LanguageSource you just need to add the translations to "create" the terms.
    You could also Add all the term you want in the Google Spreadsheet and then import them in bulk to unity.
    You can also use the tool to Parse all texts in your scene/project and then click Add Terms to create with 1 click all those terms that don't exist or are missing.
    http://inter-illusion.com/assets/I2LocalizationManual/ParsingthescenesforMissingorUnus.html

    Request 2. This is indeed a problem, will look into it.

    Request 3. In the recent versions, this tool has an option to change category of all selected terms.
    http://inter-illusion.com/assets/I2LocalizationManual/CombiningKeys.html
    Another way to do this, is by exporting to google spreadsheet, moving the terms to another tab (which are categories) and then importing back to unity.
     
  47. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    551
    I have been trying to reproduce this in several unity version, but it seems to be working correctly in all versions I tried.
    Can you please give me more info about what Unity Version you are using, what Platform are you deploying to?
    Can you please double check in your Project Settings that you are targeting ".Net Framework" and compatible with .Net 4.x Equivalent?

    In any case, if nothing of that works and you need a quick fix while I reproduce this issue, you can cast the lambdas to Action for those 6 lines:
    for example:
    Code (csharp):
    1.  
    2. GUITools.DelayedCall( () => TranslateAllToLanguage(LanName));
    3.  
    Code (csharp):
    1.  
    2. GUITools.DelayedCall( (System.Action)( () => TranslateAllToLanguage(LanName) ));
    3.  
    Hope that helps,
    Frank
     
  48. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,144
  49. OdedJelly

    OdedJelly

    Joined:
    Jan 4, 2021
    Posts:
    2
    Hi @Inter-Illusion
    In continuation to this post
    I also tried Adding a new file using the "In GoogleDrive", and than using LocalizationManager.Sources[0].Google_SpreadsheetName and
    LocalizationManager.Sources[0].Import_Google but did not find any documentation on how to properly use this flow
     
  50. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,144
    following error occurs when game start play.
    --------
    NullReferenceException: Object reference not set to an instance of an object
    I2.Loc.LanguageSourceData+<Import_Google_Coroutine>d__70.MoveNext () (at Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:187)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <c4f3000f15844b6e809242b48061a7de>:0)
    -----

    my version is unity 2021.1.16, i2local 2.8.13f1
     
unityunity