Make the dndPrompt text public, and translatable
[potlatch2.git] / l10n / map / LocalizationMap.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <LocaleMap enableLog="true"
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
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                                 ];
25
26           // Iterate all view instances and inject new dataProvider
27           for each (var inst:potlatch2 in sri.targetInstances) {
28               if (inst == null) continue;
29               inst.gpsButton.dataProvider = options;
30           }
31       }
32     ]]>
33   </mx:Script>
34
35   <commandFactory>
36     <factory:ClassFactory generator="{ExternalLocaleCommand}">
37       <factory:properties>
38         <mx:Object externalPath="locales/\{0\}.swf"/>
39       </factory:properties>
40     </factory:ClassFactory>
41   </commandFactory>
42
43   <!--
44   SmartResourceInjectors for targeted class instantiations. Instead of dependency injection of UI instances,
45   we use SRI(s) here to remove any need to know view hierarchy relationships... we simply want a reference
46   to the UI instance when ready.
47   -->
48
49   <SmartResourceInjector bundleName="help_dialog" target="{HelpDialog}">
50     <ResourceProxy property="gettingStarted.text" key="help.gettingStarted" />
51     <ResourceProxy property="welcome.label" key="help.welcome" />
52   </SmartResourceInjector>
53
54   <SmartResourceInjector bundleName="p2_main" target="{potlatch2}" localeChange="onLocaleChanged(event)">
55     <ResourceProxy property="bgButton.label" key="main.background" />
56     <ResourceProxy property="styleButton.label" key="main.map_style" />
57     <ResourceProxy property="undo.label" key="main.undo" />
58     <ResourceProxy property="redo.label" key="main.redo" />
59     <ResourceProxy property="helpButton.label" key="main.help" />
60     <ResourceProxy property="optionsButton.label" key="main.options" />
61     <ResourceProxy property="saveButton.label" key="main.save" />
62   </SmartResourceInjector>
63
64   <SmartResourceInjector bundleName="p2_main" target="{TagViewer}">
65     <ResourceProxy property="dndPrompt" key="tag_viewer.dndprompt" />
66   </SmartResourceInjector>
67
68 </LocaleMap>