Merge remote-tracking branch 'gravitystorm/i18n' into staging
authorRichard Fairhurst <richard@systemeD.net>
Sat, 2 Apr 2011 16:48:47 +0000 (17:48 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Sat, 2 Apr 2011 16:48:47 +0000 (17:48 +0100)
16 files changed:
CODING.txt
TODO.txt
build.xml
l10n/locale/de_DE/help_dialog.properties [new file with mode: 0644]
l10n/locale/de_DE/p2_main.properties [new file with mode: 0644]
l10n/locale/en_GB/p2_main.properties
l10n/locale/en_US/p2_main.properties
l10n/locale/fr_FR/p2_main.properties
l10n/locale/pl_PL/help_dialog.properties [new file with mode: 0644]
l10n/locale/pl_PL/p2_main.properties [new file with mode: 0644]
l10n/map/LocalizationMap.mxml
lib/Framework_BabelFx-g400a96.swc [new file with mode: 0644]
lib/Framework_BabelFx.swc [deleted file]
net/systemeD/potlatch2/TagViewer.mxml
net/systemeD/potlatch2/Toolbox.mxml
potlatch2.mxml

index 30a4c22ee8efc56a1be855128ba9a5fe5e4cd6a1..4cb2fb27594b95f8f96906305ecf27138eac8b4f 100644 (file)
@@ -46,3 +46,7 @@ package net.systemed.potlatch2.indentation {
 * Way icons for map_features are 75x45 and have up to now generally been drawn by Richard (see way_icons.ai)
 * All features must have a unique icon, and all icons must be in the correct style. Do not add a feature without a matching icon.
 * Only deployable files go in resources/ . Vector source files go in resources_src/
+
+== babelFx ==
+
+* Currently using forked version from https://github.com/gravitystorm/l10n_Injection
index f83d73244eb9f311d11bba9c92fe49327995334d..91b3fe81946d869830ff278aaca20177e12820b8 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -69,6 +69,9 @@ Potlatch 2: main outstanding issues
 == Reverse Button ==
 * Doesn't look like a button
 
+== l10n ==
+* Fix the en_US / default locale problem
+
 Requested enhancements
 ----------------------
 
index f335490ab5a4dec90c0596838e1c1eaf4a790cad..19b91a5a218b1fead6a01be5e570b3509b13412d 100644 (file)
--- a/build.xml
+++ b/build.xml
     <compileLocale locale="en_US" />
     <compileLocale locale="en_GB" />
     <compileLocale locale="fr_FR" />
+    <compileLocale locale="de_DE" />
+    <compileLocale locale="pl_PL" />
   </target>
 
 
     <deployLocale locale="en_US" />
     <deployLocale locale="en_GB" />
     <deployLocale locale="fr_FR" />
+    <deployLocale locale="de_DE" />
+    <deployLocale locale="pl_PL" />
   </target>
 
 </project>
diff --git a/l10n/locale/de_DE/help_dialog.properties b/l10n/locale/de_DE/help_dialog.properties
new file mode 100644 (file)
index 0000000..369a9e4
--- /dev/null
@@ -0,0 +1,4 @@
+# de resources file
+
+help.gettingStarted = So geht's los
+help.welcome = Willkommen
diff --git a/l10n/locale/de_DE/p2_main.properties b/l10n/locale/de_DE/p2_main.properties
new file mode 100644 (file)
index 0000000..f179e69
--- /dev/null
@@ -0,0 +1,25 @@
+# de resources file
+
+main.undo = Rückgängig
+main.redo = Wiederholen
+main.background = Hintergrund
+main.map_style = Map-Stil
+main.gps_data = GPS-Daten
+main.my_tracks = Meine Tracks
+main.help = Hilfe
+main.options = Optionen
+main.save = Speichern
+
+tag_viewer.dndprompt = Neue Punkte durch Ziehen auf die Karte hinzufügen
+
+toolbox.delete_node = Knoten löschen (Entf)
+toolbox.delete_area = Fläche löschen (Umsch+Entf)
+toolbox.delete_way = Weg löschen (Umsch+Entf)
+toolbox.delete_item = Objekt löschen
+toolbox.reverse_direction = Richtung umkehren (V)
+toolbox.split_way = Weg teilen (X)
+toolbox.merge_ways = Wege verbinden
+toolbox.straighten_way = Weg begradigen
+toolbox.make_circular = Kreisförmig anordnen
+toolbox.make_right_angled = Rechtwinklig anordnen (Q)
+toolbox.create_parrallel_way = Parallelen Weg erstellen (P)
\ No newline at end of file
index 3ab35931733c27c7110c6bd5fc60439bb6da3d8c..5093576fe7b1faba55897e65efe62a0bef35677a 100644 (file)
@@ -2,3 +2,24 @@
 
 main.undo = Undo
 main.redo = Redo
+main.background = Background
+main.map_style = Map Style
+main.gps_data = GPS Data
+main.my_tracks = My Tracks
+main.help = Help
+main.options = Options
+main.save = Save
+
+tag_viewer.dndprompt = Add new points by dragging them onto the map
+
+toolbox.delete_node = Delete Node (Delete)
+toolbox.delete_area = Delete Area (Shift+Delete)
+toolbox.delete_way = Delete Way (Shift+Delete)
+toolbox.delete_item = Delete Item
+toolbox.reverse_direction = Reverse direction (V)
+toolbox.split_way = Split way (X)
+toolbox.merge_ways = Merge ways
+toolbox.straighten_way = Straighten Way
+toolbox.make_circular = Make circular
+toolbox.make_right_angled = Make right-angled (Q)
+toolbox.create_parrallel_way = Create parallel way (P)
\ No newline at end of file
index b265c1a2b30ae2b15531e1089429c01e69a4ea34..90372126637aac551302d15017aac2e2229e19b4 100644 (file)
@@ -2,3 +2,10 @@
 
 main.undo = Undo
 main.redo = Redo
+main.background = Background
+main.map_style = Map Style
+main.gps_data = GPS Data
+main.my_tracks = My Tracks
+main.help = Help
+main.options = Options
+main.save = Save
index 9c4955814270556120295906cae7fe59f0e15b03..28100c4412400013cc51d064d5a2e8a9f9cd54b3 100644 (file)
@@ -2,3 +2,12 @@
 
 main.undo = Défaire
 main.redo = Refaire
+main.background = Arrière-plan
+main.map_style = Style de Carte
+main.gps_data = GPS Informations
+main.my_tracks = Mes Pistes
+main.help = Assistance
+main.options = Options
+main.save = Enregistrer
+
+tag_viewer.dndprompt = Ajouter de nouveaux points en les faisant glisser sur la carte
diff --git a/l10n/locale/pl_PL/help_dialog.properties b/l10n/locale/pl_PL/help_dialog.properties
new file mode 100644 (file)
index 0000000..c0c0ebd
--- /dev/null
@@ -0,0 +1,4 @@
+# pl_PL resources file
+
+help.gettingStarted = Pierwsze kroki
+help.welcome = Witaj
diff --git a/l10n/locale/pl_PL/p2_main.properties b/l10n/locale/pl_PL/p2_main.properties
new file mode 100644 (file)
index 0000000..3f88753
--- /dev/null
@@ -0,0 +1,25 @@
+# pl_PL resources file
+
+main.undo = Cofnij
+main.redo = Ponów
+main.background = Tło
+main.map_style = Styl mapy
+main.gps_data = Dane GPS
+main.my_tracks = Moje ślady
+main.help = Pomoc
+main.options = Opcje
+main.save = Zapisz
+
+tag_viewer.dndprompt = Dodaj nowy punkt poprzez przeniesienie go na mapę
+
+toolbox.delete_node = Usuń węzeł (Delete)
+toolbox.delete_area = Usuń obszar (Shift+Delete)
+toolbox.delete_way = Usuń drogę (Shift+Delete)
+toolbox.delete_item = Usuń obiekt
+toolbox.reverse_direction = Odwróć kierunek (V)
+toolbox.split_way = Przetnij drogę (X)
+toolbox.merge_ways = Połącz drogi
+toolbox.straighten_way = Prosta droga
+toolbox.make_circular = Utwórz okrąg
+toolbox.make_right_angled = Utwórz kąty proste (Q)
+toolbox.create_parrallel_way = Stwórz drogę równoległą (P)
index b9a3d7541d0cc56bebbc4816d13bd196768f82a4..843a8a966ae73f250e42807de1df1b4fe06634dd 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LocaleMap enableLog="true"
+<LocaleMap enableLog="false"
     xmlns:mx="http://www.adobe.com/2006/mxml"
     xmlns:factory="mx.core.*"
     xmlns="library://ns.babelfx.org/l10n/flex/" >
@@ -8,8 +8,27 @@
   <mx:Script>
     <![CDATA[
       import com.mindspace.l10n.commands.ExternalLocaleCommand;
+      import mx.resources.ResourceManager;
+      import mx.resources.IResourceManager;
 
       import net.systemeD.potlatch2.help.HelpDialog;
+      import net.systemeD.potlatch2.TagViewer;
+      import net.systemeD.potlatch2.Toolbox;
+
+      private function onLocaleChanged(event:Event):void {
+          var rMngr : IResourceManager = ResourceManager.getInstance();
+          var sri : SmartResourceInjector = event.target as SmartResourceInjector;
+          var options : Array = [
+                                  { label : rMngr.getString('p2_main','main.gps_data') },
+                                  { label : rMngr.getString('p2_main','main.my_tracks') }
+                                ];
+
+          // Iterate all view instances and inject new dataProvider
+          for each (var inst:potlatch2 in sri.targetInstances) {
+              if (inst == null) continue;
+              inst.gpsButton.dataProvider = options;
+          }
+      }
     ]]>
   </mx:Script>
 
     <ResourceProxy property="welcome.label" key="help.welcome" />
   </SmartResourceInjector>
 
-  <SmartResourceInjector bundleName="p2_main" target="{potlatch2}">
+  <SmartResourceInjector bundleName="p2_main" target="{potlatch2}" localeChange="onLocaleChanged(event)">
+    <ResourceProxy property="bgButton.label" key="main.background" />
+    <ResourceProxy property="styleButton.label" key="main.map_style" />
     <ResourceProxy property="undo.label" key="main.undo" />
     <ResourceProxy property="redo.label" key="main.redo" />
+    <ResourceProxy property="helpButton.label" key="main.help" />
+    <ResourceProxy property="optionsButton.label" key="main.options" />
+    <ResourceProxy property="saveButton.label" key="main.save" />
+  </SmartResourceInjector>
+
+  <SmartResourceInjector bundleName="p2_main" target="{TagViewer}">
+    <ResourceProxy property="dndPrompt" key="tag_viewer.dndprompt" />
+  </SmartResourceInjector>
+
+  <SmartResourceInjector bundleName="p2_main" target="{Toolbox}">
+    <ResourceProxy property="deleteNode" key="toolbox.delete_node" />
+    <ResourceProxy property="deleteWay" key="toolbox.delete_way" />
+    <ResourceProxy property="deleteArea" key="toolbox.delete_area" />
+    <ResourceProxy property="deleteItem" key="toolbox.delete_item" />
+    <ResourceProxy property="reverseButton.toolTip" key="toolbox.reverse_direction" />
+    <ResourceProxy property="splitButton.toolTip" key="toolbox.split_way" />
+    <ResourceProxy property="mergeButton.toolTip" key="toolbox.merge_ways" />
+    <ResourceProxy property="straightenButton.toolTip" key="toolbox.straighten_way" />
+    <ResourceProxy property="circulariseButton.toolTip" key="toolbox.make_circular" />
+    <ResourceProxy property="quadrilateraliseButton.toolTip" key="toolbox.make_right_angled" />
+    <ResourceProxy property="parralleliseButton.toolTip" key="toolbox.create_parrallel_way" />
   </SmartResourceInjector>
 
 </LocaleMap>
\ No newline at end of file
diff --git a/lib/Framework_BabelFx-g400a96.swc b/lib/Framework_BabelFx-g400a96.swc
new file mode 100644 (file)
index 0000000..ccba27d
Binary files /dev/null and b/lib/Framework_BabelFx-g400a96.swc differ
diff --git a/lib/Framework_BabelFx.swc b/lib/Framework_BabelFx.swc
deleted file mode 100644 (file)
index 2f84eb7..0000000
Binary files a/lib/Framework_BabelFx.swc and /dev/null differ
index efbf61adf7fc2c8850a6bec7bfc1637064f0983f..b107fe0da2988a5bc608f1cca9a4a3c257da73f7 100644 (file)
       import mx.core.DragSource;
       import flexlib.containers.SuperTabNavigator;
 
-      private static const dndPrompt:String="Add new points by dragging them onto the map";
+      [Bindable]
+      public var dndPrompt:String="Add new points by dragging them onto the map";
 
       private var editorStackTabNavigator:SuperTabNavigator;
       private var editorStackAccordion:Accordion;
index e15b50f9591de85814f43fe78824d6279357b9ff..a553ab6a26ee6b7be38e1db1e0e386dbac23adcf 100644 (file)
                        toolTip="{deleteToolTipText()}" 
                        width="28" height="28" textAlign="left" y="4" x="6" paddingLeft="6" paddingRight="0" />
 
-        <mx:HBox width="28" height="28" y="4" x="36" borderStyle="solid" cornerRadius="4" click="reverseClicked();" horizontalAlign="center" verticalAlign="middle">
-            <mx:ViewStack id="rotateButtonStack">
+        <mx:HBox id="reverseButton" width="28" height="28" y="4" x="36" borderStyle="solid" cornerRadius="4"
+                  click="reverseClicked();" horizontalAlign="center" verticalAlign="middle" toolTip="Reverse direction (V)">
+            <mx:ViewStack id="rotateButtonStack" creationPolicy="all">
                 <mx:HBox id="arrowBoxWrapper"><!-- changing the viewstack back onto a rotated hbox causes positioning glitches, hence this wrapper -->
                     <!-- I can totally recommend adding borderStyle="solid" to arrowBox when debugging -->
                     <mx:HBox id="arrowBox" horizontalAlign="center" verticalAlign="middle" width="24" height="24">
                         <mx:Image id="arrow" source="@Embed('../../../embedded/arrow.svg')"
                             alpha="{getAlpha('reverseDirection')}"
-                            toolTip="Reverse direction (V)"
                             width="22" height="22"/>
                     </mx:HBox>
                 </mx:HBox>
                 <mx:HBox id="clockwiseBox" horizontalAlign="center" verticalAlign="middle">
                     <mx:Image id="clockwise" source="@Embed('../../../embedded/clockwise.svg')"
                         alpha="{getAlpha('reverseDirection')}"
-                        toolTip="Reverse direction (V)"
                         width="22" height="22" x="2" y="2"/>
                 </mx:HBox>
                 <mx:HBox id="antiClockwiseBox" horizontalAlign="center" verticalAlign="middle">
                         click='doReverseDirection();'
                         enabled="{canDo('reverseDirection')}"
                         alpha="{getAlpha('reverseDirection')}"
-                        toolTip="Reverse direction (V)"
                         width="22" height="22" x="2" y="2"/>
                 </mx:HBox>
             </mx:ViewStack>
         </mx:HBox>
                <mx:Button icon="@Embed('../../../embedded/cut.svg')" 
+                       id="splitButton"
                        click='doSplit();'
                        enabled="{canDo('split')}" 
                        alpha="{getAlpha('split')}" 
                        toolTip="Split way (X)" 
                        width="28" height="28" textAlign="left" y="4" x="66" paddingLeft="8" paddingRight="0" />
                <mx:Button icon="@Embed('../../../embedded/merge.svg')" 
+                       id="mergeButton"
                        click='doMerge();'
                        enabled="{canDo('merge')}" 
                        alpha="{getAlpha('merge')}" 
                <!-- Second row -->
 
                <mx:Button icon="@Embed('../../../embedded/straighten.svg')" 
+                       id="straightenButton"
                        click='doStraighten();' 
                        enabled="{canDo('straighten')}" 
                        alpha="{getAlpha('straighten')}" 
                        toolTip="Straighten way" 
                        width="28" height="28" textAlign="left" y="34" x="6" paddingLeft="5" paddingRight="0" />
                <mx:Button icon="@Embed('../../../embedded/circle.svg')" 
+                       id="circulariseButton"
                        click='doCircularise();' 
                        enabled="{canDo('circularise')}" 
                        alpha="{getAlpha('circularise')}" 
                        toolTip="Make circular" 
                        width="28" height="28" textAlign="left" y="34" x="36" paddingLeft="4" paddingRight="0" />
                <mx:Button icon="@Embed('../../../embedded/quadrilateralise.svg')" 
+                       id="quadrilateraliseButton"
                        click='doQuadrilateralise();' 
                        enabled="{canDo('quadrilateralise')}" 
                        alpha="{getAlpha('quadrilateralise')}" 
                        toolTip="Make right-angled (Q)"
                        width="28" height="28" textAlign="left" y="34" x="66" paddingLeft="6" paddingRight="0" />
                <mx:Button icon="@Embed('../../../embedded/parallel.svg')" 
+                       id="parralleliseButton"
                        click='doParallelise();' 
                        enabled="{canDo('parallelise')}" 
                        alpha="{getAlpha('parallelise')}" 
         [Bindable]
         public var angle:int=0;
 
+        public var deleteNode:String = "Delete Node (Delete)";
+        public var deleteArea:String = "Delete Area (Shift+Delete)";
+        public var deleteWay:String = "Delete Way (Shift+Delete)";
+        public var deleteItem:String = "Delete Item"; // When nothing is selected
+
                public function init(controller:EditController):void {
                        this.controller=controller;
                        /* check if the toolbox was explictly turned off in a previous session */
                [Bindable(event="updateSkin")]
                private function deleteToolTipText():String {
                        var entity:Entity=controller.state.firstSelected;
-                       if (entity is Node) { return "Delete Node (Delete)"; }
-                       if (entity is Way && Way(entity).isArea()) { return "Delete Area (Shift+Delete)"; }
-                       if (entity is Way) { return "Delete Way (Shift+Delete)"; }
-                       return "Delete Item"; // When nothing is selected
+                       if (entity is Node) { return deleteNode; }
+                       if (entity is Way && Way(entity).isArea()) { return deleteArea; }
+                       if (entity is Way) { return deleteWay; }
+                       return deleteItem; // When nothing is selected
                }
 
         private function updateDirectionArrow():void {
index a00c46d79ef2defdb1e6441e3fe31cb0a9d4b8bf..fbf700e56f28d06f559188ed520809e240d8f6ba 100644 (file)
@@ -9,7 +9,9 @@
        horizontalAlign="center" 
        addedToStage="initApp()"
        preloader="net.systemeD.potlatch2.Preloader">
-       
+
+    <map:LocalizationMap xmlns:map="l10n.map.*" />
+
        <mx:Style source="styles/Application.css"/>
 
     <mx:Glow id="glowImage" duration="100" 
@@ -38,9 +40,9 @@
                                                     theMap.removeVectorLayer(theMap.findVectorLayer('GPS tracks')); }">
                        <mx:dataProvider>
                                <mx:Array>
-                                       <mx:Object label="GPS data" />
-                                       <mx:Object label="My tracks" />
-                                       <mx:Object label="Clear" />
+                                       <mx:Object label="GPS data" id="gpsData" />
+                                       <mx:Object label="My tracks" id="myTracks" />
+                                       <mx:Object label="Clear" id="clearGps" />
                                </mx:Array>
                        </mx:dataProvider>
                </mx:PopUpMenuButton>
         <mx:Button id="redo" label="Redo" click="MainUndoStack.getGlobalStack().redo();" styleName="appBarButton"
             enabled="{MainUndoStack.getGlobalStack().canRedo()}"/>
         <mx:Spacer width="100%"/>
-        <mx:Button label="Help" click="new HelpDialog().init();" styleName="appBarButton" />
-        <mx:Button label="Options" click="new OptionsDialog().init();" styleName="appBarButton" /> 
+        <mx:Button id="helpButton" label="Help" click="new HelpDialog().init();" styleName="appBarButton" />
+        <mx:Button id="optionsButton" label="Options" click="new OptionsDialog().init();" styleName="appBarButton" />
         <mx:Button label="Save" icon="@Embed('embedded/upload.svg')" disabledIcon="@Embed('embedded/upload_disabled.svg')" styleName="appBarButton"
                        click="SaveManager.saveChanges();" id="saveButton" enabled="false"/>
     </mx:ApplicationControlBar>
-
-    <map:LocalizationMap xmlns:map="l10n.map.*" />
     
     <mx:HDividedBox width="100%" height="100%">
 
 
                private function initApp():void {
 
-            /* For reasons that I don't yet understand, the en_US locale is the default and doesn't work at all. Use en_GB instead. */
-            /* Change this to another locale (e.g. fr_FR) to see the differences. This will obviously become done differently at some point. */
-            dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE,'en_GB'));
+            /* For reasons that I don't yet understand, the en_US locale is the default and doesn't work at all. */
+            /* Change this to another locale (e.g. fr_FR) to see the differences. */
+            if (loaderInfo.parameters['locale']) {
+              dispatchEvent(new LocaleEvent(LocaleEvent.LOAD_LOCALE,loaderInfo.parameters['locale']));
+            }
 
                        Globals.vars.map_area = map_area;
                        Globals.vars.root = map_area.rawChildren;                       // set up global reference to root level