Getting user's locale in Adobe Flex
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. 开发者_StackOverflowCapabilities.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
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.
Instead of using Capabilities Property language use languages which returns an array Also see Localizing AIR applications
Hope that helps
精彩评论