Use public vars for toolbox delete strings so that they can be translated
authorAndy Allan <gravitystorm@gmail.com>
Wed, 23 Feb 2011 18:28:32 +0000 (18:28 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 9 Mar 2011 11:01:09 +0000 (11:01 +0000)
l10n/locale/en_GB/p2_main.properties
l10n/map/LocalizationMap.mxml
net/systemeD/potlatch2/Toolbox.mxml

index 310b119..8b5746d 100644 (file)
@@ -11,3 +11,8 @@ 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"
\ No newline at end of file
index bb91c70..6485876 100644 (file)
@@ -13,7 +13,7 @@
 
       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();
     <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" />
+  </SmartResourceInjector>
 </LocaleMap>
\ No newline at end of file
index 135629a..14c7a12 100644 (file)
         [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 {