Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 importguru88 · Aug 28, 2016 at 03:31 AM · textmobileswitchmobile deviceslanguage

How do I make a mobile game in all languages and able to switch text in different languages in the game and sell on google play and Apple Store

Right now I have my game in English . I want the game in the all languages and sell the game on Google Play and the Apple Store . How do I code that ? Can I make possible for the play to switch the text in different language in the game if the programmer gives the player an option to do that in the main menu ?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Pindwin · Aug 29, 2016 at 07:14 AM

Well, while knowing

all the languages

may prove difficult, there is a certain method for allowing your scripts to use translation: using TranslationTags.

Basically, all your strings need to be statically defined in a certain script (using statics is generally a bad practice, but this is the case you may do it freely - you are not going to change them, just define them in your code). You have, e.g.

    public class TranslationTags
    {
        public static string NewGame = "NewGame";
    }

Now, you need your translations to be stored in a file - XML or Json will do. Json is more readable, while XML has better support of .Net without using external libraries, so I personally prefer to use XML. It's generally useful to have separate XML file for each translation - so you have en-US for English, fr-FR for French etc. In each XML, you store a key-value pairs, where key is your game tag, and value - actual translation. You may also store some other data in your XML, i.e. encoding of the specific language you are willing to use. Your XML may look like:

 <xml language="pl-PL"><key>NewGame</key><value>Nowa gra</value></xml>

Then in game, choosing a language equals to switching to specific XML file. When chosen, you construct:

 using System.Collections.Generic;

 class TranslationsFromXML : MonoBehaviour
 {
     void Awake()
     {
          ReadValuesFromYourXMLAndSaveToDictionary(string defaultLanguage)
          {
               ... your particular implementation ...
          }
     }

     public static Dictionary<string, string> Translations = new Dictionary<string, string>();
     
 }

Populate it with data from your XML, so every time you want to display a string, instead you display the value associated with that string.

 myGuiElement.text = TranslationsFromXML.Translation[TranlationTags.NewGame]

I'm sure you can figure the rest out :)

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
avatar image
0

Answer by SebaTK · Aug 29, 2016 at 04:54 AM

Well I don't know how you can get it on the app stores and such, but i can give tips of how you can change languages.

Make a script : 'SettingsScript' or whatever... And make a settings button. When this button is pressed a boolean : 'isPaused' or something like that needs to be set to true. When this happens all other scripts need to know about this and go into an loop that only stops when the bool is false. Only you're 'SettingsScript' doesn't need it. Then you have the other settings buttons and a language button. When pressed it needs to show the possible languages (I would recommend that the default language is Englisch). Then it only needs to:

 GameObject.Find("Some Text #1 in Dutch").GetComponent.UI.Text;
 
 //This is brobably wrong i typed it out of the top of my head :P

You need to do this for all text in the game and voila there you have it! The further details you'll be able to find on you're own it's not that hard!

Hope this helped! XD

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

66 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

Related Questions

My assets size is 12MB but the game size is 66MB on iphone.. why? 3 Answers

Android : How to manage game display with on-screen front cameras ? 1 Answer

Avoid auto device capitalization for textfields on mobile 1 Answer

Use LightSensor using new InputSystem 0 Answers

Admob ads not showing on iOS devices 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