Merge branch 'master' of github.com:systemed/potlatch2
[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 net.systemeD.potlatch2.CustomLocaleCommand;
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.dialogs.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           // ** FIXME: If the locale is en_US, then the above rMngr.getString calls return null.
36           //           Conversely, with any locale, the actual Label of gpsButton is never
37           //           updated and keeps showing 'GPS'.
38
39           // Iterate all view instances and inject new dataProvider
40           for each (var inst:potlatch2 in sri.targetInstances) {
41               if (inst == null) continue;
42               inst.gpsButton.dataProvider = options;
43           }
44       }
45     ]]>
46   </mx:Script>
47
48   <commandFactory>
49     <factory:ClassFactory generator="{CustomLocaleCommand}">
50       <factory:properties>
51         <mx:Object defaultExternalPath="locales/\{0\}.swf"/>
52       </factory:properties>
53     </factory:ClassFactory>
54   </commandFactory>
55
56   <!--
57   ResourceInjectors(at v2) for targeted class instantiations. Instead of dependency injection of UI instances,
58   we use RI(s) here to remove any need to know view hierarchy relationships... we simply want a reference
59   to the UI instance when ready.
60   -->
61
62   <ResourceInjector bundleName="help_dialog" target="{HelpDialog}">
63     <ResourceSetter property="gettingStarted.text" key="help.gettingStarted" />
64     <ResourceSetter property="welcome.label" key="help.welcome" />
65     <ResourceSetter property="whyOpenStreetMap.htmlText" key="help.whyOpenstreetmap" />
66     <ResourceSetter property="activeMembers.htmlText" key="help.activeMembers" />
67     <ResourceSetter property="newMembersText.htmlText" key="help.newMembers" />
68     <!-- wanna call loaderInfo.parameters["site_name"] or getIntroText() -->
69     <!-- <ResourceSetter property="introText.htmlText" key="help.introText" parameters="that"/> -->
70     <ResourceSetter property="introduction.label" key="help.introduction" />
71     <ResourceSetter property="Controls.label" key="help.controls" />
72     <ResourceSetter property="interfaceControls.label" key="help.interfaceControls"/>
73     <ResourceSetter property="background.label" key="help.background"/>
74     <ResourceSetter property="mapBackground.htmlText" key="help.mapBackground"/>
75     <ResourceSetter property="mapStyle.label" key="help.mapStyle"/>
76     <ResourceSetter property="colourStyle.htmlText" key="help.colourStyle"/>
77     <ResourceSetter property="gps.label" key="help.gps"/>
78     <ResourceSetter property="createOsmMap.htmlText" key="help.createOsmMap"/>
79     <ResourceSetter property="undoRedo.label" key="help.undoRedo" />
80     <ResourceSetter property="madeMistake.htmlText" key="help.madeMistake" />
81     <ResourceSetter property="help.label" key="help.help" />
82     <ResourceSetter property="guideInfomation.htmlText" key="help.guideInfomation" />
83     <ResourceSetter property="save.label" key="help.save" />
84  <!--   <ResourceSetter property="saveText.htmlText" key="help.saveText" />    -->
85     <ResourceSetter property="addingFeatures.label" key="help.addingFeatures" />
86     <ResourceSetter property="addingFeaturesText.htmlText" key="help.addingFeaturesText" />
87     <ResourceSetter property="editBeg.label" key="help.editBeg" />
88     <ResourceSetter property="editingFeatures.label" key="help.editingFeatures" />
89     <ResourceSetter property="editingFeaturesText.htmlText" key="help.editingFeaturesText" />
90     <ResourceSetter property="editAdv.label" key="help.editAdv" />
91     <ResourceSetter property="editingFeaturesAdv.label" key="help.editingFeaturesAdv"/>
92     <ResourceSetter property="editingFeaturesAdvText.htmlText" key="help.editingFeaturesAdvText"/>
93     <ResourceSetter property="tag.label" key="help.tag" />
94     <ResourceSetter property="taggingFeatures.label" key="help.taggingFeatures" />
95     <ResourceSetter property="taggingFeaturesText.htmlText" key="help.taggingFeaturesText" />
96     <ResourceSetter property="shortcuts.label" key="help.shortcuts" />
97     <ResourceSetter property="keyboardShortcuts.label" key="help.keyboardShortcuts" />
98   </ResourceInjector>
99
100   <ResourceInjector bundleName="p2_main" target="{potlatch2}" localeChange="onLocaleChanged(event);">
101     <ResourceSetter property="bgButton.label" key="main.background" />
102     <ResourceSetter property="styleButton.label" key="main.map_style" />
103     <ResourceSetter property="undo.label" key="main.undo" />
104     <ResourceSetter property="redo.label" key="main.redo" />
105     <ResourceSetter property="helpButton.label" key="main.help" />
106     <ResourceSetter property="optionsButton.label" key="main.options" />
107     <ResourceSetter property="saveButton.label" key="main.save" />
108     <ResourceSetter property="gpsButton.label" key="main.gpsButton" />
109   <!--   These are setted on onLocaleChanged()
110     <ResourceSetter property="gpsData.label" key="main.gps_data" />
111     <ResourceSetter property="myTrack.label" key="main.my_track" />
112     <ResourceSetter property="clearGps.label" key="main.clear_gps" />
113     -->
114   </ResourceInjector>
115
116   <ResourceInjector bundleName="p2_main" target="{OAuthPanel}">
117     <ResourceSetter property="gotLinkBox.text" key="oauth.gotLinkBox" />
118     <ResourceSetter property="authorized.text" key="oauth.authorized" />
119     <ResourceSetter property="deniedLabel.text" key="oauth.deniedLabel" />
120     <ResourceSetter property="rememberMe.label" key="oauth.rememberMe" />
121     <ResourceSetter property="permFail.htmlText" key="oauth.permFail" />
122     <ResourceSetter property="tempFail.text" key="oauth.tempFail" />
123     <ResourceSetter property="tryAccessButton.label" key="oauth.tryAccessButton" />
124     <ResourceSetter property="cancelButton.label" key="oauth.cancelButton" />
125   </ResourceInjector>
126
127   <ResourceInjector bundleName="p2_main" target="{TagViewer}">
128     <ResourceSetter property="dndPrompt" key="tag_viewer.dndprompt" />
129   </ResourceInjector>
130
131   <ResourceInjector bundleName="p2_main" target="{Toolbox}">
132     <ResourceSetter property="deleteNode" key="toolbox.delete_node" />
133     <ResourceSetter property="deleteWay" key="toolbox.delete_way" />
134     <ResourceSetter property="deleteArea" key="toolbox.delete_area" />
135     <ResourceSetter property="deleteItem" key="toolbox.delete_item" />
136     <ResourceSetter property="reverseButton.toolTip" key="toolbox.reverse_direction" />
137     <ResourceSetter property="splitButton.toolTip" key="toolbox.split_way" />
138     <ResourceSetter property="mergeButton.toolTip" key="toolbox.merge_ways" />
139     <ResourceSetter property="straightenButton.toolTip" key="toolbox.straighten_way" />
140     <ResourceSetter property="circulariseButton.toolTip" key="toolbox.make_circular" />
141     <ResourceSetter property="quadrilateraliseButton.toolTip" key="toolbox.make_right_angled" />
142     <ResourceSetter property="parralleliseButton.toolTip" key="toolbox.create_parrallel_way" />
143   </ResourceInjector>
144
145   <ResourceInjector bundleName="p2_main" target="{StyleSelector}">
146     <ResourceSetter property="editButton.label" key="styleSelector.editButton" />
147   </ResourceInjector>
148
149   <ResourceInjector bundleName="p2_main" target="{BackgroundSelector}">
150     <ResourceSetter property="dim.label" key="backgroundSelector.dim" />
151     <ResourceSetter property="sharpen.label" key="backgroundSelector.sharpen" />
152     <ResourceSetter property="editButton.label" key="backgroundSelector.editButton" />
153     <ResourceSetter property="vectorButton.label" key="backgroundSelector.vectorButton" />
154   </ResourceInjector>
155
156   <ResourceInjector bundleName="p2_main" target="{SaveDialog}">
157     <ResourceSetter property="editDescription.text" key="save.editDescription" />
158     <ResourceSetter property="databaseWarning.text" key="save.databaseWarning" />
159     <ResourceSetter property="commentLabel.label" key="save.commentLabel" />
160   </ResourceInjector>
161
162   <ResourceInjector bundleName="p2_main" target="{OptionsDialog}">
163     <ResourceSetter property="tbcheck.label" key="options.tbcheck" />
164     <ResourceSetter property="cursorcheck.label" key="options.cursorcheck" />
165     <ResourceSetter property="ok.label" key="option.ok" />
166   </ResourceInjector>
167 </LocaleMap>