Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: What is the best way to handle multiple languages in PureMVC?  (Read 6631 times)
papiot
Newbie
*
Posts: 4


View Profile Email
« on: July 14, 2008, 07:37:17 »

Hi all,

As the subject states, what is the best way to set up and manage different language files for a (Flex) application in PureMVC?

Ie.  I need all the labels in the application to be in either English or French, depending on which user logs in.  Also, I need the capability to extend to more than two languages.

Thanks in advance.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: July 14, 2008, 08:51:23 »

The first place to start is by determining if Flex's built-in Resource Bundles are what you need. Of course their examples all show binding to a bunch of resource manager calls. This isn't the most elegant way of doing things, but if it works for you, go for it.

Or you can simply build a Proxy that reads an XML file, that has all the resources inside it. See the ApplicationSkeleton demo for an idea of how you can make it work this way. http://trac.puremvc.org/Demo_AS3_Flex_AppSkeleton

That demo has one config file that is read, and it has a setting that tells it the approprate xml file for the language. (there is only an 'en' defined).

So if your app has lots of labels, you might want to put it into separate files.

If it's relatively small and you want users to be able to change languages without fetching another file, you might put all labels for all supported languages inside a single xml file that's loaded. 

-=Cliff>
Logged
Pages: [1]
Print