Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our 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. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647

    But will that also keep our order of keys, empty columns, empty lines etc? Cause after importing your asset is organizing things alphabetical way, we have it organized differently. (we also sometimes make empty lines to make some organization etc. If not just blocking export button would be good and probably easy to implement options
     
  2. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,472
    How resolve this error?
    -------------
    MissingReferenceException: The object of type 'LanguageSource' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Object.get_name () (at <c4f3000f15844b6e809242b48061a7de>:0)
    I2.Loc.LanguageSourceData.GetSourcePlayerPrefName () (at Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:153)
    I2.Loc.LanguageSourceData.Import_Google_CreateWWWcall (System.Boolean ForceUpdate, System.Boolean justCheck) (at Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:266)
    I2.Loc.LanguageSourceData+<Import_Google_Coroutine>d__70.MoveNext () (at Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:173)
    I2.Loc.CoroutineManager+<>c__DisplayClass4_1.<Start>b__0 () (at Assets/I2/Localization/Scripts/Utils/CoroutineManager.cs:41)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.Delegate.DynamicInvokeImpl (System.Object[] args) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    System.Delegate.DynamicInvoke (System.Object[] args) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <7ca9a09aeae542ab86253a551b1c89a0>:0)
     
  3. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Hi Frank,

    Any update on when the release with these fixes will be on the AssetStore?

    All the best

     
  4. GKdev1980

    GKdev1980

    Joined:
    Dec 10, 2013
    Posts:
    29
    Hi, I hope I'm not the only one facing this issue.

    I'm using I2 Localization 2.8.16 along with Unity 2019.2.17f1. I'm working on a massive project with lots and lots of localized elements (text, images, audio clips) so to keep things organized and easier to use, I decided to use the I2Languages.asset in the Resources folder only for the common terms used multiple times in the project and add a separate LanguageSource component in each scene for scene-specific localizations.

    I've worked with this method for a couple of weeks without any issue and today all of a sudden (after some changes I made to the project but I didn't track all of them to try and undo them) the plugin decided to go crazy on me:
    - When I first open the project and open a scene I can see in the editor ONLY localizations that refer to the scene-specific LanguageSource component in a gameobject in the scene. All localizations in the common Ι2Languages.asset in the Resources folder appear blank in the editor. All of them. Text, Images etc.
    - As soon as I enter play mode the "effect" is reversed. All localizations in the LanguageSource component in the scene appear blank and only common localizations inside I2Languages.asset appear in the scene!!

    If I exit play mode the project stays in the second "mode", that is showing only localizations in the common I2Languages.asset.

    Any idea? I have to say that updating Unity version is not an option due to many plugins used in the project and even updating the I2 plugin feels like a huge risk to me.
     
  5. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    That is quite a weird behavior, especially if it was working fine until some other things in the project changed.

    The only thing I can think right now is that there were some crash while debugging that made unity, not run the plugin finallizers and left it in a wrong state.
    Sometimes the plugins takes its built in source data and saves it in a local cache to unload from memory the languages that are not being used. My guess is that the cache could have been corrupted, so in editor it loads the data from the editor, but in game or play mode, it doesn't access that data, but its cache may be empty or corrupted.
    I haven't seen this happen before, but in theory could happen, so, if possible try this:

    Delete the PlayerPrefs keys and also any temporal file from Application.persistentDataPath and Application.temporaryCachePath.
    That will remove any cached value and just use whatever is in the editor.
     
  6. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    That looks like you started downloading data from google and then the source was destroyed while the data was still downloading.
    This could happen if you manually deleted the source, or if you started the downloading of a scene source while in play mode and then exited the play while the google data was still downloading.
    Or if you have languageSources in different scenes, it could be that one source was downloading when it moved to another scene and when that coroutine finished it couldn't find the source that asked for the translation.

    I will investigate this a bit more to see if I can make this happen.
    But either way it shouldn't crash, so, I'm going to make a change and just display a warning without sending the null reference exception.
     
  7. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Unfortunately, there were still cases where it was broken, and I had to move temporally to other fixes, I will go back to that as soon as possible.
    Said that, in the latest update I included a partial fix for one of the issues.
    Could you please try them and see if that works for you? I will try to finalize this as soon as possible!
     
  8. marcin_michalek

    marcin_michalek

    Joined:
    Oct 24, 2019
    Posts:
    4
    @Inter-Illusion Hi, do you have documentation in PDF? Your website is down.
     
    bgrz likes this.
  9. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Sorry about the issue with the website.
    It seems that it was wrongly flagged and now I'm waiting for the hosting to resume access.
    Hopefully that will happen in the next few hours.
     
  10. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,472
    I don't know why but web-google document become roll-backed to past version. Why and how to block this phenomenon?

    Normally our teams first [import-merge] at mainlanguage prefab inside project folder.
    and revise or add keys, values, then do [export-merge].

    Then at my thought, there should be no error or roll-back, isn't it?
     
  11. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,472
    When do [merge], what happens? What if already has same key but different text when merge?
     
  12. bzkarcade

    bzkarcade

    Joined:
    Oct 5, 2017
    Posts:
    21
    Hi

    I'm having problems with font localization, using TextMeshPRO in Unity 2019.4.16, with I2 Localize version 2.8.17 and TextMeshPRO version 2.1.1

    I change the language through SetLanguage Button and the text is correct, but the Font is not changed. In fact, in the inspector it is not seen that the font changes at any time.

    Create a test project, without all the other plugins in my project. But the behavior is the same.

    I attach screenshots below.

    Screenshot 2022-02-06 141413.png Screenshot 2022-02-06 141532_LI.jpg Screenshot 2022-02-06 141614_LI.jpg Screenshot 2022-02-06 142217.png Screenshot 2022-02-06 142234.png

    Thanks for your help in advance.
     
  13. bzkarcade

    bzkarcade

    Joined:
    Oct 5, 2017
    Posts:
    21
    A TMP SubMesh is generated, but with the default font of TMP

    Screenshot 2022-02-06 143219.png
     
  14. bzkarcade

    bzkarcade

    Joined:
    Oct 5, 2017
    Posts:
    21
    Screenshot 2022-02-07 133821.png

    I noticed this today, sorry for the spam in the forum.
     
  15. Harrishun

    Harrishun

    Joined:
    Apr 13, 2016
    Posts:
    59
    Hi @Inter-Illusion, thanks for your work on this great plugin.

    My team has unfortunately hit a snag, and we're wondering what the best course of action is. For context, we utilize a system that allows scripts to directly update UI via bindings. This makes it simpler for us to update things like text on the fly (if you're curious, this is UnityWeld).

    In our pre-production phase, we deemed it more beneficial to create localization-based scripts that implement this system, as we could use the ScriptLocalization script to reference and update our text on a language change. This was working fine using the default Unity UI system, but we recently decided to change over to TextMeshPro and now get white squares when in languages that don't use the Roman Alphabet (in our case right now, Japanese).

    I've seen that the intended use is that a I2 Localize component is to be placed on each GameObject that requires localization, and via this, changing font is possible. However, is there a feature that we may have missed (or just a different way of going about it) that would enable us to change font based on what the global language is set to?
     
  16. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    How can I automate Google sheet import? I tried variations of the example found here: http://inter-illusion.com/forum/i2-localization/958-automating-a-google-sheets-import but downloadhandler.text is returning an empty string.

    Code (CSharp):
    1.     [MenuItem("Test/Build Tools/Update Localization")]
    2.     static void UpdateLocalization()
    3.     {
    4.         I2.Loc.CoroutineManager.Start(SyncSource());
    5.     }
    6.  
    7.     static IEnumerator SyncSource()
    8.     {
    9.         LocalizationManager.UpdateSources(); // ensures the source is loaded
    10.         var source = LocalizationManager.Sources[0];
    11.         var www = source.Import_Google_CreateWWWcall(true, false);
    12.         yield return www;
    13.         if (string.IsNullOrEmpty(www.error))
    14.         {
    15.             Debug.Log(www.downloadHandler.text); // <= This is returning empty string "", perhaps yield return www isn't waiting for results
    16.             source.Import_Google_Result(www.downloadHandler.text, eSpreadsheetUpdateMode.Replace);
    17.         }
    18.     }
     
    Last edited: Feb 10, 2022
  17. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    I just submitted version 2.8.19 which fixes the issue where Import_Google_CreateWWWcall passing force=true was not forcing importing the data if the source had already downloaded the terms and the spreadsheet hasn't changed.
    That will force downloading disregarding which was the last downloaded version.

    The other way that call could return empty, is if the spreadsheet doesn't have the correct name.
    It should start with "I2Loc". (e.g. "I2Loc My Game")
    This constraint is placed so that even if someone guesses the password you set in your google drive, they will not have access to any other file except your localization spreadsheet.
     
  18. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    I haven't heard before about UnityWeld, it looks interesting. Normally for data binding I use Peppermint, but will research this one a bit!

    In peppermint I just bind the terms to the Localize.Term or Localize.SecondaryTerm property and that way the binding works without having to modify anything.
    If you are creating scripts to query for the translations at runtime you could use a code similar to the one in
    LocalizeTarget_TextMeshPro_UGUI

    Code (csharp):
    1.  
    2.  
    3. string Term = "example";
    4. string SecondaryTerm = "arial";
    5.  
    6. string MainTranslation = LocalizationManager.GetTranslation (Term, true);
    7. string SecondaryTranslation = LocalizationManager.GetTranslation (SecondaryTerm, false);
    8.  
    9. TMP_FontAsset newFont = cmp.GetSecondaryTranslatedObj<TMP_FontAsset>(ref MainTranslation, ref SecondaryTranslation);
    10.  
    11. tmp.text = MainTranslation;
    12. tmp.font = newFont;
    13.  
    14.  
     
  19. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    Figured I would share how I got I2 localization working finally. The included "I2.Loc.CoroutineManager" doesn't wait until the web request returns a value before proceeding with the import. I simply added "while (www.downloadProgress < 1.0f) yield return null;" to fix this for now. "yield return new WaitUntil(() => www.downloadProgress >= 1.0f);" does not appear to work with I2.Loc.CoroutineManager.

    Code (CSharp):
    1. [MenuItem("Test/Build Tools/Update Localization")]
    2.     static void UpdateLocalization()
    3.     {
    4.         I2.Loc.CoroutineManager.Start(SyncSource());
    5.     }
    6.  
    7.     static IEnumerator SyncSource()
    8.     {
    9.         LocalizationManager.UpdateSources(); // ensures the source is loaded
    10.         var source = LocalizationManager.Sources[0];
    11.         var www = source.Import_Google_CreateWWWcall(true, false);
    12.         yield return www;
    13.         while (www.downloadProgress < 1.0f) yield return null;
    14.         if (string.IsNullOrEmpty(www.error))
    15.         {
    16.             source.Import_Google_Result(www.downloadHandler.text, eSpreadsheetUpdateMode.Replace);
    17.  
    18.             // Finally, save the Language Source Asset to make imported data stick
    19.             LanguageSourceAsset languageSourceAsset = Resources.Load<LanguageSourceAsset>("I2Languages");
    20.             EditorUtility.SetDirty(languageSourceAsset);
    21.             AssetDatabase.SaveAssets();
    22.         }
    23.     }
     
    Last edited: Feb 14, 2022
  20. Graham-B

    Graham-B

    Joined:
    Feb 27, 2013
    Posts:
    330
    After trying your update, downloadhandler.text is still returning an empty string, and this still appears to be caused by "I2.Loc.CoroutineManager" not waiting until the web request returns a value before proceeding with the import.

    It only works by adding "while (www.downloadProgress < 1.0f) yield return null;" to your code.
     
    Last edited: Feb 14, 2022
  21. Harrishun

    Harrishun

    Joined:
    Apr 13, 2016
    Posts:
    59
    Oh interesting, I've never heard of Peppermint. I personally know the creator of UnityWeld, and as an inexperienced Unity dev at the time, it just sort of stuck. They look very similar in concept however!

    We actually just managed to figure out a non-I2 and non-binding way to fix the fonts, meaning we don't have to add an additional component to every object using TMP (which saves a lot of time!). The TMP team seem to have streamlined how their Font Assets work, so setting the desired fallback font (in our case at the moment, one capable of displaying Japanese) appropriately updates to use the fallback font in the case that the default font does not have those characters.

    If anyone is curious, I stumbled upon this thread with the information.

    Thanks for your help @Inter-Illusion!
     
    Inter-Illusion likes this.
  22. en_en_tan

    en_en_tan

    Joined:
    Feb 12, 2013
    Posts:
    2
    Hi

    I'm using v2.8.17 and want to ask is it possible to sync the text on runtime? ( both editor and build mode )

    So in my case, we need to have our scriptwriter editing the text while testing the game. What we try to achieve is, we edit some text in sheet -> run a script to sync the text from sheet -> load it into game

    Thanks before and awesome tools @Inter-Illusion !
     
  23. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Set the update frequency to ALWAYS, then every time the game is closed and opened again, it will download the spreadsheet.
    So any change the scriptwriter does, will get downloaded once the game is opened. Be aware that it may take a few seconds to download the spreadsheet and then the UI will update with the new texts.
     
  24. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    Thanks @Inter-Illusion ,

    I am just trying to update to the latest version now to test my 3 open I2 bugs against the latest code and noticed that the I'm seeing various different version numbers.
    • Inspector says v2.8.17 f1.
    • Readme says 2.8.16 at the top.
    • Version History in readme says 2.8.19.
    • Unity Asset Store says says 2.8.19.
    I'm assuming I am now on v2.8.19 and the Inspector and top of the readme have just not been updated to match?

    Current Bug Status as of v2.8.19
    1. http://inter-illusion.com/forum/i2-...h-line-break-bottom-right-aligned-incorrectly
      • FIXED :)
    2. http://inter-illusion.com/forum/i2-...adjust-alignment-option-breaks-rich-text-tags
      • It seems rich text tags now no longer work at all in Arabic, regardless of the Adjust Alignment setting. If you think these should work, can you provide an example spreadsheet that has a bold tag correctly formatted to work with I2Localization, please?
      • My test text when formatted using Google Sheets Left/Right Align option upload_2022-3-20_11-19-54.png
        • LTR Cell: upload_2022-3-20_11-19-12.png
        • RTL Cell: upload_2022-3-20_11-18-48.png
    3. http://inter-illusion.com/forum/i2-...ic-text-max-line-length-breaks-rich-text-tags
      • Cannot test this as Rich text tags are broken.

    I have also gone through my customisations to I2Loicalization and thought I'd share them with you here in the hope they can be included in the next version:

    Booting in a RTL language causes Adjust Alignment to Malfunction
    1. Boot in English.
    2. Switch to Arabic at runtime.
    3. Noticed the English left aligned strings are correctly flipped to right aligned for Arabic.
    4. Exit play mode.
    5. Boot game with Arabic as the default/initial language.
    6. Notice the strings that were correctly right aligned in Arabic in step 3 are now incorrectly left aligned.
    7. Switch to English at runtime.
    8. Notice the strings become incorrectly right aligned for English.
    I found the fix for this behaviour to be the following:

    upload_2022-3-20_10-8-51.png



    Term Not Found - Addition of Real Error/Warning
    upload_2022-3-20_9-55-55.png

    This allows us to find missing terms much more easily rather than having to scan the actual screen text in all scenes/prefabs. Adding this as an extra option would retain the current behaviour for your customers if you feel that's important. Personally though, if a translation is missing, I feel it is a full on error rather than a warning. By logging as an error we would also be able to see them in the wild via Firebase etc.

    Thanks a lot!
     
  25. Dornano

    Dornano

    Joined:
    Mar 22, 2019
    Posts:
    9
    Hi ! Thanks a lot for this wonderful asset :)

    Sorry it may be a dumb question, but I'm trying to translate a terme having some special characters, like this: "[Reprendre partie]"

    Text1.PNG

    But it seems the asset doesn't allow me to translate it or to create a new key :

    Text2.PNG

    Is this normal, is there a workaround? Or should I just put text with no special character like this?

    Thanks a lot for your help ! :)
     
  26. Dornano

    Dornano

    Joined:
    Mar 22, 2019
    Posts:
    9
    I'm so sorry for this 2nd post, but hum, I've translated a bunch of texts, and in editor as well as in build, it's all messed up. Not sure I did it ok, so here is what i did:

    -On my I2Languages prefab, of course I added the languages I wanted to add.
    -I added a "I2 Localize" component to every single text I have in my scene, and completed the translations within each of these components. I'm not using any google or CSV file so far (should I?)
    -I added the "SetLanguage Button" script to a button object, in order to switch languages. I've linked this script to the method I call "on click". Of course I chose English Language, but in this script component, there's also a grayed out "Language source" I left empty, I don't know what kind of asset it's asking for, because it's accepting none.

    All my text components are written in French by default, and the main language by default on I2 is set to French as well, so I didn't filled up the translations in all the "I2 Localize" components (maybe I should?)
    When launching the game, as long as I'm not touching the buttons, the game stays in default French. But when I hit the English button, it switches the text to English only on the actual screen (options menu). But when I go to another screen (main menu for example), it stayed in French, nothing has changed.
    When I hit the French button to go back in French, all the texts on the actual screen (options menu) go blank (I chose "On missing translation: empty"), and still nothing changed on the other screens (like main menu, etc.)

    Long story short: it's all messing up and I don't really understand what's going on :/
    Do you have any idea how to solve this? :/

    Thanks again for your help !
     
  27. _DS_1

    _DS_1

    Joined:
    Sep 6, 2016
    Posts:
    17
    Hi! Would be possible to have support for Swtich/PS5/GameCore for the Input Specialization

     
  28. cagri_unity433

    cagri_unity433

    Joined:
    Mar 30, 2021
    Posts:
    5
    Hello,
    We are trying to add Persian to our supported languages list but we received feedback telling that text is not merged correctly. Below you can find the text that is parsed incorrectly.

    We tried the text with following fonts:
    Mirza-Regular
    Lalezar-Regular

    Correct:
    یا میز

    Wrong:
    ﺰیﻣ ﺎی

    Text in context:
    تلفن خود را روی لبه قفسه یا میز قرار دهید تا در نزدیکی بالای قفسه سینه‌تان قرار بگیرد.

    Thanks in advance.
     
  29. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Can confirm. I also tried my luck with Lalezar and faced similar issues (but for arabic). I thought that the font itself would contain some wrong ligature mappings (or the ligatures were in a format that is not supported by TextMesh Pro). Not sure if it was a TextMesh Pro or I2 Localization problem, though.

    Fortunately, the arabic support has been dropped for that project.
     
  30. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Shouldn't the asset offer the possibility to modify plist localized strings other than
    CFBundleDisplayName ?
     
  31. Kayumus

    Kayumus

    Joined:
    Jul 21, 2020
    Posts:
    15
    upload_2022-4-3_18-26-38.png

    Is it possible to use new I2Languages scriptableObject? My team mate made mess original I2Languages by adding several Terms. We don't have time to organise.
    We want to use new fresh one if it is possible.

    Please let me know if it possible.

    Thank You
     
  32. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    You have two ways to solve this.
    - Select all terms and delete them, and keep working on the same language source.
    or
    - Delete the ScriptableObject and the plugin will automatically create a new one. (If some reason, it doesn't create it or you want more control, you could create it manually by going to a Resource folder and clicking the Create Language Source from the context menu and name it I2Languages)
     
    Kayumus likes this.
  33. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Yes, I have in my list to do some further customizations to the plist for localizing some permissions as well. Will double check what other texts can be localized there and add support for that.
    Thanks for suggesting this!
     
    Kayumus likes this.
  34. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    That looks like some of the ligature combinations are missing or failing.
    I will look into that.
    BTW, just to confirm, the issue you are seeing is just with some words of the text, but the rest of the sentence looks correct, right?
    Another question, does your localized text has rich text tags near those words?
    Also, one great way to test if the font doesn't contain all needed ligature characters, is to replace the font with the "Arial Unicode" and see if the problem persist. I haven't tested the font you mention, but I know for sure that Aria Unicode contains all that is needed.
    Said that, will take a look at that text and verify the Arabic parser!
     
  35. Kayumus

    Kayumus

    Joined:
    Jul 21, 2020
    Posts:
    15
    I am sorry I cannot delete it. Because all terms were used for previous project. Now we are extending this project.
    However, all Terms were created messy before. Using ScriptableObject is quite difficult now because of several not organized Terms.
     
  36. Kayumus

    Kayumus

    Joined:
    Jul 21, 2020
    Posts:
    15
    upload_2022-4-4_10-24-0.png

    upload_2022-4-4_10-24-51.png

    I added CSV file to I2Laguages scriptable object. When I imported, it shows in the Terms section. However, it is not categorized.

    Let me know how to make category for csv sprite sheets please.
    Thank You.
     
  37. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    You create new categories by creating new sheets, below, what you're doing there is to create subcategories
     
    Kayumus likes this.
  38. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Is there a way to have a dropdown in the inspector that list all the Terms ?

    Something like that
    upload_2022-4-4_15-52-53.png
     
  39. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    [SerializeField]
    [TermsPopup("MyCategory/MySubccategory")]
    private string myTerm;
     
    Fangh likes this.
  40. cagri_unity433

    cagri_unity433

    Joined:
    Mar 30, 2021
    Posts:
    5
    In our case we are using Text so I'd think it's l2 problem.
     
  41. bezo0

    bezo0

    Joined:
    Sep 5, 2018
    Posts:
    29
    How in the inspector to see the categories and terms of only a certain source?
    For example, there are 4 sources and each has 10 categories. It is not convenient to use TermPopup. I need to be able to set the source in TermPopup.
     
  42. cagri_unity433

    cagri_unity433

    Joined:
    Mar 30, 2021
    Posts:
    5
    Thank you for the answer.

    Our source says it's mostly wrong but some parts are correct.
    No, it does not contain any rich text tags.
    Tested with Arial unicode but got the same issue.
    I don't know if this info can help, but our source says Arabic text looks correct, so we are having this issue only with Persian/Farsi.
     
  43. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    I also found

    [SerializeField] private LocalizedString myTerm;
     
  44. QuellingBlade

    QuellingBlade

    Joined:
    Jul 15, 2021
    Posts:
    1
    I'm also having some of these problems. When booting with an RTL language the text is not aligned correctly, switching to an LTR language causes it to wrongly align to the right. The suggested fix didn't work for me.

    Not sure if related, but when I change the language to an RTL it only aligns the active objects, which is expected, but it doesn't align objects that are activated and set a term afterward.

    I'm also having problems getting rich tags to work with RTL languages, in my situation I'm using parameters to substitute for tags.
     
    Last edited: Apr 11, 2022
  45. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    We just upgraded to unity 2021.3.0 and whenever we enter the game we get a nullRef inside
    LanguageSourceData.Import_Google_Coroutine

    We tried updating the asset to the last version but the problem continues, we had never this problem before and we have been using this asset since 2019.3

    Any hint of why would be this happening?
    Thanks in advance.

    EDIT:
    by removing playerPrefs the problem seems to be gone, but I wouldn't like to do this to our current users... is there any workaround or any specific playerPrefs that might be causing this and I could reset without bothering our users?

    EDIT2: when entering by second time after reseting the player-refs the error comes back
     
    Last edited: Apr 15, 2022
  46. Centribo

    Centribo

    Joined:
    Nov 3, 2012
    Posts:
    6
    Is there a way to add a new term through code?
    I'm creating a Scriptable Wizard where someone can type a string in English, and I was hoping that I could add a new term based on that string. I was hoping for something like:
    I2.Loc.LocalizationManager.AddNewTerm("EN",  "Here is a new term that needs to be translated");
     
  47. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Code (CSharp):
    1. LanguageSourceData source = LocalizationManager.Sources[0];
    2. source.AddTerm("TermName" , eTermType.Text, false);
    3. source.UpdateDictionary(true);
     
  48. Centribo

    Centribo

    Joined:
    Nov 3, 2012
    Posts:
    6
    This worked perfectly for me, thanks!
    For anyone else looking this up, you can also set the translation like so:

    Code (CSharp):
    1. LanguageSourceData source = LocalizationManager.Sources[0];
    2. TermData term = source.AddTerm("Term name", eTermType.Text, false);
    3. int engIndex = 0;
    4. for (int i = 0; i < source.mLanguages.Count; i++) {
    5.     if (source.mLanguages[i].Name == "English" || source.mLanguages[i].Code == "en") {
    6.         engIndex = i;
    7.     }
    8. }
    9. term.SetTranslation(engIndex, "This is the English translation.");
    10. source.UpdateDictionary(true);
     
  49. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    Hey @Inter-Illusion the asset has an unfixed bug for months and your forum is down for days now. Are you alive?
     
  50. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Thanks for letting me know about this.
    I just uploaded v2.8.20 to the AssetStore that fixes the null exception when running in 2021.3.