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

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    @Inter-Illusion Quick question, how do you completely remove a "Category"?
     
  2. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Terms with categories, are just terms whose name follow the patter: "Category/TermName". If you remove all those terms, then the category is removed.
    The easiest way to do it is to open the language source's terms list filter by that category, click "select all" and then remove all terms. That deletes all the selected terms, and the category will be deleted.

    If instead, you want to keep the terms, but remove the category part, you will need to click change category or rename. That opens one of the tools that allow you selecting a different category or empty and make the replace.

    Hope that helps
    Frank
     
  3. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    Can you give me a bit more of context about this. From the screenshot I don't see anything related directly to I2 Localization.
    Can you please let me know:

    What unity version are you using? what I2 Localization version?

    Did you tried removing I2 Localization and check that it builds, and then installed I2L and it fails? (to rule out that something else is the issue)

    Can you clear the console before building (to remove previous msgs) and make a build. Then send me the editor.log file so that I can get more details and get a clue of whats the conflict.

    Can you click the console error with the URi.Parse and send me the screenshot of the callstack. I want to see if that's caused by anything in I2Localization.

    Have you tried building I2L in an empty project?

    I really want to help, but without more info, there isn't much I can do, sorry.
     
  4. ahmed_decoy

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    I figured it structured to work in that way, but I'm looking for a solution that's a little more low level because I got one of my categories in a bad state by accident. I wanted to localize a term "Damu Caps +/-". Didn't realize until I hit submit that this was going to be a silly mistake and will actually make the category "Damu Caps +" with a term "-". And now I'm assuming since the term is not even a character in the alphabet, the editor view doesn't like it, and it doesn't show up, so I cant delete the term in the traditional sense. Any ideas for a workaround?

    upload_2017-10-29_4-23-49.png
     
  5. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Haha, thats a nice edge case!! I will make a fix for that.

    In the meantime, you can export to Google Spreadsheet or local CSV, delete the row & sheet, and Import/Replace back.
     
  6. ahmed_decoy

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    Thanks!
     
  7. pdyxs

    pdyxs

    Joined:
    Sep 7, 2012
    Posts:
    6
    Hi,

    Just starting to use I2Localization, and so far it's pretty fantastic.

    I've got a couple of small queries:

    When you add a Localize component to a GameObject, you get a much more comprehensive editor for a localized string, including the ability to create/edit the translations from the inspector and a link back to the source. It'd be great if I could add that editor to a LocalizedString.

    Secondly, I'm working on a project that is going to require more complex text replacement functions, such as being able to repeat a string a number of times based on a variable. I can handle the regex for all of that, but was just wondering if you had a suggestion for implementing this in the localization pipeline (ideally text goes through a function I specify after being localized).
     
  8. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Unfortunately, that's not possible with the current implementation. The inspector for the term translation relies on the GUILayout class to handle all the positions/sizes, but the LocalizeString inspector is a PropertyDrawer so that you could use it inside your own scripts.
    A problem with PropertyDrawers, is that they don't work well with GUILayout, and instead all the editor should be moved to GUI with explicit positions. That's too big of a change for the moment. Sorry!

    Said that, I made a change to the LocalizedString inspector to add a button that when clicked, it will switch to the LanguageSource and select the term so that you can edit it. That should make modifying the term translation easier. This change is now on 2.8.1a7

    You can use Callbacks.
    http://inter-illusion.com/assets/I2LocalizationManual/Callbacks.html

    They are essentially that, functions that you can register and whenever a change happens (change language, texts enabled, etc) the function is called right before sending the text to the UI.
    The example in the documentation shows how to replace a part of the translation with some gameplay value.

    Hope that helps,
    Frank
     
  9. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Hey,
    I have started integrating i2 Localization in my game and I have a few questions and feature requests:

    1. Although I downloaded the latest version from the Unity Asset Store (v2.8.0 f3), for some reason I can't access I2.Loc.ScriptLocalization to get a translation from the code for the current language (as mentioned here: http://inter-illusion.com/assets/I2LocalizationManual/Howtoaccesslocalization.html). Is there any other way I can access the translations from the code?
      Found it: I2.Loc.LocalizationManager.GetTranslation("my term");

    2. Hovering over [Zero], [One], [Two] etc.. in the Language Source inspector says that these are features for version 3, but according to the docs they should already be there? http://inter-illusion.com/assets/I2LocalizationManual/Plurals.html

    3. Would it be possible to expose a setting to toggle changing startup language (LocalizationManager.SelectStartupLanguage())? This is because I do not want this to happen in my game, and the only way to disable it is by commenting the call to SelectStartupLanguage in LocalizationManager.cs. Also, are there any side effects to commenting the call to the SelectStartupLanguage() in LocalizationManager.InitializeIfNeeded?

    4. Is it best practice to work on the prefab directly from the i2/Resources folder? When the plugin is updated, will this prefab be changed?

    5. It would be great if the Categories filter (Nothing, Everything, Default etc...) would save its preference, because currently every time I add a new term or do any other action after changing the filter, it would reset back to showing all of the terms in the game, and since I have a lot of terms, it's making it very hard and taking quite some time when adding new terms.

    6. Is there an event I can hook to that's called whenever the language in the game changes?
      Found it: I2.Loc.LocalizationManager.OnLocalizeEvent

    7. Is there a way I can prevent the usage of the localization system in certain scenes? This is because I do not want the system to run in my Server scene.
    All in all, the plugin has been working great so far. Thank you very much for your work.
    // Dreas.
     
    Last edited: Nov 3, 2017
  10. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    In v2.8.0 I made the ScriptLocalization file to not be auto-generated. Instead, it is only generated if the developers uses the Bake Script.
    http://inter-illusion.com/assets/I2LocalizationManual/BakingTermsintoScriptsforsaverac.html

    That removes the need for checking all the time if that file exists, so the compile time is faster.
    I'm updating the documentation to reflect that the recommended method now is LocalizationManager.GetTranslation(xx).

    Plurals was introduced a couple weeks ago, and its still in beta. Its not in 2.8.0 (the version in the assetstore).
    Its in 2.8.1 which can be downloaded from the beta folder.

    I see that's something that could be useful in several situations, so I went ahead an implemented a way to handle this.
    In the LanguageSource (languages tab) there is now an option to select what language should be used by default (the device language or using the order in the list of languages).
    upload_2017-11-3_11-0-53.png
    You can get this by downloaded v2.8.1a7

    The plugin doesn't include the I2Languages.prefab, so that doesn't get overridden. What happens internally, is that the first time you install I2Localization, if I2Languages.prefab is not found, then it creates an empty I2Languages.prefab automatically.
    But the next time you upgrade the plugin, it doesn't include that prefab, so its not overridden.
    Said that, I advice you to move the prefab to outside the I2 folder (e.g. Assets/Resources/I2Languages.prefab). That will allow you to make a clean update later on by deleting the entire I2 folder and re-installing I2L. This comes useful if you also have other of my plugins in that folder.

    Agree! I find that useful as well, so I implemented it. (v2.8.1a7).
    I also added another thing that was driving me crazy. Lots of developers where having issues with missing terms, but in fact was that the categories filter was hiding them, but it was hard to notice that the filter was not set to "everything".
    So, I added a way to know that some terms are being filtered out.
    upload_2017-11-3_11-6-46.png

    Now, if the filter is not set to "everything", then 3 dots are shown at the end of the list (...)
    If you click the 3 dots, the filter will be set to everything and all terms are going to be shown.

    If you don't add Localize components to those scenes, the localization will not be ran. The LocalizationManager doesn't run by default, it only executes (sets languages, etc) whenever a Localize component is queries for a translation.
    So, two ways to disable localization:
    1- Don't include Localize components in your Server scenes.
    2- On startup, disable all Localize components

    Code (csharp):
    1.  
    2. void Awake()
    3. {
    4.      foreach (var cmp in GameObject.FindObjectsOfType(typeof(I2.Loc.Localize)) as I2.Loc.Localize[])
    5.          cmp.enabled = false;
    6. }
    7.  

    hope that helps,
    Frank[/quote]
     
  11. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Thank you very much for your fantastic reply and fantastic plugin. Can't get better than this.

    // Dreas.
     
  12. Simon75012

    Simon75012

    Joined:
    Sep 15, 2016
    Posts:
    79
    Hi,
    I use "Auto update frequency" to always "after 5 sec" because i update my content a lot.
    Is there a way to know when the update is over?
    Sometime i load some information just before the update is complete and it may cause some problem.

    Thanks.
     
  13. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    Whenever new localization data is downloaded from Google, the event Event_OnSourceUpdateFromGoogle is called.
    You can use it to find when the update is over.

    Normally, what will happen, is that after the game starts, I2 Localization waits some time to start contacting google (in your case, 5 seconds). This allows the game to start without lags and display something as soon as possible.
    After the 5 seconds, then I2 Localization checks google and starts downloading the data if needed. Once is downloaded, it calls that event.

    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     I2.LocalizationManager.InitializeIfNeeded(); // Makes sure all sources are already referenced
    5.     I2.LocalizationManager.Sources[0].Event_OnSourceUpdateFromGoogle += OnDownloadedNewData;
    6. }
    7.  
    8. void OnDownloadedNewData( LanguageSource source, bool ReceivedNewData, string errorMsg)
    9. {
    10. }
    11.  
    Hope that helps,
    Frank
     
  14. Simon75012

    Simon75012

    Joined:
    Sep 15, 2016
    Posts:
    79
    Great,
    Thanks.
     
  15. sevensails

    sevensails

    Joined:
    Aug 22, 2013
    Posts:
    483
    Hi!

    I'm not able to create Android Builds on 2017.2.0.p2 when my game name contains the ' character. My game name is "Queen's Garden 3: Halloween". If I remove the ' it works.

    Code (csharp):
    1.  
    2. stderr[
    3. res\values-de\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    4.  
    5. res\values-nl\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    6.  
    7. res\values-en\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    8.  
    9. res\values-fr\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    10.  
    11. res\values-es\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    12.  
    13. res\values-it\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    14.  
    15. res\values-pt\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    16.  
    17. res\values-pt-rBR\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    18.  
    19. res\values-en-rUS\strings.xml:3: error: Apostrophe not preceded by \ (in Queen's Garden 3: Halloween )
    20.  
     
  16. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    Same issue here, how to solve this?
    Thanks
     
  17. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
  18. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    Hi Frank, i see a lot of beta/alpha versions, is there a forum thread where you mention what is in each release? this way we will automatically know if something "new" which might help us
     
  19. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    jGate99 and Mauri like this.
  20. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,936
    Hi i have a situation where i dont know the number of characters in a sentence, and i want that sentence to appear in 2 lines (half) based on characters lenght, however challange is that it maintains RTL or cases when a word is produced using connected alphabets (like in arabic). Thanks
     
  21. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    Without being able to modify the UI code (possible in NGUI, but not in Unity UI), I2 localization doesn't have complete control over the line wrapping, given that it happens while the text is been rendered.

    Said that the plugin has a feature to automatically split the RTL lines to some length (while keeping words together). To use it, just set a value in the "Max line Length" field of the Localize component.
    upload_2017-11-28_20-56-11.png

    To find a good value, write a big text in your label and count how many characters fit before wrapping/stretching happens. Then set the max line length to a value a bit smaller.
    At runtime, the plugin will make the translation, split the text to a maximum of that length and apply RTL processing to each line, keeping correct text flow.

    I understand this is not ideal, but there is no other way without creating a new Text component that handles the wrapping and forcing users to use that component instead of the built-in one.
    Another alternative is to use TextMesh Pro to render your texts, it implements a better line wrapping that respects the RTL orientation.

    Hope that helps,
    Frank
     
    jGate99 likes this.
  22. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    251
    Hello
    can i change the localize target in runtime? (with code)
    the panel show different information depending the character position
     
  23. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    When you say you want to change the Target at runtime, are you referring to the Localize target or the Term Target Type?
    From this image, 1 or 2?
    upload_2017-12-2_20-42-57.png

    If its 1, and you want to change the localize component to localize a Text component, then do:
    Code (csharp):
    1.  
    2. I2.Localize cmp = ....;    // your localize component
    3. Text targetText = ...;      // your target text component
    4.  
    5. cmp.mTarget = targetText;
    6. cmp.FindTarget();  // updates the internal structure to use mTarget
    7.  
    If its 2, then get the termData and change its type:
    Code (csharp):
    1.  
    2.             TermData data = LocalizationManager.GetTermData("MyTerm");
    3.             data.TermType = eTermType.Text;
    4.  
    If instead, you want to change the Current Language:
    http://inter-illusion.com/assets/I2LocalizationManual/HowtochangecurrentLanguage.html

    Hope that helps,
    Frank
     
    claudius_I likes this.
  24. Alexey_Ukhov

    Alexey_Ukhov

    Joined:
    Sep 20, 2017
    Posts:
    5
    Hello!
    I have two different project in the same unity project. For switch project I need:

    1 - Change Localization file name.
    2 - Press Import-Replace button.
    3 - Select All terms.
    4 - Press "Build Script with Selected Terms" button.

    How can I change I2Languages parameters and build LocalizationScript from my editor script?
     
  25. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    1- Changing the Localization file name will be pretty straight forward.
    Just use the UnityEngine.AssetDatabase.GetAssetPath of the LocalizationManager.Sources[0]
    Then use the AssetDatabase.RenameAsset

    2-Import-Export to Google is a bit more involved, given that the code was designed to either run inside the LanguageSource inspector, or at runtime.
    But you could always Import/Export to a local CSV file.
    Code (csharp):
    1.  
    2. string CSVstring = source.Export_CSV(null);
    3. System.IO.File.WriteAllText (FileName, CSVstring, System.Text.Encoding.UTF8);
    4. .....
    5. var CSVstring = LocalizationReader.ReadCSVfile (FileName, System.Text.Encoding.UTF8);
    6. LocalizationManager.Sources[0].Import_CSV(null, CSVstring)
    7.  
    3- The code for this tool relies on variables in the LanguageSource inspector. The only way I see for you to automatize this part, will be to duplicate the functions in
    Assets\I2\Localization\Scripts\Editor\Localization\LocalizationEditor_Tools_Script.csinto your own script, and then call
    BuildScriptWithSelectedTerms().

    I will see if in a future release I start making each tool self contained, so that they could be called from outside editor scripts.
    Hope that helps,
    Frank
     
  26. Next2VR

    Next2VR

    Joined:
    Jan 4, 2015
    Posts:
    5
    Hello,


    I tried to reach you by email at inter.illusion [at] gmail.com but i had no answers, is it still the good email ?
     
  27. Alexey_Ukhov

    Alexey_Ukhov

    Joined:
    Sep 20, 2017
    Posts:
    5
    Hi, thanks for advice. I solved this task!
     
  28. Zavhoz

    Zavhoz

    Joined:
    May 26, 2009
    Posts:
    1
    How update I2GoogleWebServiceV4 to I2GoogleWebServiceV5 in my Google Drive?
     
  29. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    http://inter-illusion.com/forum/i2-localization/975-how-update-webservice-v4-to-v5#2640

    Basically, you need to install the latest version of I2 Localization, then click the "Install" button in the Google Spreadsheet section. That will copy I2GoogleWebServiceV5 to your google drive.

    Then, follow the steps listed there to deploy it and authorize it again, and copy the URL to unity.
    Hope that helps,
    Frank
     
  30. cephalo2

    cephalo2

    Joined:
    Feb 25, 2016
    Posts:
    262
    Switching over to I2 from SmartLocalization, and so far everything's going great. Thanks for the great plugin.

    I have one localization issue that I hadn't addressed in my previous version. I have some parameters that I would like to translate. For example, take the following text:

    "Player1 is taking their turn. Please wait."

    I like this because maybe I don't have to have players enter their names, but then I have to translate 'Player1'

    So I understand how to supply direct text to a parameter, such as "Frank" but how to I have translatable parameters?

    I've seen some old examples that suggest:
    ScriptLocalization.Get( Term )

    to translate only text in code, but I can't find 'ScriptLocalization' in the latest version of I2.

    What would be the best way to handle this problem?
     
  31. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    You should use LocalizationManager.GetTranslation(...).

    In one of the latest releases, the ScriptLocalization.cs class is set to only be created if you need to bake terms into scripts using this tool.
    ScriptLocalization.Get(..) was just an alias for LocalizationManager.GetTranslation(...), so its safe to use the newer version.

    If you need to translate Player1 into the current language, you can do it in a few ways:

    - If your player names are static (e.g. Player1, Player2, etc), then you can create Terms for each of them, and then use Parameters or Callbacks to call GetTranslation(...) and return the value:

    Using Parameters:
    Code (csharp):
    1.  
    2. public class MyCustomParameters : RegisterGlobalParameters
    3. {
    4.        // Find the value of Parameters or return null if not found
    5.      public virtual string GetParameterValue( string ParamName )
    6.      {
    7.            if (ParamName == "PLAYER_NAME")
    8.            {
    9.                string PlayerName = LocalizationManager.GetTranslation( "Player1" );
    10.                return PlayerName;
    11.             }
    12.  
    13.            return null; // not found is defined null, not ""
    14.      }
    15. }
    16.  
    Using Callbacks:
    Code (csharp):
    1.  
    2. public void OnModifyLocalization()
    3. {
    4.        // if no MainTranslation then skip (most likely this localize component only changes the font)
    5.        if (string.IsNullOrEmpty(Localize.MainTranslation))
    6.                return;
    7.                        
    8.        // get translation of Player1 into the current language
    9.        string PlayerName = LocalizationManager.GetTranslation( "Player1" );
    10.        
    11.        // set the value in the correct location
    12.        Localize.MainTranslation = Localize.MainTranslation.Replace("Player1", PlayerName);
    13. }
    14.  

    Alternatively, if you the names are not static, and you need to translate them using Google Translation, then you should use the Dynamic Translations
    Code (csharp):
    1.  
    2. string PlayerName = GoogleTranslation.ForceTranslate("Player1", "auto", "es");
    3.  
    Hope that helps,
    Frank
     
    cephalo2 likes this.
  32. DigitalEmotions

    DigitalEmotions

    Joined:
    Feb 18, 2014
    Posts:
    6
    hello guys :)

    I have question ... how localize dropdown ui component ?
     
  33. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Just add a LocalizeDropdown component to it, and select the term for each item.

    In the example scene "I2Localization Unity UI" there is Dropdown that shows how to setup this.

    Hope that helps,
    Frank
     
  34. DigitalEmotions

    DigitalEmotions

    Joined:
    Feb 18, 2014
    Posts:
    6
    Hello ! thank you for your help :) this is what I need ... another thing is how to localize labels updated from script ?

    best regards and Happy New Year ! :)
     
  35. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Hi, I'm having trouble translating to Arabic, I created the font asset with the google noto arabic font, which works well with the text component, but when I use it with textmesh pro, the letters are changed with white squares. I discovered that if in the Arabic translation I put a blank space between each letter, the textmeshpro manages to render.
    Thanks.



     
    Last edited: Dec 30, 2017
  36. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    251
    Hi

    why i can delete this terms?

    they appear again.
     

    Attached Files:

    • i2.JPG
      i2.JPG
      File size:
      33.6 KB
      Views:
      887
  37. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Those terms are not being added to the list. The warning simbol shows that they are "missing", that's how the plugin shows the terms that can be added to localize font or for Localize components that don't have a valid term. The plugin "infers" the term name from the context (e.g. Font name, Label's text) and then shows the indication so that you know what is missing.
    But those terms are not added to the LanguageSource, they are just indications. If you don't want to localize them, just toggle the "Missing" button in the bar, and all the hints are hidden. Just remember to verify that list from time to time.

    I2 Localization just copies the translation into the TMPro text field. Can you double check that if you paste that translation in a normal TMPro label (not localized), the text is rendered correctly.
    If it is not, most likely is related to font and fallback not been set correctly. Although I have no idea why will the spaces make it work.
    I will investigate this as soon as I get back to the office and let you know if I can reproduce it.
     
  38. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    Frank;

    Having great success with I2 until I try and make an iOS build. I get:

    Error CS0433: The type 'PlistDocument' exists in both 'Unity.iOS.Extensions.Xcode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEditor.iOS_I2Loc.Xcode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (CS0433)

    I saw that some firebase users were having this issue a few months back and you provided a new dll for them; I also downloaded/implanted that dll but got the same errors as before.

    How should I proceed?
     
  39. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    Are you using the latest I2 Localization (v2.8.1)?
    That version has the updated dll and any other change needed for preventing a class name clash with firebase.

    If you are, then, some cache file must have got mixed up. You should delete the I2 folder and reinstall the plugin, then restart the editor. That way any previous setting will be recreated and all should work without problems.

    Hope that helps,
    Frank
     
  40. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    I deleted and re-installed, my problems vanished, thanks.

    However, I now have a different issue. Spanish ("es") seems to no longer work. When I change my SystemLanguage to SystemLanguage.Spanish, I don't get any translations. When I look at the I2Languages prefab, it _sometimes_ looks like this:

    Screen Shot 2018-02-01 at 08.21.20.png

    Spanish selected, but no code for it. If I click the code drop-down, I see this list:

    Screen Shot 2018-02-01 at 08.17.05.png

    I see both "Spain" and "Spanish" as code [es]. I think that the code for "Spain" is wrong (should be "es-ES"?) in this case and that's the cause of the missing translations?

    Thompson

     
  41. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    The spain code can be either "es-ES" or just the base language "es". But just to make it more understandable that its the Spain variation, I will change it to the expanded version "es-ES" in the next beta.

    What I think its happening for you is that the Spanish language you created has no code. If you look at the screenshot you sent of your I2Languages.prefab, the Spanish code is empty. That could make it fail.
    My guess is that when creating the Spanish language, you typed "Spanish" in the create textfield and the clicked the Add next to that without selecting a code for it. Normally, what you should do its to type the language name or part of it, as you type, the combobox bellow will filter any language that doesn't match your text. Then, select from the popup the correct base language or variation and click in the "Add" next to the combobox.
    upload_2018-2-1_23-38-3.png

    Clicking the second "Add" button, fills both the language name and the code. If you click the first "Add" button, then you should manually assign a code.

    To fix your issue, just click in the empty code next to "Spanish" and select the 'es' code.

    Hope that helps,
    Frank
     
  42. InglewoodTechnology

    InglewoodTechnology

    Joined:
    Mar 7, 2016
    Posts:
    40
    That fixed it fine, thanks!

     
  43. dreasgrech

    dreasgrech

    Joined:
    Feb 9, 2013
    Posts:
    205
    Thank you very much for this product, it's currently working great.

    I've encountered these issues in the mean time:

    1) In LanguageSource.cs line 164, you are setting a StringComparer.Ordinal for the equality comparer, but would it be possible to expose a setting to allow for OrdinalIgnoreCase instead? This is because for my scenario, I require the keys to be matched irrespective of their casing.

    2) When you have keys that are quite long, the horizontal scrollbar of the i2Languages Inspector gets huge, and this makes it a pain to continue clicking Translate All because it's all the way to the right hand side of the box, instead of the left.
    Would it be possible to either move and anchor the Translate All button to the left instead of the right, or truncate the names of the keys when they are viewed in the Inspector and their details panel is not open?



    // Dreas.
     
  44. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    Normal Ordinal comparison runs way faster than OrdinalIgnoreCase (taking into account that a typical Localization database for a game is quite large and every label is requesting localizations). That's the main reason why the Ordinal comparison is used.
    The other reason, is that you normally create a Term (which acts like an index or key), That term could had been a number (e.g. Term #23), a hash, or something similar. But to make it more understandable, the current system uses a regular string (so, instead of Term #23, you can easily see "Tutorial_1_Welcome").

    That's why it shouldn't be needed to have same Term with different spellings. Terms are just indices that are easy to read.

    Can I ask more info about the scenario, maybe I'm overlooking something and it could be really useful to have the IgnoreCase instead of Ordinal.

    Also, take into account that if the problem is that when importing from an Spreadsheet, the translators may have misspell the case of some terms. It maybe better to have a tool that tries to normalize the case when the spreadsheet is imported (in the editor and not at runtime). That way you get a cleaner localization without the performance impact of the IgnoreCase comparison.


    The last version, constrained the number of visible characters to only 100, but even that maybe too big.
    I just modified the code so that the key always fit inside the inspector. That way all the buttons are visible, and if you need to see more of the key, just expand the inspector window.
    I will be uploading that fix to 2.8.3a1 (beta folder) in a couple days.

    Hope that helps,
    Frank
     
  45. Bric

    Bric

    Joined:
    Oct 29, 2012
    Posts:
    16
    I see the features list on asset store include "App Name localization for iOS/Android", but cannot find any doc or tutorial in 2.8.2f1 package. Does anyone could help me, please?
     
  46. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hmm, I just realized that I haven't added documentation for that feature!
    Well, time to update the docs!!!

    Said that, its pretty easy to setup. Just open the I2languages.prefab, and in the Languages tab, there is a field that allows you selecting or creating a term to localize the app name.



    Hope that helps,
    Frank
     
  47. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Hi,
    I just wanted to integrate I2 Localization in my project but it seems it doesn't include every item required:

    From the documentation I can see that there is at least Dlls, Editor and Resources missing:

    I found out that at least the resources can be created (Menu: Tools\I2 Localization\Open I2Languages.prefab) however, the resources folder is not created inside I2/Localization, but I can move it there without problems to avoid a messed up project structure.
    But what is about the other two folders? Do I need them actually?
     
  48. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    598
    Hi,
    I have to update that section in the documentation.
    The Dll is not longer needed, given that I'm including the source code of the dll what was in previous versions.
    The Editor folder is now inside the Scripts folder.

    The Resources folder can be added to the I2 folder, but its adviced to keep the I2Languages.prefab outside the I2 folder. All your localization are going to be in that prefab.
    So, by keeping it outside the I2 folder, you will not loose your data when updating the plugin. That way, its just easy: 1- delete I2 folder, 2- update

    Hope that helps,
    Frank
     
    Hosnkobf likes this.
  49. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Hi Inter-Illusion,
    Thanks for the explanation :)

    With my Asset (Better UI) I also have some generated objects inside a Resources folder.
    I have a similar structure, but with the generated resources folder included:
    • Company Name Folder (TheraBytes)
      • Product Folder (BetterUI)
      • Resources
    This way one can still delete the products folder and import a new version but the Resources are at a good place where you would expect it to be.
    Just a suggestion ;)
     
    Inter-Illusion likes this.
  50. Alexey_Ukhov

    Alexey_Ukhov

    Joined:
    Sep 20, 2017
    Posts:
    5
    Hi! I want localize app name, and it works fine on android, but don't work on iOS. After investigating I find problem - Folder I2Localization with lproj files not add to project. If I add files to Xcode project manually with create group options - app name start localized. I try add :
    proj.AddFolderReference(LocalizationRoot, "I2Localization", PBXSourceTree.Group);
    to PostProcessBuild but build failed with error - PBXSourceTree.Group don't support in unity.
    Have any ideas how to fix this?