Merge branch 'master' into history
[potlatch2.git] / l10n / map / LocalizationMap.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <LocaleMap enableLog="false"
3     xmlns:mx="http://www.adobe.com/2006/mxml"
4     xmlns:factory="mx.core.*"
5     xmlns="library://ns.babelfx.org/l10n/flex/" >
6
7   <!-- Support for Locale ResourceBundle changes -->
8   <mx:Script>
9     <![CDATA[
10       import com.mindspace.l10n.commands.ExternalLocaleCommand;
11       import mx.resources.ResourceManager;
12       import mx.resources.IResourceManager;
13
14       import net.systemeD.potlatch2.help.HelpDialog;
15       import net.systemeD.potlatch2.TagViewer;
16       import net.systemeD.potlatch2.Toolbox;
17
18       private function onLocaleChanged(event:Event):void {
19           var rMngr : IResourceManager = ResourceManager.getInstance();
20           var sri : SmartResourceInjector = event.target as SmartResourceInjector;
21           var options : Array = [
22                                   { label : rMngr.getString('p2_main','main.gps_data') },
23                                   { label : rMngr.getString('p2_main','main.my_tracks') },
24                                   { label : rMngr.getString('p2_main','main.clear_gps') }
25                                 ];
26
27           // Iterate all view instances and inject new dataProvider
28           for each (var inst:potlatch2 in sri.targetInstances) {
29               if (inst == null) continue;
30               inst.gpsButton.dataProvider = options;
31           }
32       }
33     ]]>
34   </mx:Script>
35
36   <commandFactory>
37     <factory:ClassFactory generator="{ExternalLocaleCommand}">
38       <factory:properties>
39         <mx:Object externalPath="locales/\{0\}.swf"/>
40       </factory:properties>
41     </factory:ClassFactory>
42   </commandFactory>
43
44   <!--
45   SmartResourceInjectors for targeted class instantiations. Instead of dependency injection of UI instances,
46   we use SRI(s) here to remove any need to know view hierarchy relationships... we simply want a reference
47   to the UI instance when ready.
48   -->
49
50   <SmartResourceInjector bundleName="help_dialog" target="{HelpDialog}">
51     <ResourceProxy property="gettingStarted.text" key="help.gettingStarted" />
52     <ResourceProxy property="welcome.label" key="help.welcome" />
53   </SmartResourceInjector>
54
55   <SmartResourceInjector bundleName="p2_main" target="{potlatch2}" localeChange="onLocaleChanged(event)">
56     <ResourceProxy property="bgButton.label" key="main.background" />
57     <ResourceProxy property="styleButton.label" key="main.map_style" />
58     <ResourceProxy property="undo.label" key="main.undo" />
59     <ResourceProxy property="redo.label" key="main.redo" />
60     <ResourceProxy property="helpButton.label" key="main.help" />
61     <ResourceProxy property="optionsButton.label" key="main.options" />
62     <ResourceProxy property="saveButton.label" key="main.save" />
63   </SmartResourceInjector>
64
65   <SmartResourceInjector bundleName="p2_main" target="{TagViewer}">
66     <ResourceProxy property="dndPrompt" key="tag_viewer.dndprompt" />
67   </SmartResourceInjector>
68
69   <SmartResourceInjector bundleName="p2_main" target="{Toolbox}">
70     <ResourceProxy property="deleteNode" key="toolbox.delete_node" />
71     <ResourceProxy property="deleteWay" key="toolbox.delete_way" />
72     <ResourceProxy property="deleteArea" key="toolbox.delete_area" />
73     <ResourceProxy property="deleteItem" key="toolbox.delete_item" />
74     <ResourceProxy property="reverseButton.toolTip" key="toolbox.reverse_direction" />
75     <ResourceProxy property="splitButton.toolTip" key="toolbox.split_way" />
76     <ResourceProxy property="mergeButton.toolTip" key="toolbox.merge_ways" />
77     <ResourceProxy property="straightenButton.toolTip" key="toolbox.straighten_way" />
78     <ResourceProxy property="circulariseButton.toolTip" key="toolbox.make_circular" />
79     <ResourceProxy property="quadrilateraliseButton.toolTip" key="toolbox.make_right_angled" />
80     <ResourceProxy property="parralleliseButton.toolTip" key="toolbox.create_parrallel_way" />
81   </SmartResourceInjector>
82
83 </LocaleMap>