Tweak: app -> application.
[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="http://l10n.babelfx.org/" >
6
7   <!-- Support for Locale ResourceBundle changes -->
8   <mx:Script>
9     <![CDATA[
10       import org.babelfx.commands.ExternalLocaleCommand;
11       import org.babelfx.events.LocaleEvent;
12       import mx.resources.ResourceManager;
13       import mx.resources.IResourceManager;
14
15       import net.systemeD.potlatch2.help.HelpDialog;
16
17       import net.systemeD.potlatch2.TagViewer;
18       import net.systemeD.potlatch2.Toolbox;
19       import net.systemeD.potlatch2.StyleSelector;
20       import net.systemeD.potlatch2.BackgroundSelector;
21
22       import net.systemeD.potlatch2.save.OAuthPanel;
23       import net.systemeD.potlatch2.save.SaveDialog;
24
25       import net.systemeD.potlatch2.options.OptionsDialog;
26
27       private function onLocaleChanged(event:Event):void {
28           var rMngr : IResourceManager = ResourceManager.getInstance();
29           var sri : ResourceInjector = event.target as ResourceInjector;
30           var options : Array = [
31                                   { label : rMngr.getString('p2_main','main.gps_data') },
32                                   { label : rMngr.getString('p2_main','main.my_tracks') },
33                                   { label : rMngr.getString('p2_main','main.clear_gps') }
34                                 ];
35
36           // Iterate all view instances and inject new dataProvider
37           for each (var inst:potlatch2 in sri.targetInstances) {
38               if (inst == null) continue;
39               inst.gpsButton.dataProvider = options;
40           }
41       }
42     ]]>
43   </mx:Script>
44
45   <commandFactory>
46     <factory:ClassFactory generator="{ExternalLocaleCommand}">
47       <factory:properties>
48         <mx:Object externalPath="locales/\{0\}.swf"/>
49       </factory:properties>
50     </factory:ClassFactory>
51   </commandFactory>
52
53   <!--
54   ResourceInjectors(at v2) for targeted class instantiations. Instead of dependency injection of UI instances,
55   we use RI(s) here to remove any need to know view hierarchy relationships... we simply want a reference
56   to the UI instance when ready.
57   -->
58
59   <ResourceInjector bundleName="help_dialog" target="{HelpDialog}">
60     <ResourceSetter property="gettingStarted.text" key="help.gettingStarted" />
61     <ResourceSetter property="welcome.label" key="help.welcome" />
62     <ResourceSetter property="whyOpenStreetMap.htmlText" key="help.whyOpenstreetmap" />
63     <ResourceSetter property="activeMembers.htmlText" key="help.activeMembers" />
64     <ResourceSetter property="newMembersText.htmlText" key="help.newMembers" />
65     <!-- wanna call loaderInfo.parameters["site_name"] or getIntroText() -->
66     <!-- <ResourceSetter property="introText.htmlText" key="help.introText" parameters="that"/> -->
67     <ResourceSetter property="introduction.label" key="help.introduction" />
68     <ResourceSetter property="Controls.label" key="help.controls" />
69     <ResourceSetter property="interfaceControls.label" key="help.interfaceControls"/>
70     <ResourceSetter property="background.label" key="help.background"/>
71     <ResourceSetter property="mapBackground.htmlText" key="help.mapBackground"/>
72     <ResourceSetter property="mapStyle.label" key="help.mapStyle"/>
73     <ResourceSetter property="colourStyle.htmlText" key="help.colourStyle"/>
74     <ResourceSetter property="gps.label" key="help.gps"/>
75     <ResourceSetter property="createOsmMap.htmlText" key="help.createOsmMap"/>
76     <ResourceSetter property="undoRedo.label" key="help.undoRedo" />
77     <ResourceSetter property="madeMistake.htmlText" key="help.madeMistake" />
78     <ResourceSetter property="help.label" key="help.help" />
79     <ResourceSetter property="guideInfomation.htmlText" key="help.guideInfomation" />
80     <ResourceSetter property="save.label" key="help.save" />
81  <!--   <ResourceSetter property="saveText.htmlText" key="help.saveText" />    -->
82     <ResourceSetter property="addingFeatures.label" key="help.addingFeatures" />
83     <ResourceSetter property="addingFeaturesText.htmlText" key="help.addingFeaturesText" />
84     <ResourceSetter property="editBeg.label" key="help.editBeg" />
85     <ResourceSetter property="editingFeatures.label" key="help.editingFeatures" />
86     <ResourceSetter property="editingFeaturesText.htmlText" key="help.editingFeaturesText" />
87     <ResourceSetter property="editAdv.label" key="help.editAdv" />
88     <ResourceSetter property="editingFeaturesAdv.label" key="help.editingFeaturesAdv"/>
89     <ResourceSetter property="editingFeaturesAdvText.htmlText" key="help.editingFeaturesAdvText"/>
90     <ResourceSetter property="tag.label" key="help.tag" />
91     <ResourceSetter property="taggingFeatures.label" key="help.taggingFeatures" />
92     <ResourceSetter property="taggingFeaturesText.htmlText" key="help.taggingFeaturesText" />
93     <ResourceSetter property="shortcuts.label" key="help.shortcuts" />
94     <ResourceSetter property="keyboardShortcuts.label" key="help.keyboardShortcuts" />
95   </ResourceInjector>
96
97   <ResourceInjector bundleName="p2_main" target="{potlatch2}" localeChange="onLocaleChanged(event);">
98     <ResourceSetter property="bgButton.label" key="main.background" />
99     <ResourceSetter property="styleButton.label" key="main.map_style" />
100     <ResourceSetter property="undo.label" key="main.undo" />
101     <ResourceSetter property="redo.label" key="main.redo" />
102     <ResourceSetter property="helpButton.label" key="main.help" />
103     <ResourceSetter property="optionsButton.label" key="main.options" />
104     <ResourceSetter property="saveButton.label" key="main.save" />
105     <ResourceSetter property="gpsButton.label" key="main.gpsButton" />
106   <!--   These are setted on onLocaleChanged()
107     <ResourceSetter property="gpsData.label" key="main.gps_data" />
108     <ResourceSetter property="myTrack.label" key="main.my_track" />
109     <ResourceSetter property="clearGps.label" key="main.clear_gps" />
110     -->
111   </ResourceInjector>
112
113   <ResourceInjector bundleName="p2_main" target="{OAuthPanel}">
114     <ResourceSetter property="gotLinkBox.text" key="oauth.gotLinkBox" />
115     <ResourceSetter property="authorized.text" key="oauth.authorized" />
116     <ResourceSetter property="deniedLabel.text" key="oauth.deniedLabel" />
117     <ResourceSetter property="rememberMe.label" key="oauth.rememberMe" />
118     <ResourceSetter property="permFail.htmlText" key="oauth.permFail" />
119     <ResourceSetter property="tempFail.text" key="oauth.tempFail" />
120     <ResourceSetter property="tryAccessButton.label" key="oauth.tryAccessButton" />
121     <ResourceSetter property="cancelButton.label" key="oauth.cancelButton" />
122   </ResourceInjector>
123
124   <ResourceInjector bundleName="p2_main" target="{TagViewer}">
125     <ResourceSetter property="dndPrompt" key="tag_viewer.dndprompt" />
126   </ResourceInjector>
127
128   <ResourceInjector bundleName="p2_main" target="{Toolbox}">
129     <ResourceSetter property="deleteNode" key="toolbox.delete_node" />
130     <ResourceSetter property="deleteWay" key="toolbox.delete_way" />
131     <ResourceSetter property="deleteArea" key="toolbox.delete_area" />
132     <ResourceSetter property="deleteItem" key="toolbox.delete_item" />
133     <ResourceSetter property="reverseButton.toolTip" key="toolbox.reverse_direction" />
134     <ResourceSetter property="splitButton.toolTip" key="toolbox.split_way" />
135     <ResourceSetter property="mergeButton.toolTip" key="toolbox.merge_ways" />
136     <ResourceSetter property="straightenButton.toolTip" key="toolbox.straighten_way" />
137     <ResourceSetter property="circulariseButton.toolTip" key="toolbox.make_circular" />
138     <ResourceSetter property="quadrilateraliseButton.toolTip" key="toolbox.make_right_angled" />
139     <ResourceSetter property="parralleliseButton.toolTip" key="toolbox.create_parrallel_way" />
140   </ResourceInjector>
141
142   <ResourceInjector bundleName="p2_main" target="{StyleSelector}">
143     <ResourceSetter property="editButton.label" key="styleSelector.editButton" />
144   </ResourceInjector>
145
146   <ResourceInjector bundleName="p2_main" target="{BackgroundSelector}">
147     <ResourceSetter property="dim.label" key="backgroundSelector.dim" />
148     <ResourceSetter property="sharpen.label" key="backgroundSelector.sharpen" />
149     <ResourceSetter property="editButton.label" key="backgroundSelector.editButton" />
150     <ResourceSetter property="vectorButton.label" key="backgroundSelector.vectorButton" />
151   </ResourceInjector>
152
153   <ResourceInjector bundleName="p2_main" target="{SaveDialog}">
154     <ResourceSetter property="editDescription.text" key="save.editDescription" />
155     <ResourceSetter property="commentLabel.label" key="save.commentLabel" />
156   </ResourceInjector>
157
158   <ResourceInjector bundleName="p2_main" target="{OptionsDialog}">
159     <ResourceSetter property="tbcheck.label" key="options.tbcheck" />
160     <ResourceSetter property="cursorcheck.label" key="options.cursorcheck" />
161     <ResourceSetter property="ok.label" key="option.ok" />
162   </ResourceInjector>
163 </LocaleMap>