Bläddra i källkod

Missing keys and stuff

Krzysztof Krysiński 2 år sedan
förälder
incheckning
2c3dc114d4

+ 11 - 2
src/PixiEditor.ChangeableDocument/Enums/SelectionMode.cs

@@ -1,5 +1,14 @@
-namespace PixiEditor.ChangeableDocument.Enums;
+using System.ComponentModel;
+
+namespace PixiEditor.ChangeableDocument.Enums;
 public enum SelectionMode
 {
-    New, Add, Subtract, Intersect
+    [Description("NEW")]
+    New,
+    [Description("ADD")]
+    Add,
+    [Description("SUBTRACT")]
+    Subtract,
+    [Description("INTERSECT")]
+    Intersect
 }

+ 4 - 3
src/PixiEditor/Data/Localization/Languages/en.json

@@ -174,8 +174,8 @@
   "INTERSECT": "Intersect",
   "RECTANGLE": "Rectangle",
   "CIRCLE": "Circle",
-  "ALL LAYERS": "All Layers",
-  "SINGLE LAYER": "Single Layer",
+  "ALL_LAYERS": "All Layers",
+  "SINGLE_LAYER": "Single Layer",
 
   "PATH_DOES_NOT_EXIST": "{0} does not exist.",
   "LOCATION_DOES_NOT_EXIST": "Location does not exist.",
@@ -271,7 +271,6 @@
   "PUT_REFERENCE_LAYER_BELOW": "Put reference layer below",
 
   "CLIP_CANVAS": "Clip Canvas",
-  "CLIP_LAYER_BELOW": "Clip with layer below",
   "FLIP": "Flip",
   "FLIP_IMG_VERTICALLY": "Flip Image Vertically",
   "FLIP_IMG_HORIZONTALLY": "Flip Image Horizontally",
@@ -480,6 +479,8 @@
   "STOP_IT_TEXT3": "No, really, stop it.",
   "STOP_IT_TEXT4": "Don't you have anything better to do?",
 
+  "CHOOSE": "Choose",
+  "REMOVE": "Remove",
   "REPLACER_TOOLTIP": "Right click on palette color and choose 'Replace' or drop it here.",
   "CLICK_TO_CHOOSE_COLOR": "Click to choose the color",
   "REPLACE_COLOR": "Replace color",

+ 4 - 3
src/PixiEditor/Models/DocumentModels/DocumentStructureHelper.cs

@@ -1,4 +1,5 @@
 using PixiEditor.ChangeableDocument.Enums;
+using PixiEditor.Localization;
 using PixiEditor.Models.Enums;
 using PixiEditor.ViewModels.SubViewModels.Document;
 
@@ -34,7 +35,7 @@ internal class DocumentStructureHelper
             Guid guid = Guid.NewGuid();
             //put member on top
             internals.ActionAccumulator.AddActions(new CreateStructureMember_Action(doc.StructureRoot.GuidValue, guid, doc.StructureRoot.Children.Count, type));
-            name ??= GetUniqueName(type == StructureMemberType.Layer ? "New Layer" : "New Folder", doc.StructureRoot);
+            name ??= GetUniqueName(type == StructureMemberType.Layer ? new LocalizedString("NEW_LAYER") : new LocalizedString("NEW_FOLDER"), doc.StructureRoot);
             internals.ActionAccumulator.AddActions(new StructureMemberName_Action(guid, name));
             if (finish)
                 internals.ActionAccumulator.AddFinishedActions();
@@ -45,7 +46,7 @@ internal class DocumentStructureHelper
             Guid guid = Guid.NewGuid();
             //put member inside folder on top
             internals.ActionAccumulator.AddActions(new CreateStructureMember_Action(folder.GuidValue, guid, folder.Children.Count, type));
-            name ??= GetUniqueName(type == StructureMemberType.Layer ? "New Layer" : "New Folder", folder);
+            name ??= GetUniqueName(type == StructureMemberType.Layer ? new LocalizedString("NEW_LAYER") : new LocalizedString("NEW_FOLDER"), folder);
             internals.ActionAccumulator.AddActions(new StructureMemberName_Action(guid, name));
             if (finish)
                 internals.ActionAccumulator.AddFinishedActions();
@@ -60,7 +61,7 @@ internal class DocumentStructureHelper
                 throw new InvalidOperationException("Couldn't find a path to the selected member");
             FolderViewModel parent = (FolderViewModel)path[1];
             internals.ActionAccumulator.AddActions(new CreateStructureMember_Action(parent.GuidValue, guid, parent.Children.IndexOf(layer) + 1, type));
-            name ??= GetUniqueName(type == StructureMemberType.Layer ? "New Layer" : "New Folder", parent);
+            name ??= GetUniqueName(type == StructureMemberType.Layer ? new LocalizedString("NEW_LAYER") : new LocalizedString("NEW_FOLDER"), parent);
             internals.ActionAccumulator.AddActions(new StructureMemberName_Action(guid, name));
             if (finish)
                 internals.ActionAccumulator.AddFinishedActions();

+ 3 - 3
src/PixiEditor/Models/Enums/DocumentScope.cs

@@ -4,8 +4,8 @@ namespace PixiEditor.Models.Enums;
 
 public enum DocumentScope
 {
-    [Description("Single Layer")]
+    [Description("SINGLE_LAYER")]
     SingleLayer,
-    [Description("All Layers")]
+    [Description("ALL_LAYERS")]
     AllLayers
-}
+}

+ 4 - 1
src/PixiEditor/Models/Enums/SelectionShape.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -8,6 +9,8 @@ namespace PixiEditor.Models.Enums;
 
 public enum SelectionShape
 {
+    [Description("RECTANGLE")]
     Rectangle,
+    [Description("CIRCLE")]
     Circle
-}
+}

+ 1 - 1
src/PixiEditor/ViewModels/SubViewModels/Tools/ToolSettings/Settings/EnumSetting.cs

@@ -98,7 +98,7 @@ internal sealed class EnumSetting<TEnum> : Setting<TEnum, ComboBox>
                 Tag = value
             };
 
-            Translator.SetKey(item, value.GetDescription().ToUpper());
+            Translator.SetKey(item, value.GetDescription());
 
             comboBox.Items.Add(item);
         }

+ 1 - 1
src/PixiEditor/Views/UserControls/Layers/LayerControl.xaml

@@ -136,7 +136,7 @@
                 <MenuItem 
                     IsCheckable="True" 
                     IsChecked="{Binding PlacementTarget.Tag.Layer.ClipToMemberBelowEnabledBindable, RelativeSource={RelativeSource AncestorType=ContextMenu}}" 
-                    views:Translator.Key="CLIP_LAYER_BELOW"/>
+                    views:Translator.Key="CLIP_TO_BELOW"/>
                 <MenuItem 
                     IsCheckable="True" 
                     IsChecked="{Binding PlacementTarget.Tag.Layer.LockTransparencyBindable, RelativeSource={RelativeSource AncestorType=ContextMenu}}" 

+ 5 - 5
src/PixiEditor/Views/UserControls/Palettes/PaletteViewer.xaml

@@ -91,12 +91,12 @@
                                 </b:Interaction.Triggers>
                                 <palettes:PaletteColor.ContextMenu>
                                     <ContextMenu>
-                                        <MenuItem Header="Choose" Foreground="White" Click="MenuItem_OnClick"
+                                        <MenuItem views:Translator.Key="CHOOSE" Foreground="White" Click="MenuItem_OnClick"
                                               CommandParameter="{Binding}"/>
-                                        <MenuItem Header="Remove" Foreground="White"
-                                                      Click="RemoveColorMenuItem_OnClick"
-                                                      CommandParameter="{Binding}" />
-                                        <MenuItem Header="Replace" Foreground="White"
+                                        <MenuItem views:Translator.Key="REMOVE" Foreground="White"
+                                                  Click="RemoveColorMenuItem_OnClick"
+                                                  CommandParameter="{Binding}" />
+                                        <MenuItem views:Translator.Key="REPLACE" Foreground="White"
                                                       CommandParameter="{Binding}"
                                                       Click="ReplaceColor_OnClick"/>
                                     </ContextMenu>