Search Unity

  1. Unity 2019.2 is now released.
    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. 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,306
    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:
    81
    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:
    10
    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,306
    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:
    10
    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,306
    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:
    10
    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:
    270

    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:
    324
    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:
    26
    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:
    324
    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:
    205
    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:
    472
    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:
    205

    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:
    274
    @Inter-Illusion Hi, is it possible to localize the Camera Usage Description in Player Settings?
     
  26. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    153
    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:
    472
    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:
    35
    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:
    324
    Would be nice if you add a www.deepl.com support for translation.
     
  31. CHOO5D2

    CHOO5D2

    Joined:
    Jan 3, 2019
    Posts:
    9
    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:
    324
    Hi there! How to get secondary translaed object? I mean TMP font.
     
  33. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    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
     
    justtime likes this.
  34. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    324
    Please, fix issues on 2019.3
     
  35. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    Hi,
    Yesterday I uploaded I2 Localization 2.8.13f1 to the AssetStore.
    It can also be downloaded right now from the Beta folder.

    Hope that helps,
    Frank
     
  36. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    324
    Hi there! How to set TMP font for secondary term? I want to download it via asset bundles and then setup in i2.
     
  37. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    Here is how to setup AssetBundles with I2 Localization:
    http://inter-illusion.com/assets/I2LocalizationManual/HowtouseAssetBundles.html

    It is very generic as it was designed on the time where Addressables wasn't a "thing" yet and every one was managing their bundles using their own custom codes.
    But it allows dealing with both Addressables and regular AssetBundles.

    Now that Addressables is used to "standarize" downloading and using bundles, I will add to my todo, creating a default AssetBundleManager that do the loading from the Addressable directly. But again, it shoudn't be too hard to set it up your self in the mean time.

    Hope that helps,
    Frank
     
  38. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    324
    Thanks. But how to set TMP font for secondary term? I want do change it at runtime.

    BTW, could you clarify how to use asset bundles? I made same code from manual, download bundle, but i don't know how to assign asset to secondary term, because it remains null in term inspector. It's very uncomfortable to use loading asset bundles in this method (coroutines and return). I just want to download them be my own WHEN i want, and then assign them to secondary term.
     
    Last edited: Oct 2, 2019
  39. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    You just need to create a Term for that font, and assing the names of the fonts.
    When the plugin needs to set the font, it will get the TermData associated with that term, get the "name" of the font for that language, and try to load it from Referenced assests first, then, from AssetBundles first, and finally from Resources folder.

    If you want to change the font name at runtime, you can do something like:
    Code (csharp):
    1.  
    2.     TermData termData = LocalizationManager.GetTermData("TermName");
    3.     termName.Languages[0] = "ARIAL";
    4.     termName.Languages[1] = "ChineseFont";
    5.  
    Hope that helps,
    Frank
     
  40. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    324
    Thanks.
    1)But i want to change TMP font asset (.sdf file) for term with type "Text Mesh P Font". Does it possible in a straightforward way, not using catch method?
    2)Can i force LoadFromBundle()? My use case. 1)Load bundles 2) Call this one.
    But at this moment when i load bundles it's not calling anymore. Only when i click on term in Editor. But i have to do it at runtime.
    3)And, how to force TMP to reload fonts? I mean force all Localize components reload TMP assets accordingly to secondary term(because it uses fallback before loading actual font asset from bundle). Thanks.
     
    Last edited: Oct 3, 2019
  41. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    329
    Hello,

    Asset right now requires 2018.4.9 or higher. Was this a mistake or intentional?
     
  42. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    Mistake, it runs fine in 5.4 as before.
    I will resubmit it with the correct version.

    Thanksf or letting me know!
     
  43. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    324
    Hi there! May be i should be more clear in my question?
    My use case
    1)Download asset bundles with sdf font assets.
    2)Handle LoadFromBundle hook from your manual

    But at this moment every object with TMP has fallback font installed already. How can i force Localize component on every TMP object in scene to re-apply secondary term (if i do it manually in Editor, it works well)?
    May be i could get Localize[] somewhere from inner cache?
    Currently, i'am doing this
    Code (CSharp):
    1. Localize[] locObjects = Resources.FindObjectsOfTypeAll(typeof(Localize)) as Localize[];
    2. foreach (var locObj in locObjects)
    3. {
    4.     locObj.SecondaryTerm = locObj.SecondaryTerm;
    5. }
     
    Last edited: Oct 6, 2019
  44. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    321
    Hello I'm trying just to get proper object for proper language version from I2 , it should be standard behaviour but there is nothing about api of this on documentation, is there any bigger api documentation avaliable?

    I'm using var lipSyncDataFileTemp = LocalizationManager.GetTranslatedObject<LipSyncData>(key);

    to get LipSyncData asset from Language sources file but it always return null Why?
     
  45. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    81
    Hi,
    I just upgraded my project to Unity 2013.0b6, and i'm getting these erros :

    Code (CSharp):
    1. Assets\I2\Localization\Scripts\Targets\LocalizeTarget_UnityStandard_GUITexture.cs(9,75): error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.'
    2.  
    3. Assets\I2\Localization\Scripts\Targets\LocalizeTarget_UnityStandard_GUIText.cs(9,72): error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
    4.  
    5. Assets\I2\Localization\Scripts\Targets\LocalizeTarget_UnityStandard_GUIText.cs(9,18): error CS0311: The type 'UnityEngine.GUIText' cannot be used as type parameter 'T' in the generic type or method 'LocalizeTarget<T>'. There is no implicit reference conversion from 'UnityEngine.GUIText' to 'UnityEngine.Object'.
    6.  
    7. Assets\I2\Localization\Scripts\Targets\LocalizeTarget_UnityStandard_GUITexture.cs(9,18): error CS0311: The type 'UnityEngine.GUITexture' cannot be used as type parameter 'T' in the generic type or method 'LocalizeTarget<T>'. There is no implicit reference conversion from 'UnityEngine.GUITexture' to 'UnityEngine.Object'.
    Any help please ?
     
  46. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    Hi,

    Update to the latest I2 Localization. Last week I submitted a fix for those.

    There are two ways to access the translated objects:
    using
    Code (csharp):
    1.  
    2. LocalizationManager.GetTranslatedObject<LipSyncData>(objectName);
    3.  
    or
    Code (csharp):
    1.  
    2. LocalizationManager.GetTranslatedObjectByTermName<LipSyncData>(key);
    3.  
    With GetTranslatedObject you need to know the object name and the function will get it from the Resources/ReferencedAssets/AssetsTab, etc
    If instead you have the term name and want to get its value to the current language, then use the GetTranslatedObjectByTermName

    Also, notice that if the asset is not in LanguageSource Assets Tab (i.e. its not a global asset), then LocalizationManager.GetTranslatedXXX will not be able to find it.
    If its a Local Assets (i.e. was added to the Localize Component Referenced Assets section), then you need to use the GetTranslateXXXX and pass the Localize Component as a parameter.

    See more about the Local and Global Assets here:
    http://inter-illusion.com/assets/I2LocalizationManual/AssetsTab.html

    You can do:
    Code (csharp):
    1.  
    2. LocalizationManager.LocalizeAll(true);
    3.  
    Hope that helps,
    Frank
     
    justtime likes this.
  47. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    321
    I'm using Language Source per scene with audio clip. Will audio clip be unloaded when changing languge? I just dont want to have every language version audio clips loaded all the time

    Also I have voicovers only in 2 languages, and texts in 10 so how could I make an option for player to be able to set individually voicovers language and separateley text ? :) For example if player want to have Example if player want to have English Voicovers and Deutch text etc. ?

    I
     
    Last edited: Oct 11, 2019
  48. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    659
    Thinking on buying the asset but one question first: does the language change when detecting the gamer language (fi on Android/IOs)? Or is there always a need for the gamer to set his language explicit?
     
  49. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    472
    The first time the game runs, the plugin auto detect the device language.
    Then, if the player changes the language manually from your UI, that selection is remembered and used instead.

    Here you can find more details
    http://inter-illusion.com/assets/I2LocalizationManual/InitialLanguage.html


    AudioClip, sprites, fonts, etc are unloaded automatically if they are set to be loaded from the Resources folder or from AssetBundles. In that case, the plugin will load them when needed and unload them if you change languages.
    If instead, you set them as References, unity will keep all or part of it in memory (depending on the asset type and settings, for instance, streamed audio clips).

    Here you can find information about how to setup objects as references or loaded from resources, bundles:
    http://inter-illusion.com/assets/I2LocalizationManual/AssetsTab.html

    The plugin doesn't support multiple languages at the same time.
    BUT, it support fallbacks.
    The current implementation fallback to the base language, and if not found, then fallback to the first language in the languages list that has a translation.
    e.g. "es-MX" fallback to "es" which fallback to "en" if not found.

    Hope that helps,
    Frank
     
  50. Texashawk

    Texashawk

    Joined:
    Mar 19, 2013
    Posts:
    33
    I have what seems to be a simple question - is there a way to check the keys that are present in a project? Basically, I'm reading a lot of text from XML and .txt files so I have to add them all manually as unique keys with the item ID and name as a way for the script to 'read' the proper key to localize.

    My question is since the program causes an error if there is no localization key, and the sheer amount of text to localize means it will take many months and I will need to add piecemeal, means I want to make a check that a key exists before I send a localization request. Basically:
    Code (CSharp):
    1. //pseudocode
    2.  
    3. if (originalString.Key Exists)
    4. {
    5.      localizedText = TextLocalizer.SetTerm(Key); // set term and pull correct string if key exists
    6. }
    7. else
    8.      localizedText = originalString; // bypass if no key
    Am I missing something very simple, or is there a better way to do this? Many thanks in advance!

    -Steve