From 6de34f9e6047f5dd8d984804932c99022d8910b9 Mon Sep 17 00:00:00 2001 From: Jonathan Poelen Date: Wed, 13 Nov 2024 18:22:55 +0100 Subject: [PATCH] [widget] add some translation --- src/acl/module_manager/mod_factory.cpp | 13 ++++++------- src/mod/internal/dialog_mod.cpp | 5 ++--- src/mod/internal/dialog_mod.hpp | 2 +- src/utils/trkeys.hpp | 7 ++++++- tools/i18n/po/en/redemption.po | 18 +++++++++++++++++- tools/i18n/po/fr/redemption.po | 18 +++++++++++++++++- tools/i18n/po/redemption.pot | 18 +++++++++++++++++- 7 files changed, 66 insertions(+), 15 deletions(-) diff --git a/src/acl/module_manager/mod_factory.cpp b/src/acl/module_manager/mod_factory.cpp index cf3961fd38..801b6b8dc9 100644 --- a/src/acl/module_manager/mod_factory.cpp +++ b/src/acl/module_manager/mod_factory.cpp @@ -358,7 +358,7 @@ void ModFactory::create_valid_message_mod() { chars_view ok_text = TR(trkeys::accepted, language(this->ini)); chars_view cancel = TR(trkeys::refused, language(this->ini)); - chars_view caption = "Information"_av; + chars_view caption = TR(trkeys::information, language(this->ini)); auto mod_pack = Impl::create_dialog(*this, ok_text, cancel, caption); Impl::set_mod(*this, ModuleName::valid, mod_pack, false); } @@ -367,14 +367,14 @@ void ModFactory::create_display_message_mod() { chars_view ok_text = TR(trkeys::OK, language(this->ini)); chars_view cancel = nullptr; - chars_view caption = "Information"_av; + chars_view caption = TR(trkeys::information, language(this->ini)); auto mod_pack = Impl::create_dialog(*this, ok_text, cancel, caption); Impl::set_mod(*this, ModuleName::confirm, mod_pack, false); } void ModFactory::create_dialog_challenge_mod() { - chars_view caption = "Challenge"_av; + chars_view caption = TR(trkeys::challenge, language(this->ini)); const auto challenge = this->ini.get() ? DialogWithChallengeMod::ChallengeOpt::Echo : DialogWithChallengeMod::ChallengeOpt::Hide; @@ -398,18 +398,17 @@ void ModFactory::create_dialog_challenge_mod() void ModFactory::create_display_link_mod() { - chars_view caption = "URL Redirection"_av; - chars_view link_label = "Copy to clipboard: "_av; auto new_mod = new WidgetDialogWithCopyableLinkMod( this->ini, this->graphics, this->client_info.screen_info.width, this->client_info.screen_info.height, this->rail_client_execute.adjust_rect(this->client_info.get_widget_rect()), - caption, + TR(trkeys::link_caption, language(ini)), this->ini.get(), this->ini.get(), - link_label, + TR(trkeys::link_label, language(ini)), + TR(trkeys::link_copied, language(ini)), this->rail_client_execute, this->glyphs, this->theme, diff --git a/src/mod/internal/dialog_mod.cpp b/src/mod/internal/dialog_mod.cpp index 5eb179aaa2..9cccd87782 100644 --- a/src/mod/internal/dialog_mod.cpp +++ b/src/mod/internal/dialog_mod.cpp @@ -121,7 +121,7 @@ WidgetDialogWithCopyableLinkMod::WidgetDialogWithCopyableLinkMod( gdi::GraphicApi & drawable, uint16_t width, uint16_t height, Rect const widget_rect, chars_view caption, chars_view message, - chars_view link_value, chars_view link_label, + chars_view link_value, chars_view link_label, chars_view copied_msg_label, ClientExecute & rail_client_execute, Font const& font, Theme const& theme, CopyPaste& copy_paste ) @@ -138,8 +138,7 @@ WidgetDialogWithCopyableLinkMod::WidgetDialogWithCopyableLinkMod( this->set_mod_signal(BACK_EVENT_NEXT); } }, - caption, message, link_value, link_label, - TR(trkeys::link_copied, language(vars)), + caption, message, link_value, link_label, copied_msg_label, TR(trkeys::OK, language(vars)), font, theme, copy_paste) , vars(vars) diff --git a/src/mod/internal/dialog_mod.hpp b/src/mod/internal/dialog_mod.hpp index 6c000c0956..77b689e4b5 100644 --- a/src/mod/internal/dialog_mod.hpp +++ b/src/mod/internal/dialog_mod.hpp @@ -111,7 +111,7 @@ class WidgetDialogWithCopyableLinkMod : public RailInternalModBase gdi::GraphicApi & drawable, uint16_t width, uint16_t height, Rect const widget_rect, chars_view caption, chars_view message, - chars_view link_value, chars_view link_label, + chars_view link_value, chars_view link_label, chars_view copied_msg_label, ClientExecute & rail_client_execute, Font const& font, Theme const& theme, CopyPaste& copy_paste); diff --git a/src/utils/trkeys.hpp b/src/utils/trkeys.hpp index 2d094ae823..706f0d1234 100644 --- a/src/utils/trkeys.hpp +++ b/src/utils/trkeys.hpp @@ -212,7 +212,12 @@ namespace trkeys TR_KV(accepted, "I accept"); TR_KV(refused, "I decline"); - // ModuleName::link_confirm / WidgetDialogWithCopyableLink + // ModuleName::challenge + TR_KV(challenge, "Challenge"); + + // ModuleName::link_confirm + TR_KV(link_caption, "URL Redirection"); + TR_KV(link_label, "Copy to clipboard: "); TR_KV(link_copied, "The link is copied."); #undef TR_KV diff --git a/tools/i18n/po/en/redemption.po b/tools/i18n/po/en/redemption.po index e7afce64ac..bdde00535c 100644 --- a/tools/i18n/po/en/redemption.po +++ b/tools/i18n/po/en/redemption.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-20 15:39+0200\n" +"POT-Creation-Date: 2024-11-13 16:20+0100\n" "PO-Revision-Date: 2021-03-01 14:06+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -505,3 +505,19 @@ msgstr "" #: src/utils/trkeys.hpp:213 msgid "I decline" msgstr "" + +#: src/utils/trkeys.hpp:216 +msgid "Challenge" +msgstr "" + +#: src/utils/trkeys.hpp:219 +msgid "URL Redirection" +msgstr "" + +#: src/utils/trkeys.hpp:220 +msgid "Copy to clipboard: " +msgstr "" + +#: src/utils/trkeys.hpp:221 +msgid "The link is copied." +msgstr "" diff --git a/tools/i18n/po/fr/redemption.po b/tools/i18n/po/fr/redemption.po index e178f6bb8a..b8ef68d2ef 100644 --- a/tools/i18n/po/fr/redemption.po +++ b/tools/i18n/po/fr/redemption.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-20 15:39+0200\n" +"POT-Creation-Date: 2024-11-13 16:20+0100\n" "PO-Revision-Date: 2021-03-01 15:52+0100\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -522,3 +522,19 @@ msgstr "J'accepte" #: src/utils/trkeys.hpp:213 msgid "I decline" msgstr "Je refuse" + +#: src/utils/trkeys.hpp:216 +msgid "Challenge" +msgstr "" + +#: src/utils/trkeys.hpp:219 +msgid "URL Redirection" +msgstr "" + +#: src/utils/trkeys.hpp:220 +msgid "Copy to clipboard: " +msgstr "" + +#: src/utils/trkeys.hpp:221 +msgid "The link is copied." +msgstr "" diff --git a/tools/i18n/po/redemption.pot b/tools/i18n/po/redemption.pot index 9a50237962..97e2916014 100644 --- a/tools/i18n/po/redemption.pot +++ b/tools/i18n/po/redemption.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-20 15:39+0200\n" +"POT-Creation-Date: 2024-11-13 16:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -546,3 +546,19 @@ msgstr "" #: src/utils/trkeys.hpp:213 msgid "I decline" msgstr "" + +#: src/utils/trkeys.hpp:216 +msgid "Challenge" +msgstr "" + +#: src/utils/trkeys.hpp:219 +msgid "URL Redirection" +msgstr "" + +#: src/utils/trkeys.hpp:220 +msgid "Copy to clipboard: " +msgstr "" + +#: src/utils/trkeys.hpp:221 +msgid "The link is copied." +msgstr ""