From a555c65ae35908a8206c33deeea539abad3d2d0b Mon Sep 17 00:00:00 2001 From: Cameron White Date: Fri, 22 Dec 2023 23:51:05 -0500 Subject: [PATCH] Some initial work on improving add-in localization The goal is to allow add-ins to be translated on Weblate alongside the main Pinta project, and then also ship these translations with the add-in. Using resource files rather than gettext works better, since the 'mautil pack' command for building the addin will automatically pull in the satellite assemblies for the resources. The string table localizer is an adhoc format that isn't understood by any other tools like Weblate - Added missing translation strings for the effect properties. - Switch to a string resource localizer for the reasons mentioned above. - For now, the add-in header properties (description, etc) are left as-is in the XML file. It doesn't seem like there is a way to get these to be translated by the addin's localizer, so the solution is probably to generate a new .addin-xml automatially from the .resx files. --- NightVisionAddin/.addin.xml | 25 +--- NightVisionAddin/NightVisionEffect.cs | 3 +- NightVisionAddin/Resources/Language.es.resx | 136 +++++++++++++++++++ NightVisionAddin/Resources/Language.resx | 140 ++++++++++++++++++++ 4 files changed, 284 insertions(+), 20 deletions(-) create mode 100644 NightVisionAddin/Resources/Language.es.resx create mode 100644 NightVisionAddin/Resources/Language.resx diff --git a/NightVisionAddin/.addin.xml b/NightVisionAddin/.addin.xml index b3705d5..9b72ae3 100644 --- a/NightVisionAddin/.addin.xml +++ b/NightVisionAddin/.addin.xml @@ -3,7 +3,7 @@
Night Vision Effect - A simple add-in that will recolour your image so that it looks like a night vision picture. + A simple add-in that will recolor your image so that it looks like a night vision picture. Pinta Project https://github.com/PintaProject/NightVisionEffect Efecte de visió nocturna @@ -13,25 +13,12 @@ Este complemento coloreará la imagen para que parezca vista a través de un dispositivo de visión nocturna. En enkel effekt som vil endre fargene på bildet ditt slik at det ser ut som det er tatt med nattkikkert.
- + + - - - - - - - - - - - - - - - + + + diff --git a/NightVisionAddin/NightVisionEffect.cs b/NightVisionAddin/NightVisionEffect.cs index 5be977b..06398d4 100644 --- a/NightVisionAddin/NightVisionEffect.cs +++ b/NightVisionAddin/NightVisionEffect.cs @@ -83,9 +83,10 @@ protected override ColorBgra Render (in ColorBgra pixel) public class NightVisionData : EffectData { - [MinimumValue (0), MaximumValue (1)] + [Caption ("Brightness"), MinimumValue (0), MaximumValue (1)] public double Brightness = 0.6; + [Caption ("Noise")] public bool Noise = false; } } diff --git a/NightVisionAddin/Resources/Language.es.resx b/NightVisionAddin/Resources/Language.es.resx new file mode 100644 index 0000000..4e2e6bc --- /dev/null +++ b/NightVisionAddin/Resources/Language.es.resx @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Estilizado + + + + Visión nocturna + + + + Brillo + + + + Efecto de visión nocturna + + + \ No newline at end of file diff --git a/NightVisionAddin/Resources/Language.resx b/NightVisionAddin/Resources/Language.resx new file mode 100644 index 0000000..af2e3db --- /dev/null +++ b/NightVisionAddin/Resources/Language.resx @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Stylize + + + + Night Vision + + + + Brightness + + + + Noise + + + + Night Vision Effect + + + \ No newline at end of file