Forum Discussion
Wendall
9 years agoExplorer
Localization in Unity
I'm in the process of setting up the different languages for our game. Unfortunately, I cannot find any documentation on how to get the current language setting which is set in the Oculus app. Inside of unity, I have tried checking Application.systemLanguage, but it always returns SystemLanguage.English, even if I changed the Language Preference from English (US) to Francais.
For what it's worth, I set the language preference as follows:
For what it's worth, I set the language preference as follows:
- I opened the Oculus app on your computer
- I clicked
and then selected Settings - I clicked General in the left menu
- Then next to Language Preference, I clicked to change the language
7 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffTo change Application.systemLanguage, you need to set the device's locale via Settings -> Language and Keyboard Settings -> Select Language.
- bpadgetExplorerIf you're using the Oculus Platform SDK you can call Oculus.Platform.CAPI.ovr_GetLoggedInUserLocale(). Please note that this function will only work on windows; on Android use the system locale.
- WendallExplorerI just downloaded the the Oculus Platform SDK found at this link:
https://developer3.oculus.com/downloads/platform/1.9.0/Oculus_Platform_SDK/
After I installed the unity package I did a find in files in all the *.cs files for the function mentioned above. I also looked for the word Locale, but there were no matches.
After that, I then did a search through all of files included in the zip file, but I didn't find anything there either. Is it possible that it is not included in that version? - bpadgetExplorerSorry, it looks like this code was just added and won't be out until our 1.10 release. That version should be available on the 10th.
- WendallExplorerAh great! I look forward to the update. Thanks.
- QixotlHonored Guest<Shamelessly necros thread three years on>
I'm trying to do exactly this but Unity locks up as soon as it tries to compile a script with a call to Oculus.Platform.CAPI.ovr_GetLoggedInUserLocale() in it. I have to kill it in TargetManager. Commenting out the line makes everything fine again.
Do I need to do anything else in the project setup to use this DLL?
EDIT: Locking up without that line now, must be something unrelated - sorry! - glenneroovyProtege
Sorry to necro this thread 3 years later... but I tried to call Oculus.Platform.CAPI.ovr_GetLoggedInUserLocale() to get the system language and it crashes Unity.
Is there a recommended way to get the system Locale?
EDIT: Nevermind, the solution is to call Users.GetLoggedInUserLocale() after calling Oculus.Platform.Core.AsyncInitialize(APPID); This returns for me "en-US-u-rg-uszzzz". I wonder if there is a list of Locales somewhere?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago