From a4bc897f766d2c074eeee44ae96b6f549a8e6e25 Mon Sep 17 00:00:00 2001 From: Joshua Ogunyinka Date: Mon, 10 Jan 2022 11:13:19 +0400 Subject: [PATCH] Add missing language strings for preview editor/new brush/inks/mask by color --- data/strings/en.ini | 21 ++++++++++++++++++++- src/app/commands/cmd_mask_by_color.cpp | 14 ++++++++------ src/app/commands/cmd_new_brush.cpp | 5 +++-- src/app/commands/cmd_sprite_properties.cpp | 2 +- src/app/tools/ink_type.cpp | 13 +++++++------ src/app/ui/editor/editor.cpp | 8 ++++---- src/app/ui/preview_editor.cpp | 3 ++- 7 files changed, 45 insertions(+), 21 deletions(-) diff --git a/data/strings/en.ini b/data/strings/en.ini index 275a7b778..7bbd172f5 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -914,6 +914,7 @@ the given option as the default option. END reset = Reset advanced_options = Advanced Options +unknown = Unknown [gif_options] title = GIF Options @@ -1291,11 +1292,23 @@ help_twitter = Twitter help_enter_license = Enter &License help_about = &About +[mask_by_color] +title = Select Color +label_color = Color: +tolerance = Tolerance: +preview = &Preview +ok = &OK +cancel = &Cancel + [modify_selection] title = Modify Selection circle = Circle Brush square = Square Brush +[new_brush] +shortcut = Shortcut: +context_bar_help = Select brush bounds | Right-click to cut + [new_folder] title = New Folder folder_name = Folder Name: @@ -1740,6 +1753,13 @@ color = Color: antialias = Anti-aliasing filter antialias_tooltip = Smooth font edges +[preview] +title = Preview +speed_x = Speed x{} +play_once = Play Once +play_all_no_tags = Play All Frames (Ignore Tags) +rewind_on_stop = Rewind on Stop + [recover_files] title = Recover Files recover_sprite = Recover Sprite @@ -1864,7 +1884,6 @@ convert_color_profile = Convert rgb = RGB grayscale = Grayscale indexed_color = Indexed ({0} colors) -unknown = Unknown indexed_image_only = (only for indexed images) assign_color_profile = Assign Color Profile convert_color_profile = Convert Color Profile diff --git a/src/app/commands/cmd_mask_by_color.cpp b/src/app/commands/cmd_mask_by_color.cpp index e0c0b3dc4..89a355073 100644 --- a/src/app/commands/cmd_mask_by_color.cpp +++ b/src/app/commands/cmd_mask_by_color.cpp @@ -18,6 +18,7 @@ #include "app/context_access.h" #include "app/doc.h" #include "app/ini_file.h" +#include "app/i18n/strings.h" #include "app/modules/editors.h" #include "app/modules/gui.h" #include "app/tx.h" @@ -106,7 +107,8 @@ void MaskByColorCommand::onExecute(Context* context) if (!image) return; - std::unique_ptr win(new Window(Window::WithTitleBar, "Mask by Color")); + std::unique_ptr win( + new Window(Window::WithTitleBar, Strings::mask_by_color_title())); base::ScopedValue setWindow(m_window, win.get(), nullptr); TooltipManager* tooltipManager = new TooltipManager(); m_window->addChild(tooltipManager); @@ -114,20 +116,20 @@ void MaskByColorCommand::onExecute(Context* context) auto box2 = new Box(HORIZONTAL); auto box3 = new Box(HORIZONTAL); auto box4 = new Box(HORIZONTAL | HOMOGENEOUS); - auto label_color = new Label("Color:"); + auto label_color = new Label(Strings::mask_by_color_label_color()); m_buttonColor = new ColorButton( ColorBar::instance()->getFgColor(), sprite->pixelFormat(), ColorButtonOptions()); - auto label_tolerance = new Label("Tolerance:"); + auto label_tolerance = new Label(Strings::mask_by_color_tolerance()); m_sliderTolerance = new Slider(0, 255, get_config_int(ConfigSection, "Tolerance", 0)); m_selMode = new SelModeField; m_selMode->setupTooltips(tooltipManager); - m_checkPreview = new CheckBox("&Preview"); - auto button_ok = new Button("&OK"); - auto button_cancel = new Button("&Cancel"); + m_checkPreview = new CheckBox(Strings::mask_by_color_preview()); + auto button_ok = new Button(Strings::mask_by_color_ok()); + auto button_cancel = new Button(Strings::mask_by_color_cancel()); m_checkPreview->processMnemonicFromText(); button_ok->processMnemonicFromText(); diff --git a/src/app/commands/cmd_new_brush.cpp b/src/app/commands/cmd_new_brush.cpp index cf0f44c07..cfd7975bd 100644 --- a/src/app/commands/cmd_new_brush.cpp +++ b/src/app/commands/cmd_new_brush.cpp @@ -15,6 +15,7 @@ #include "app/commands/commands.h" #include "app/console.h" #include "app/context_access.h" +#include "app/i18n/strings.h" #include "app/modules/editors.h" #include "app/tools/active_tool.h" #include "app/tools/ink.h" @@ -46,7 +47,7 @@ protected: void onQuickboxCancel(Editor* editor) override; std::string onGetContextBarHelp() override { - return "Select brush bounds | Right-click to cut"; + return Strings::new_brush_context_bar_help(); } private: @@ -173,7 +174,7 @@ void NewBrushCommand::createBrush(const Site& site, const Mask* mask) CommandId::ChangeBrush(), params); if (key && !key->accels().empty()) { std::string tooltip; - tooltip += "Shortcut: "; + tooltip += Strings::new_brush_shortcut() + " "; tooltip += key->accels().front().toString(); StatusBar::instance()->showTip(2000, tooltip); } diff --git a/src/app/commands/cmd_sprite_properties.cpp b/src/app/commands/cmd_sprite_properties.cpp index 288d87a10..0a3406363 100644 --- a/src/app/commands/cmd_sprite_properties.cpp +++ b/src/app/commands/cmd_sprite_properties.cpp @@ -133,7 +133,7 @@ void SpritePropertiesCommand::onExecute(Context* context) break; default: ASSERT(false); - imgtype_text = Strings::sprite_properties_unknown(); + imgtype_text = Strings::general_unknown(); break; } diff --git a/src/app/tools/ink_type.cpp b/src/app/tools/ink_type.cpp index 0af9d25e1..d47bc137d 100644 --- a/src/app/tools/ink_type.cpp +++ b/src/app/tools/ink_type.cpp @@ -10,6 +10,7 @@ #endif #include "app/tools/ink_type.h" +#include "app/i18n/strings.h" namespace app { namespace tools { @@ -17,13 +18,13 @@ namespace tools { std::string ink_type_to_string(InkType inkType) { switch (inkType) { - case tools::InkType::SIMPLE: return "Simple Ink"; - case tools::InkType::ALPHA_COMPOSITING: return "Alpha Compositing"; - case tools::InkType::COPY_COLOR: return "Copy Color+Alpha"; - case tools::InkType::LOCK_ALPHA: return "Lock Alpha"; - case tools::InkType::SHADING: return "Shading"; + case tools::InkType::SIMPLE: return Strings::inks_simple_ink(); + case tools::InkType::ALPHA_COMPOSITING: return Strings::inks_alpha_compositing(); + case tools::InkType::COPY_COLOR: return Strings::inks_copy_color(); + case tools::InkType::LOCK_ALPHA: return Strings::inks_lock_alpha(); + case tools::InkType::SHADING: return Strings::inks_shading(); } - return "Unknown"; + return Strings::general_unknown(); } std::string ink_type_to_string_id(InkType inkType) diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index a649c472a..619aee24d 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -2798,7 +2798,7 @@ void Editor::showAnimationSpeedMultiplierPopup(Option& playOnce, Menu menu; for (double option : options) { - MenuItem* item = new MenuItem(fmt::format("Speed x{}", option)); + MenuItem* item = new MenuItem(fmt::format(Strings::preview_speed_x(), option)); item->Click.connect([this, option]{ setAnimationSpeedMultiplier(option); }); item->setSelected(m_aniSpeed == option); menu.addChild(item); @@ -2808,7 +2808,7 @@ void Editor::showAnimationSpeedMultiplierPopup(Option& playOnce, // Play once option { - MenuItem* item = new MenuItem("Play Once"); + MenuItem* item = new MenuItem(Strings::preview_play_once()); item->Click.connect( [&playOnce]() { playOnce(!playOnce()); @@ -2819,7 +2819,7 @@ void Editor::showAnimationSpeedMultiplierPopup(Option& playOnce, // Play all option { - MenuItem* item = new MenuItem("Play All Frames (Ignore Tags)"); + MenuItem* item = new MenuItem(Strings::preview_play_all_no_tags()); item->Click.connect( [&playAll]() { playAll(!playAll()); @@ -2829,7 +2829,7 @@ void Editor::showAnimationSpeedMultiplierPopup(Option& playOnce, } if (withStopBehaviorOptions) { - MenuItem* item = new MenuItem("Rewind on Stop"); + MenuItem* item = new MenuItem(Strings::preview_rewind_on_stop()); item->Click.connect( []() { // Switch the "rewind_on_stop" option diff --git a/src/app/ui/preview_editor.cpp b/src/app/ui/preview_editor.cpp index 62c321011..7c9c5bd64 100644 --- a/src/app/ui/preview_editor.cpp +++ b/src/app/ui/preview_editor.cpp @@ -16,6 +16,7 @@ #include "app/doc_event.h" #include "app/ini_file.h" #include "app/loop_tag.h" +#include "app/i18n/strings.h" #include "app/modules/editors.h" #include "app/modules/gui.h" #include "app/pref/preferences.h" @@ -176,7 +177,7 @@ private: }; PreviewEditorWindow::PreviewEditorWindow() - : Window(WithTitleBar, "Preview") + : Window(WithTitleBar, Strings::preview_title()) , m_docView(NULL) , m_centerButton(new MiniCenterButton()) , m_playButton(new MiniPlayButton())