Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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
2
Question by XMGFilbert · Aug 13, 2013 at 02:57 PM · androidioslocaleiso

Two letter ISO language code for mobile devices.

I'm currently using Prime31's Etcetera for iOS to get the 2 letter ISO language code. However, Etcetera for Android does not provide such a functionality. I've tried using the following but it returns "iv":

 System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;

I know Unity provides Application.systemLanguage, but that is not in the two letter ISO language code that I need. Is there a reliable way to get the current language of the mobile device, in particular for Android devices?

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 alxcancado · Sep 01, 2017 at 01:22 PM 0
Share

I found this one, really easy: https://github.com/$$anonymous$$artinSchultz/unity3d/blob/master/LanguageHelper.cs

Cheers!

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer Wiki

Answer by GabrielS · Sep 11, 2013 at 03:36 PM

I've just ran into this issue, the "Culture" APIs look completely useless. From what i can tell, we have to manually map the enum values in Application.systemLanguage to the two-letter codes, which of course loses the regional info (i.e. you can't discern between en-US and en-GB, you'll have to pick a default one for "English").

Comment
Add comment · Show 2 · 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 XMGFilbert · Sep 11, 2013 at 03:38 PM 0
Share

Indeed, that's what I am currently doing to bypass that problem. Thanks for your answer!

avatar image achimmihca · Sep 06, 2019 at 06:48 AM 1
Share

Someone posted a LanguageHelper.cs file on GitHub, which does the mapping of the enum to the two letter country code: https://github.com/$$anonymous$$artinSchultz/unity3d/blob/master/LanguageHelper.cs

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

19 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

Related Questions

differentiating various android devices into low/medium/high settings 0 Answers

Get ISO 3166 code on mobile device(Unity3d)? 1 Answer

How to check performance of the game in the device made in Unity 3d 3 Answers

Simple Unity3d Facebook Integration? 1 Answer

Unity3d Social Logout 1 Answer


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