Reputation: 93
I am working on an AIR desktop application, and am trying to get the user's locale string. I basically need to know whether the user's locale is English or French. Capabilities.language
doesn't seem to work for me, as it only displays the OS's UI language.
How can I get the user's current locale?
Once determined, I intend to set it to resourceManager.localeChain
, so that the appropriate 'properties' files are used to display my UI literals.
Thanks in advance!
Pritin
Upvotes: 3
Views: 3624
Reputation: 12847
Getting the users locality is nothing trivial. All websites has had this problem, which is why they always ask you where you're from and which language do you want it to be. This is no different in Flex.
Even with a way to detect the locale I would keep some sort of 'language bar' somewhere for the user to easily change his/her settings.
Upvotes: 3
Reputation: 3024
Instead of using Capabilities Property language use languages which returns an array Also see Localizing AIR applications
Hope that helps
Upvotes: 2