Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 xxmariofer · Jun 25, 2019 at 07:15 AM · translatelanguage

Multi Language app

Hello, I am trying to figure out the best way of adding multi language to my app, i was thinking of adding all buttons/UI text to dictionarys, and use the language as key, or having different xml/txt and use the current language for path for each xml/txt. can i get some advice? maybe suggest a third way of doing this? is there any default way of doing this?

Comment
Add comment · Show 1
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 revolute · Jun 25, 2019 at 09:02 AM 0
Share

I would suggest using a database, sql, sqlite whatever that suits you but due to how much a hassle it is to add database system without plugins, I will not post as an answer.

Anyhow, the schema would be ( id, lang1, lang2, lang3....) and since there are a lot of external tools to view and edit such db (using excel importer would also work), once setup, its much more efficient.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Pangamini · Jun 25, 2019 at 08:41 AM

What I did is: I have folders (in streaming assets, so languages can be added in build) for each language, and these contain a key=value dictionary files. On runtime, a selected language file is loaded (and actual Collections.Dictionary created). In code, I have a language class that lets me either find a value for the key, or replace key markers in a text (which is an extra feature you may not need) Then I have a UI script I place under UI.Text, containing the key. It's hooked to the Language's change callback/event, so when a new language is loaded on runtime, the text of the UI is changed immediately.

Comment
Add comment · Show 1 · Share
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 xxmariofer · Jul 11, 2019 at 10:07 AM 0
Share

i ended up using this method, my app was using texttospeech so changing the text with the dictionary key ended up being the by far fastest way of coding it.

avatar image
0

Answer by Kennai · Jun 25, 2019 at 08:19 AM

Hello, @xxmariofer!
I think that way with xml/txt is fine! something like

     text1=Play
     text2=Exit
     text3=Press Play to start

Or another way - create scriptable object with attributes and then fill it.
One nice bonus is that you can create different scriptable objects for different stuff. Like one scriptable object for text UI in scene1, then another scriptable object for text UI in scene2 and so on. It would be easy to edit later. Also you can organize it like folders in your project!
[language]
-english
--scene1
---UI
---Quests
--scene2
---UI
---Quests
and so on

Comment
Add comment · Share
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

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

110 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Language (Editor) Unity3D 0 Answers

Where is configuration of launcher window? 1 Answer

How to simulate a non-english Keyboard 1 Answer

Projectile speed changing by distance to target 1 Answer

move an object towards the touch or mouseclick position 2 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