bonjour,
j'ai une application qui fait appel à un composant, j'aimerais bien faire la localisation de toute l'application et donc la localisation du composant.
je commence par le composant(canvas) mais ça marche pas
le voilà
localisation.mxml
et localization.mxml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="538" height="192" creationComplete="changeHandlerCanvas(event)"> <mx:Metadata> [ResourceBundle("myResources")] </mx:Metadata> <mx:Script> <![CDATA[ [Bindable] private var locales:Array = [ {label: "English", code:"en_US"}, {label: "Français", code:"fr_FR"} ]; private function changeHandlerCanvas(event:Event):void { resourceManager.localeChain = [ localeComboBox.selectedItem.code ]; } ]]> </mx:Script> <mx:Button x="216" y="67" label="Click here" width="139" id="eraseButton"/> <mx:Label x="52" y="67" text="localisation" width="137" height="22" id="labelText"/> <mx:ComboBox id="localeComboBox" dataProvider="{locales}" change="changeHandlerCanvas(event)" x="373" y="67"/> </mx:Canvas>
merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" backgroundGradientColors="[0x000000,0x323232]" viewSourceURL="srcview/index.html" > <!-- Before compiling this application on your system: 1. Add the following compiler arguments: -locale=en_US,fr_FR -source-path=locale/{locale} 2. Open a Command prompt/shell, navigate to the bin directory of your Flex SDK (for example: C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.0.1\bin), and execute the following command: copylocale en_US fr_FR --> <mx:Metadata> [ResourceBundle("myResources")] </mx:Metadata> <mx:Style> Label { color: #FFFFFF; } </mx:Style> <mx:Script> <![CDATA[ ]]> </mx:Script> <localisation id="contactLocalisation"/> <mx:HBox width="100%" horizontalAlign="right"> <mx:Image source="{resourceManager.getClass('myResources', 'LOGO')}"/> <mx:Spacer width="100%"/> </mx:HBox> </mx:Application>
Partager