views:

289

answers:

2

Hello everybody.

When we are building a application in Flex the components that we add are in English.

Lets say that i want to change then to French, Spanish or Portuguese.

How could i do that??

I've google a bit about it, but nothing good.

I didn't look too much, because you guys always now things, and here in SO its more faster to ask than search for it

:D

Thanks for any help.

EDIT:

I think i didn't expressed my self correctly.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="408" height="332">

    <mx:DateChooser x="117" y="83"/>

</mx:Application>

This creates a calendar where you can choose a date, as default shows the present date. If you take a look the Months he shows "January, February, ..." they are in English, lets say i want then in French or any other language.

How can i do that?

+1  A: 

You put your "texts" into xml or some other resource and bind it according to (for example) language_id. Here is an example:

Article

Svetlozar Angelov
That will be very useful when I'm building a multi language app. Thanks for the hint.
Fábio Antunes
+2  A: 

Adobe has a good article on the ResourceManager. This lets you store different languages, currency formats, etc, and access them based on the current locale the application is running in(runtime configurable).

In practice please remember to check the sizing of your Labels and Buttons! In one language a label may be well placed and the appropriate size, in another language the label may be too small and your whole layout will look bad. It's better to think of that upfront instead of at the end.... like I did....

EDIT:

I haven't followed this guideline, but it seems to match your Datechooser edit. I don't use Datechooser in either of the apps I maintain, so I can't provide help with it unfortunately.

ryanday
Yes, you're right about "In practice please remember to check the sizing of your Labels and Buttons! ", sometimes it's easier to design the whole form than changing sizes just to look ok
Svetlozar Angelov
Yes i have the be aware of the sizing. But look at my edit. Can you tell how do i do that? I'm not building a multi language app, its only one language, but the DateChooser months are in English, i need to change then to other language. How can i do it?
Fábio Antunes
I just updated my answer with a tutorial I found regarding the datechooser. I haven't followed that tutorial myself however, I just hope it can help.
ryanday
Bingo :DThanks its working pretty well.
Fábio Antunes
I'm leaving a compiled version for Portuguese - Portugal (pt_PT) for download. Just extract and place in "INSTALL DIR\Flex Builder 3\sdks\3.2.0\frameworks\locale". Download here http://www.box.net/shared/rdd59dq5ch .
Fábio Antunes