Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by nightlybuild · Sep 15, 2014 at 07:58 AM · localizationtranslationinternationalization

What is best practice for translation handling?

Hi!

There are quite a few concepts out there dealing with localization... for several years i've been using my own that i felt somewhat happy with back in the good old days of Actionscript 2. As always: it works somehow, but there's always chance for improvement.

Basically i'm using 2 xml files. One stores the index of strings and the other one holds the actual strings, one file per language. On program start the default language file is being parsed and written to dictionaries. When i need a string it's taken from the dictionaries. When i change the language in the application i'm loading the next language file.

  1. Do you think it would be better to just read the strings from file when i need them?

  2. Does it impact performance or memory consumption too much when i transcribe all the strings to Dictionary? Currently my largest XML file was about 240kb with about 3500 strings, some of them containing about 500 words.

  3. My concern in using a "po" style system (like here: http://wiki.unity3d.com/index.php?title=TextManager) are the resulting IDs. It just doesn't "feel" right to have a 2000 character long identifier to look up a translation. Am i worrying too much or getting something wrong?

Thanks in advance for your views, opinion, advice, ...

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image bonesbrigade · Jun 13, 2015 at 11:17 PM 0
Share

I agree that having two large files is kind of a heavy setup. The key's should be more like a reference than the full translation in some cases.

I made a simplified translation system you can try out: https://github.com/camsjams/i18n-unity-csharp

avatar image Lerzpftz · Jun 13, 2015 at 11:53 PM 0
Share

Hi.

  1. I think it's better to load it all at once. Reading those 240kb X$$anonymous$$L may take a few milliseconds, but it's only done once at startup. If you load your strings 'on demand' you may have lots of separate file reads, which usually costs much more. Also, if you ever need to access those texts remotly over some network, you would generate a lot of round trips.

  2. Those 240kb in the xml file should consume a bit less memory in your dictionary, since it's the same strings (assu$$anonymous$$g the encoding is the same) - $$anonymous$$us some xml tags. And dictionaries are a pretty fast way to go for unsorted data access with an id. That should be fine.

  3. I think you are worrying too much. Did you already finish the rest of your game? :D Usually it's not worth thinking about saving those 200kb of memory, when all you have to do is scale down a single texture and can save 5 times as much.

woops ... that question was from last year? never $$anonymous$$d.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Arabic Language 6 Answers

How should I structure my localization string tables? 0 Answers

Function to translate text in unity 0 Answers

How can I internationalize(I18n) a unity 3D project? 3 Answers

Language/translation connector to Unity - will it be useful? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges