Browse Source

More localization stuff

Krzysztof Krysiński 1 week ago
parent
commit
013d6de806

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

@@ -1150,8 +1150,6 @@
   "TOGGLE_TINTING_SELECTION": "Toggle selection tinting",
   "TOGGLE_TINTING_SELECTION_DESCRIPTIVE": "Toggle selection tinting",
   "TINT_SELECTION": "Selection tinting",
-  "PAINT_BRUSH_SHAPE_CIRCLE": "Circle",
-  "PAINT_BRUSH_SHAPE_SQUARE": "Square",
   "BRIGHTNESS_MODE_DEFAULT": "Default",
   "BRIGHTNESS_MODE_REPEAT": "Repeat",
   "ROUND_STROKE_CAP": "Round",
@@ -1207,7 +1205,6 @@
   "BRUSH": "Brush",
   "UNLINK": "Unlink",
   "UNLINK_DESCRIPTIVE": "Unlink this layer from the original document",
-  "CANNOT_SAVE_NESTED_DOCUMENT_PARENT_CLOSED": "Cannot save nested document because the parent document is not open.",
   "INPUTS": "Inputs",
   "BRUSHES": "Brushes",
   "EDITOR": "Editor",
@@ -1282,5 +1279,5 @@
   "TARGET_BLEND_MODE": "Target",
   "LAST_APPLIED_POINT": "Last Applied Point",
   "VIEWPORT_INFO_NODE": "Viewport Info",
-  "EQUALS_NODE": "Equals"
+  "EQUALS_NODE": "Equals",
 }

+ 14 - 0
src/PixiEditor/Helpers/LocalizedKeyAttribute.cs

@@ -0,0 +1,14 @@
+namespace PixiEditor.Helpers;
+
+public interface ILocalizedKeyInfo
+{
+    public string LocalizationKey { get; }
+    public string Location { get; }
+}
+
+[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
+public class LocalizedKeyAttribute(string key, string whereItIsUsed) : Attribute, ILocalizedKeyInfo
+{
+    public string LocalizationKey { get; } = key;
+    public string Location { get; } = whereItIsUsed;
+}

+ 4 - 0
src/PixiEditor/Models/MarkedLocalizationKeys.cs

@@ -0,0 +1,4 @@
+using PixiEditor.Helpers;
+
+[assembly:LocalizedKey("HARDNESS_SETTING", "Used as a blackboard variable within brush inside built-in .pixi files.")]
+[assembly:LocalizedKey("SPACING_SETTING", "Used as a blackboard variable within brush inside built-in .pixi files.")]