Search Unity

Localization package. Save yourself a lot of time in the future, enable localization!

Discussion in 'Assets and Asset Store' started by MikeHergaarden, Jul 1, 2011.

  1. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    The effortless solution to localization, language management and translation.
    New in the asset store the Localization package.

    As a part of gathering all essential tools that we need for any future game development we've created this localization package. This package features an all in solution for localizing your games. The goal of this project was to, once and for all, create a perfect localization solution that is dead-easy to use. The next time you work out a licensing deal you can have the localization ready up front!

    Much effort has gone into polishing the usability. This is to ensure that there should be no reason not to integrate it in a game, even when you don't plan on offering translations at all. Furthermore it is a plus to have all your games texts outside of the code to allow others to improve the texts.

    Features:
    • Super easy to use
    • C# source code
    • Compatible with JS, Boo and C#
    • Support as many and any language you want
    • Optional automatic translations
    • Google docs integration for smooth collaboration
    • Builds do not need an internet connection: 1 button to bake your translations
    • Detects local language and remembers last language setting
    • Compatible with all Unity platforms


    Download now
    Read full documentation
     
    Last edited: Jul 23, 2015
  2. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Hi,
    This looks great, but I have one question.
    I had a quick look through the doc but could see nothing related to handling of localised image files.

    See http://gamerizon.com/category/unity3d/ for an example.

    Does your package handle this?

    ty!
     
  3. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Very good point.
    Submitted update 1.01:
    -Language.GetAsset(string name) has been added.
    -LocalizeAsset.cs can be attached to gameobjects to localize an asset automatically
    -These asset translations do need to be present as "Resources/Language/LANGUAGECODE/ASSETNAME"
    -Editorscript: "verify localized assets" helps you to verify if all localized assets are present correctly in all languages.
    -Demo + documentation expanded for this new feature
     
  4. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Great.
    How does this work with custom font filesfor each language? Do you use the localised asset for font files to be replaced inside guistyles or how does that work exactly?
     
    Last edited: Jul 15, 2011
  5. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Yes custom font files would be localized assets. You can replace the material/texture and font data inside the GUIstyle indeed.
    I'm on a holiday for the next two weeks, but I could add a demo after.
     
  6. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    That would be excellent if I could see a working demo incorporating multilingual fonts and images.
    Have a good break!
     
  7. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    HI,
    Did you manage to add this? I'm looking at localising now.

    Cheers,
    sv
     
  8. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I've just submitted an update to the asset store, it should be live by tonight or otherwise tomorrow.

    The demo now shows a of the "LocalizedAssets" for GUI font files. This can be extended to whatever GUI solution you use.

    Furthermore, for this purpose a callback has been added, you can add the function "ChangedLanguage" to any of your scripts and it will be called whenever the language has changed.

    This should hopefully help you out!
     
  9. brownsky

    brownsky

    Joined:
    Oct 27, 2008
    Posts:
    1
    Hi Mike,

    is it possible to dynamically load new languages (text and assets) as asset bundles into the build and use them with this package?

    Cheers,
    Martin
     
  10. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    brownsky:
    At the moment all localized assets are loaded via Resources.Load. However, it could be quite easily adapted to also accept some (predefined) asset bundles and check where an asset is available.

    So: Currently, there is no asset bundle support but expanding this is very easy. This will certainly make a good addition when I have some more time.
     
  11. oxl

    oxl

    Joined:
    Nov 21, 2008
    Posts:
    325
    Hi Leepo,

    I recently have bought your package and I am happy with the overall ease of use and the Google docs integration in detail.

    There is one little problem, though. I need to have multi lines in some fields, so hitting alt-return does a new line in gDocs.
    When updating your Language Editor function throws an error saying that key is missing.
    It is obviously not and i can confirm that that line break inserted in gDocs raises the error. ( No error with no linebreak)

    Do you think there might be a solution for that problem ? I did a quick look inside your code but was not getting too far.

    Though I might work around that issue, it would be nice if it would be possible to use multi lines , too.

    In any case, thank you for that asset, really useful and time saving.

    --
    oxl
     
    Last edited: Dec 2, 2011
  12. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    oxl: Thanks, glad it's helpfull. I'll have a look at the newlines, hopefully today/this weekend.
     
  13. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I've committed a fix to the asset store package with support for new lines (1.04).
    It should be live within 1 or 2 days, depending on the asset store team.
     
  14. oxl

    oxl

    Joined:
    Nov 21, 2008
    Posts:
    325
    Hi Leepo ,

    Thank you so much for the quick fix , much appreciated !

    Cheers,

    --
    oxl
     
  15. rsouza

    rsouza

    Joined:
    Dec 1, 2011
    Posts:
    67
    Hy my friend, how are you?

    I have a question, i bought your package. My sheet document in GDocs have more than one sheet, but when i press UPDATE TRANSLATE, in console this show it:

    " No sheets found, or your spreadsheet has only 1 sheet. We are assuming that the first sheet has ID '0'. "

    How can i fix it?
    Tks
     
  16. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    I submitted an update yesterday which should be live by now (1.07). Can you please try updating and see if that helps?
    Otherwise please PM me the URL that you entered for your spreadsheet and I'll have a look why it doesn't work properly.
     
  17. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    how does this handle languages like chinese, japanese?
     
  18. Madgeniy

    Madgeniy

    Joined:
    Apr 21, 2012
    Posts:
    14
    Hello. I have one UnityPro project on Windows and the same project on Mac. In windows all right, but in Mac i have message "MISSING LANG". Source of projects is only one. What I could do?
     
  19. Madgeniy

    Madgeniy

    Joined:
    Apr 21, 2012
    Posts:
    14
    I just clean package from demo and languages folder, now it works well!
     
  20. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Madgeniy: I'm glad you figured it out :).

    imtrobin: This package does not limit the usage of Asian languages. Chinese/Japanese is supported. When using the default mac/windows languages it'll work out of the box. The most important thing you need to take care of is to make sure to use correct font files (Asian font files can be huge!). The included demo also shows usage of 1 or 2 Asian languages. The package can switch language files when switching the language setting (using localized assets).
     
  21. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    I have no problems running it on a webplayer. It's flawless.

    However, I need to use it for my mobile version. Unfortunately it prompts me the fonts cannot be 'dynamic'.

    So basically now, all fonts are invisible.

    How do you go about this?

    Thanks.
     
  22. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
  23. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    I'm using the default system font Arial to render all fonts.

    If the characters aren't there, they won't render on the webplayer.

    But they do. The problem is when you switch to build for iOS.

    Has anyone tried this with iOS with non Roman alphabets (Korean, Japanese, Chinese) ?

    Like what I said on the email Mike, try compiling your demo scene to iOS and you'll see the font disappear as well.

    I don't want to replace the font. Arial has all the characters I need. I just want it to render on mobile just like it does in the webplayer.
     
  24. safajnaseef

    safajnaseef

    Joined:
    Dec 17, 2012
    Posts:
    1
    Hi,

    Does this package support right to left languages like Arabic?

    Thanks.
     
  25. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Is using Unity4 an option for you? I have tried and the new Unity4 dynamic font rendering works out of the box: The package works fine and even the asian languages show up using Arial.

    This should not matter for the localization pacakage itself as it's more about the language management integration of things. Any language should work fine now with Unity4.
     
  26. ShadedLife

    ShadedLife

    Joined:
    Jan 2, 2013
    Posts:
    1
    Hi Mike, my question is similar to sfajnaseef's. You said that right to left languages wouldn't matter because it's about the management of things and it works fine with Unity4 but I am still having a problem.

    I have Arabic in my google doc and the characters display in the demo but they seem to be going left to right instead of right to left. Is there some flag I have to switch or some particular way I have to have the Arabic in the google doc? Right now I'm just using the googleTranslate trick to get the translations so it makes it right to left there.

    Any help would be much appreciated, thank you.
     
  27. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Ahh I see now. It all works fine in the google spreadsheet. But the export of that removes the right-to-left formatting.

    What I have in place now is a check that checks for arabic characters in the value..if any, it'll automatically reverse the entire string. This works fine, although this does mess up any special characters (such as the {X} that I use for inserting data..will be turned around as }X{).

    This is easy to work around, but not yet an ideal solution.
    If you'd like to test it and see if there are any other specific problems please let me know. (PM or mail me and I'll send you the 1 file that changed)
     
  28. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    Thanks for such a great package. This is simply awesome!!

    Sorry for the dumb question-- after a quick look I wasn't able to determine the function for procedurally changing the current language. Is there a way to swap the current language manually to override the autodetect?

    thanks so much! great work on this.
     
  29. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Yes thats possible, see the demo script:

     
  30. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    Thanks very much, Mike!

    And in case anyone else finds this useful, I found a great free asset that lets you use system fonts on ios and android (mac only):
    http://forum.unity3d.com/threads/140751

    And here's a super simple script I wrote for making it play nice with Localization package:


    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. // drop this on a sysfonttext object.  in the inspector, hook up theSysFont.  Then
    5. // type in your Language.Get 'code' in the localizationCode field (ie GAME_TITLE)
    6.  
    7. public class SeedFontWithLocalization : MonoBehaviour
    8. {
    9.     public string localizationCode;
    10.     public SysFontText theSysFont;
    11.     private string stringToPass;
    12.  
    13.     void Start ()
    14.     {
    15.         SeedFont ();   
    16.     }
    17.    
    18.     void SeedFont ()
    19.     {
    20.         if (localizationCode != null) {
    21.             stringToPass = Language.Get (localizationCode);
    22.             theSysFont.Text = stringToPass;
    23.         }
    24.     }
    25. }
    26.  
    UPDATE: caution that the localizationCode you input in the inspector gets serialized. So you'll have to hit 'reset' (little gear next to the name of the script on each instance) and re-enter the localizationCode when you want to update your localizations.
     
    Last edited: Feb 7, 2013
  31. funasylum

    funasylum

    Joined:
    Feb 5, 2011
    Posts:
    48
    <UPDATE-- FIXED!>

    Thanks Mike for helping me determine the source of this error-- I guess the google URL I was pasting into localization ended with =html instead of =csv. Changing that fixed this error for me.



    Hi -- i'm also getting this error. I'm pretty sure I'm using the latest version (purchased two weeks ago). Was there ever a fix found for this error?

    My spreadsheet only has one sheet. I tried adding another sheet and still got the error.

    Thank you!
     
    Last edited: Feb 7, 2013
  32. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    If you PM or email me your gDocs url I can have a look at the "no sheets found" error.
     
  33. dd619

    dd619

    Joined:
    Jul 31, 2012
    Posts:
    4
    Hello Mike,

    Your asset is seems to very useful.Great work!!!

    But i have a question ,is this asset works for unity-android?

    i am developing a game in unity 4.0, in which i have used some android controls like alertdialog,radioButtons,progressDialog (please see image below) by using android plugins for unity,and i want to localize it.is it possible with your asset?

    $dialoimage.png

    And also i want to know that is this asset is work for GUI class in unity like Button,Label etc.


    Please help me.
    Thank you.
     
    Last edited: Mar 15, 2013
  34. Matt-Face

    Matt-Face

    Joined:
    Mar 24, 2013
    Posts:
    22
    Hi Mike,

    I have Just purchased your asset and I am trying to follow through the examples in the documentation but i am getting the following result "MISSING LANG:GAME_TITLE"
    I also noticed from messages in the console that the referenced script on the "Wooglie" GameObject is missing in the demo.
    I tried reimporting the asset and now i am getting the following:

    "No sheets found, or your spreadsheet has only 1 sheet. We are assuming that the first sheet has ID '0'. (You can fix this by simply adding a second sheet as this will allow ID lookup via HTML output)
    UnityEngine.Debug:LogWarning(Object)
    LanguageEditor:GetSpreadSheetIDs(String) (at Assets/Localization/Editor/LanguageEditor.cs:586)
    LanguageEditor:LoadSettings(String) (at Assets/Localization/Editor/LanguageEditor.cs:200)
    LanguageEditor:OnGUI() (at Assets/Localization/Editor/LanguageEditor.cs:104)
    UnityEditor.DockArea:OnGUI()
    "

    I tried adding a second sheet but i am getting the same result...
     
  35. Tripwire

    Tripwire

    Joined:
    Oct 12, 2010
    Posts:
    442
    Hi,

    I'm using your localization package which works perfectly. But when i change the language at runtime, it doesn't work well. Not everything gets updated and for instance some parts of the text are German, and some parts of the text are English which is a bit weird.
    So when i push the button this code runs:
    Language.SwitchLanguage(LanguageCode.EN);

    I've wrote this in JS.

    Thx!
     
  36. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
  37. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Sorry for the trouble, we recently changed our website. The link works again!
     
  38. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    How are you displaying your texts? Unity OnGUI or e.g. NGUI?
    I've never heard of this bug before. The system should switch properly, but possibly the translated texts are cached by your code?

    Fixed, removed.

    Double check the link you are using, is it getting any results at all?
    Verify the link ends with: &output=csv&single=true&gid=0
     
    Last edited: Jun 19, 2013
  39. asalga

    asalga

    Joined:
    Jul 8, 2013
    Posts:
    1
    Is the Demo scene setup to run properly the first time around? I created a new project, Imported the package, but upon running the Demo Scene, I just get "MISSING LANG: MAIN_WELCOME", "MISSING_LANG: MAIN_INTRO"

    Any help?
     
  40. Apiweb

    Apiweb

    Joined:
    Nov 26, 2011
    Posts:
    57
    Is compatible with NGUI? How to works?
    Works offline?
     
  41. td0239

    td0239

    Joined:
    Oct 2, 2013
    Posts:
    3
    Hi,
    Is it possible to differentiate between variants of a language? Specifically I'm thinking of en (English) and en-US (American English)?
     
  42. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Update 1.13 is live on the Unity asset store to fix compatability with Win8Store.
    Get it here: http://u3d.as/content/m2h/localization-package/1Ya
    If you are updating, make sure to delete the LightXML folder after updating.

    NGUI compatability:
    Yes, you can attach the new NGUILocalizeM2H.cs script to any ngui lebel to have it auto translated.

    "Is it possible to differentiate between variants of a language? Specifically I'm thinking of en (English) and en-US (American English)?"
    In 1.13 i added EN_US, EN_UK and PT_BR to the LanguageCodes. So if you use these in the google doc all will work right away. Do note that auto translation will only return EN for english computers. So either use EN and EN_UK or go for EN and EN_US (where EN is your default for english).
     
  43. GameMechanics

    GameMechanics

    Joined:
    Jul 15, 2013
    Posts:
    57
    Okay. Total noob question. I am trying to call Language.Get() and it is saying - BCE0005: Unknown identifier: 'Language'. I am going over the manual line by line but not seeing anything that will help.

    Thanks!
     
  44. GameMechanics

    GameMechanics

    Joined:
    Jul 15, 2013
    Posts:
    57
    Never mind. I am using JavaScript and did not read the comment about moving the Plugins folder. It was in there.
     
  45. OneThree

    OneThree

    Joined:
    Oct 28, 2011
    Posts:
    181
    There's been a change to Google Docs: you can no longer publish a spreadsheet as a CSV. You can read about it here: https://stackoverflow.com/questions/21189665/new-google-spreadsheets-publish-limitation.

    When I follow along to the documentation, I get to the publish step and my publish screen looks different than the one in the support PDF. There is no option for CSV; it just gives me the link, which is html.

    The html link doesn't work in the tool, I assume b/c it expects a CSV.

    So as of now, the tool is unusable. Is there a workaround or update on the way?
     
  46. olivier-etienne

    olivier-etienne

    Joined:
    Feb 15, 2013
    Posts:
    13
    Same problem here!!!
    The following message appear when trying to update translation:
    No sheets could be imported. Either they are all empty or you enter a wrong link.
    Please copy the link again and verify your spreadsheet.

    I have sent a support email yesterday, I have not had a response yet.
     
  47. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    How annoying from Google. I'm working on a fix.
     
  48. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Fixed in v 1.15.
    It'll continue working on the old CSV export and also for the new gDocs spreadsheet HTML output.
    No need to update if your sheets are still working on the old gDocs.
     
  49. mr_fox

    mr_fox

    Joined:
    Nov 28, 2012
    Posts:
    3
    Hello,
    can't seem to make the new google config work
    NullReferenceException: Object reference not set to an instance of an object
    LanguageEditor.GetSpreadSheetIDs (System.String gDocsUrl) (at Assets/Localization/Editor/LanguageEditor.cs:606)
    could you post a snippet of the accepted url format ?

    thanks
     
  50. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027