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. justinpatterson

    justinpatterson

    Joined:
    Aug 14, 2012
    Posts:
    4
    Well this was a fun adventure. For those who benefit, the issue had to do with Preserved Attributes.

    After a couple all-nighters, my suspicions were correct, regarding there being problems with how initialization on Localizes were happening!
    In fact, this was discovered it once before as well: http://inter-illusion.com/forum/i2-localization/1044-objects-not-localizing-in-unity-2018-1-beta

    My quick fix was to replace all [I2RuntimeInitialize] to [RuntimeInitializeOnLoadMethod] - I'm not sure why my version doesn't have the fixes that were apparently implemented in past updates, and I don't want to go crazy with re-doing all the plugin work because it would get pretty invasive. It seems to work and we got to where I need to be.
     
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    Hi, is there a way to set the inner area to be less tall? Specifically, I don't want the outer scroll bar to appear. For example if I press + and add a new term, the inner scrollbar snaps up to the correct place where I can configure them (nice) but additionally I have to scroll the outer scrollbar up to since + wasn't visible without scrolling the outer scrollbar down.

    Screenshot 2019-05-31 17.09.22.png

    As a side note in 2019.3 GUIText is finally gone, you might want to put some #if !UNITY_2019_3_OR_NEWER around these files

    Screenshot 2019-05-31 22.25.17.png

    And GUITexture file too.
     
    Last edited: May 31, 2019
    Mirgan and SugoiDev like this.
  3. lemon-tree

    lemon-tree

    Joined:
    Nov 11, 2013
    Posts:
    80
    Hi, I'm getting the following error:

    The offending lines in I2Languages.asset look like this:

    I think it's the line break that's causing the problem, but I don't know how the line break got there. If I remove the line break by editing the asset in a text editor then the problem goes away, but something seems to be re-introducing it occasionally and I have to edit the file again. Any idea why this is happening?
     
  4. Bric

    Bric

    Joined:
    Oct 29, 2012
    Posts:
    15
    Every time I update new value of key into the sheet and release the app into play store. Why do I always got the content still the old value of key? I need clean the cache data of app, then can get the updated value of key.
     
  5. helly

    helly

    Joined:
    Apr 30, 2013
    Posts:
    1
    Hello!

    Want to share two observations on post-processing in Android (using v 2.8.12 f1 of the plugin in Unity 2017.4).

    1) The first one is tied to the fact that PostProcessAndroid (of PostProcessBuild_ANDROID.cs) can only be executed when the first scene in the build is processed.

    I have 5 scenes in Build Settings, and first 4 of them are disabled (temporarily for testing purposes). The last scene on the list is enabled, and that is my initial scene. SceneManager.GetActiveScene().buildIndex is playing tricks on me — it returns correct index for the scene in the runtime (0), but when building process is initiated it returns 4 for the same scene. So I'm not getting that sweet app name localization, because PostProcessAndroid is never called. Moving scene to the top of the list fixes the issue, however, it's not the most convenient thing to do in my current scenario.

    2) This one is about default string.xml.

    I have app name localization set in place, and it works well for all the locale-specific resource folders in the build. But default res/values/strings.xml file ends up containing value from Product name field in PlayerSettings, rather than app name from the first localization in the I2 source, which I expect to see.

    Wonder, have anybody else stumbled upon these?
     
    5argon likes this.
  6. Mirgan

    Mirgan

    Joined:
    Feb 2, 2016
    Posts:
    24
  7. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    8
    Hey All:

    After recently updating to the latest version of the asset (I may have missed an interim version or two) I noticed that it changed some of the KEY names in the I2Languages asset, but did not change them in the Localize components that reference them. Thus, my terms are now disconnected from the keys.

    I believe this is caused by the plugin stripping control codes "<>" that were in KEY names. Yes, I know this is ugly and we shouldn't have done that, but expediency was the name of the game at the time, and the auto-generated keys from previous version of the plugin included those control codes.

    Any thoughts here? I have many hundreds to deal with and will likely just revert the plugin if there isn't a clever solution.
     
  8. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    To confirm you should commit on Git and once upgraded, see exactly what changed in the diff.

    How about upload the terms to Google sheet and then do a download replace once upgraded? Maybe it would preserve the character or you could edit characters from Google sheet before downloading back.

    If mass-edit of all components of all scenes is required, an asset Maintainer maybe your final straw. You could right click the Localize script file and have it find all references in the project.
     
  9. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    8
    Thanks. Already did the diff. It does appear that at some point, the package strips out certain characters/sequences from the the term's KEY strings from the I2Languages.prefab upon save.

    I'm resorting to doing a text search across all my scene files for "mTerm:" and trying to spot which key strings are likely now illegal and just manually change them to what I2 would have stripped them down to.
     
    Last edited: Jun 12, 2019
  10. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    The core problem maybe that the author moved to ScriptableObject (I2Language.asset) storage quite some time ago. Now that you migrate the terms you better ensure you use it instead of .prefab storage. Prefab change structure more often between versions than ScriptableObject and maybe that cause the problem.
     
  11. eVPublishing

    eVPublishing

    Joined:
    Oct 25, 2016
    Posts:
    8
    For what it's worth, I have a solution for my problem. There are several issues:
    1. Newer versions of i2 "clean" tags and non ASCII characters from the term keys in the dictionary, but do not clean them from the term key found in the Localize component prior to the search.
    2. The current version of GetValidTerm() will leave a space at the end of the term key string if the last character was stripped off due to being 'illegal' - either a tag or a non ASCII. For example "MyTerm%" will become "MyTerm " which will then not match with the terms in the dictionary.
    A hack for this is to add:
    Code (CSharp):
    1. term = I2Utils.GetValidTermName(term, true);
    2. term = term.Trim();
    In LanguageSourceData.GetTermData();
     
  12. ASIM-SENYUVA

    ASIM-SENYUVA

    Joined:
    Apr 29, 2013
    Posts:
    38
    We use your asses during many year. Its always works well. We updated our code to Unity3d 2019 and Our asset version is 2.8.1 f1.
    The translation is good at Editor time. but i build time the translation is not working. I found missing when i trace your code.

    at the below code block...
    Code (CSharp):
    1.     public void OnLocalize( bool Force = false )
    2.         {
    3.             if (!Force && (!enabled || gameObject==null || !gameObject.activeInHierarchy))
    4.                 return;
    5.  
    6.             if (string.IsNullOrEmpty(LocalizationManager.CurrentLanguage))
    7.                 return;
    8.  
    9.             if (!AlwaysForceLocalize && !Force && !LocalizeCallBack.HasCallback() && LastLocalizedLanguage==LocalizationManager.CurrentLanguage)
    10.                 return;
    11.             LastLocalizedLanguage = LocalizationManager.CurrentLanguage;
    12.  
    13.             if (!HasTargetCache() && !FindTarget())
    14.                 return;
    inside the HasTargetCache , mLocalizeTarget is always null, because of this translation not working. how can you help us. I think problems comes new prefab system.
     
  13. ASIM-SENYUVA

    ASIM-SENYUVA

    Joined:
    Apr 29, 2013
    Posts:
    38
    Its look working when i update. I solved thx.
     
  14. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    234

    I just created a thread about this: https://forum.unity.com/threads/cas...ween-key-and-value-within-in-2019-3-0.695074/

    I also submitted a bug report, since I have this issue showing with other stuff too.
     
    lemon-tree likes this.
  15. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    262
    Hi there! I deleted TMP asset and now got many errors like "The type or namespace name `TMPro' could not be found. Are you missing an assembly reference?" in LocalizeDropdown.cs
     
  16. harryr

    harryr

    Unity Technologies

    Joined:
    Nov 14, 2017
    Posts:
    22
    Hi there!
    This issue should be fixed up in 2019.3a6, please let me know if you're still having issues after giving alpha 6 a go :)
     
    lemon-tree and SugoiDev like this.
  17. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    262
    Hi there! After export some already filled fields empty again, so i need import and translate them again.
     
  18. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    196
    Hi guys, I have what might be a bug on Unity 2018.3.12f1 with I2 Localization 2.8.9f1

    I'm setting a translation for some term to this text: "press \uf30a for rewind, and \uf30b for fast-forward."

    The idea is that then I use this in script for a TextMeshProUGUI text, in this way:

    myTMPtext.text = ScriptLocalization.UITerms.MyTerm

    and then I have set up a SDF font with FontAwesome unicode icons as a fallback for my main font, so everytime I use unicode characters they are parsed and shown as icons in the UI.

    but the problem is that TMP is getting a text with this content: "press \\uf30a for rewind, and \\uf30b for fast-forward."

    so apparently I2 is doubling backslashes, not sure why, but this results in TMP displaying the literal string with the unicode, instead of the icons.

    if I do this:

    myTMPtext.text = "press \uf30a for rewind, and \uf30b for fast-forward."

    then everything works fine, so in theory i2 should be returning exactly that string content and not trying to add backslashes to what is already a text intended to use as literal.

    any suggestions? is this a bug or is intended behaviour?
     
  19. Lyde

    Lyde

    Joined:
    Jul 1, 2019
    Posts:
    2
    Hey,

    We recently ran into an issue where the localization plugin is unable to provide translations for a specific language (Turkish) on iOS.

    Peculiar thing is that only some of the translations are not fetched correctly (data caching issue?) but also the start up language seems to contribute to the problem as in, if the device language is set to English and then the localization changes to Turkish the problem doesn't appear but if the device language is set to Turkish the problem appears.

    iOS seems to have some "problems" reporting languages on certain versions, unsure if related.
    https://forums.developer.apple.com/thread/105395
    https://forums.developer.apple.com/message/295168#295168

    Unity Version: 2018.4.2f1
    I2Languages Version: 2.8.11 f1
    iOS Version: 11.4+

    We've had similar problems in the past where the localization data would not update correctly on some devices even though the data is updated correctly, but we're unsure that this is the case at the moment.

    Any help would be highly appreciated, thanks.
     
  20. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    463
    I2 Localization follows the same standard that Unity set for UGUI texts,
    anything that you place in the inspectors its displayed as-is and not parsed.
    So, if you put "\uf30a" the plugin things thats exactly what you want to show, so it doesn't convert the text.
    A similar behaviour happens if you type that in the Unity UI Text inspector.

    So, to get the \uf30a converted to unicode, you should paste the correct character (not its code) in the term inspector or the spreadsheet.

    Said that, TextMeshPro changed the default unity behaviour and its actually parsing the text and doing the conversion.
    It maybe a good idea to add a setting for either setting the text as as-is or replacing the unicode texts.
    I will add that to my todo list!


    That sounds like a Google Live Synchronization issue.
    These may help:
    https://forum.unity.com/threads/i2-...olution-for-unity.231226/page-12#post-3744691
    http://inter-illusion.com/forum/i2-localization/1146-strange-behavior-translation-missing-on-device#3151
    http://inter-illusion.com/forum/i2-localization/1250-possible-cache-bug#3411

    Basically, if you have are linked to a Google Spreadsheet, and the editor and the spreadsheet are not up-to-date, then one can be overriding the other and so you end up with old or missing texts/languages.
    Follow the steps listed there to fix that issue,
    and if that doesn't solve it, try setting the update frequency to NEVER and reinstalling the game in the device to be sure the error is not caused by that.

    Hope that helps,
    Frank
     
    Cleverlie likes this.
  21. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39
    Hi there, we recently u
    We did a clean reinstall and have the latest version.
    We found an other problem, we are using a CSV file for the translation, that we load at runtime (it changes depending on context).

    Every text that has a comma in them gets wrapped in double quotes (example : "I have a comma, in my text").
    When using
    Code (CSharp):
    1. LocalizationManager.GetTranslation
    these text are wrapped with the double quotes in the returned string. (it returns "/"I have a comma, in my text/"").

    This does not happen using the Localize component, just the GetTranslation method.

    EDIT : We found the culprit, its the ImportCSV method. We also found a weird hack to fix it :
    Code (CSharp):
    1. LocalizationManager.Sources.FirstOrDefault()?.Import_CSV("", loadedObject.text, eSpreadsheetUpdateMode.Replace, Convert.ToChar(9));
    Basically, Convert.ToChar(9) should mean the separator is a tab, which is not the case, we are using a CSV but that fixes it (default was a comma, as would be expected.)

    Since the fix is quite ugly, could you notify me if you introduce a proper fix in a future release.
    Thanks
     
    Last edited: Jul 4, 2019
  22. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    196

    Hi, yes I finally figured out that pasting the actual character from the fontawesome cheatsheet worked, with the only inconvenience that these characters are invisible in the inspector so handling of these terms can become a bit complicated for translators that don't know of the existence of the fontawesome characters.

    it would be nice to add a toggle to fix this either on textMeshPro or in I2, I think is better or safer to do it in the I2 side, since you never know if the term will be used in the context of a UGUI text or TMP text, and I use rich text tags and unicode hexacodes a lot, maybe my use case is not so popular but a toggle wouldn't hurt anyone else I guess.

    thanks for the answer!
     
  23. Lyde

    Lyde

    Joined:
    Jul 1, 2019
    Posts:
    2
    Thank you! I will check the links provided.

    I've already tried setting the update frequency to never and reinstalling but the problem still persisted.

    EDIT:
    Still unable to resolve the issue, tried setting the update frequency to NEVER (again) and also set the Unload Languages at Runtime to NEVER. (re-installing app didn't help).
    Additionally tried creating a new version of the localization sheet but the issue still remained.

    Potential workaround from our QA was to set the Default Language to something else than the Device Language (e.g. English) and the translations would work.

    QA:
    "Turkish being disabled in the plugin causes interesting outcomes:
    On editor Turkish was not available, on Android was not available. But on iOS you can still change to Turkish -> but it's not bugged anymore (as the game starts in English)"

    Our implementation uses the "LocalizationManager.GetAllLanguages()" to determine which languages are in use.
    Maybe the asset is broken, but then again the language removal was detected.

    EDIT:
    Found out the problem, wasn't in the plugin but in the automatic forming of the keys in our project which was different in turkish with some iOS versions due to various reasons with language related settings.

    Thanks for help! The plugin is great, been using it for a long time :)
     
    Last edited: Jul 8, 2019
  24. utkarshdwivedi3997

    utkarshdwivedi3997

    Joined:
    Aug 11, 2017
    Posts:
    17
    Hi, is there support for changing the text and font of Dropdowns during runtime? I populate my dropdowns' options through code, so is there a way to also localize these options?
     
  25. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    263
    @Inter-Illusion Hi, is it possible to localize the Camera Usage Description in Player Settings?
     
  26. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    141
    Hey folks. I'm getting a 'missing translation' only in standalone Windows64 builds (works fine in Editor). Seems to be similar to what other people are reporting here. Any help would be appreciated.

    nextLevelString = I2.Loc.LocalizationManager.GetTranslation(nextLevel_LocKey) + ": " + killsRemaining.ToString();


    This should show something like:
    To Next: 10
    to indicate how many kills the player needs to make to get to the next level.

    As I say, works fine in editor. When I try to run a build the translated part of the string gives the "missing translation" error text, then the concatenated parts are appended.

    Using:
    Unity version 2019.1.12f1
    I2 Loc version 2.8.12f1
     
  27. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    463
    Hi, There are several setup issues that could lead to that.
    The most common case is a problem with the Google Live Synchronization. Manly when using Google Spreadsheets, but then forgetting to update them with the changes in the editor.

    Basically, during the editor play, the plugin uses the data in the editor, but once you create a build, the plugin checks if the spreadsheets has different data and thinks you have make changes there, so it downloads it and uses that instead.

    When the "Update Frequency" is set to anything other than NEVER in the Google Spreadsheet Tab, the plugin automatically checks the Spreadsheet at runtime to see if its different from the LanguageSource Data. If its different, then it downloads the spreadsheet in the device and uses that data instead of the one from the LanguageSource.

    That allows you to change translations without having to do a build, and have all your players automatically download the new translations.
    However, you have to be careful while developing. If you add terms to your LanguageSource or change translations, then you have to Export that data to the Spreadsheet, otherwise, the plugin will see the spreadsheet as out of sync and try downloading it.

    Most likely you are also getting a warning in the console showing that the Spreadsheet is out of sync and need to be synchronized.

    To solve the issue:
    - Export your I2Languages.prefab to Google.
    - (optional) Delete the PlayerPrefs data
    - Build and deploy the game again

    It should work as expected.

    Alternatively, you can set the Google Update Frequency to NEVER to skip the Google Live Synchronization feature.
     
  28. mathias_unity633

    mathias_unity633

    Joined:
    Jul 17, 2018
    Posts:
    34
    Hi. What's the setup for auto-updating?
    I have a Language Source in my scene, it's supposed to fetch from a google sheet. Fetching in the editor (not while playing) works, but setting it to auto-fetch in the editor gives this:

    Code (CSharp):
    1. MissingReferenceException: The object of type 'LanguageSource' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3. UnityEngine.Object.get_name () (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:198)
    4. I2.Loc.LanguageSourceData.GetSourcePlayerPrefName () (at Assets/Third Party/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:151)
    5. I2.Loc.LanguageSourceData.Import_Google (System.Boolean ForceUpdate, System.Boolean justCheck) (at Assets/Third Party/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs:107)
    6. I2.Loc.LocalizationManager+<Delayed_Import_Google>d__60.MoveNext () (at Assets/Third Party/I2/Localization/Scripts/Manager/LocalizationManager_Sources.cs:103)
    7. I2.Loc.CoroutineManager+<>c__DisplayClass4_1.<Start>b__0 () (at Assets/Third Party/I2/Localization/Scripts/Utils/CoroutineManager.cs:41)
    8. UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:200)
    It doesn't auto-update on the device either.

    The line referred to is the last one here:

    Code (CSharp):
    1. if (owner == null)
    2.     return null;
    3. string sourceName = (owner as UnityEngine.Object).name;
    Thanks in advance.
     
  29. Anemor2000

    Anemor2000

    Joined:
    Jun 12, 2015
    Posts:
    39

    Can you please answer this.
    It's a serious bug in the plugin and the fix I found has some other issues.
     
  30. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    262
    Would be nice if you add a www.deepl.com support for translation.
     
  31. CHOO5D2

    CHOO5D2

    Joined:
    Jan 3, 2019
    Posts:
    6
    Hi, just a question.

    So if i am using i2, does this means that the game needs to have a internet connection in order to display the texts? if players were to play offline, this will not work?
     
  32. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    262
    Hi there! How to get secondary translaed object? I mean TMP font.
     
  33. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    463
    I wasn't aware of that translation site, will investigate and get back to you. Thanks for the suggestion!

    I2 Localization stores all data in the build, so, it can work offline without problems.
    Said that, if you have internet connection and setup Google Live Synchronization, then the plugin is able to automatically download any changes you made to spreadsheet. But that is optional.

    You can use the following code:
    Code (csharp):
    1.  
    2.     var font = LocalizationManager.GetTranslatedObject<TMP_FontAsset>("Font _Term_Name");
    3.  
    Hope that helps,
    Frank