Skip to content

Commit 6de34f9

Browse files
[widget] add some translation
1 parent 21e481a commit 6de34f9

File tree

7 files changed

+66
-15
lines changed

7 files changed

+66
-15
lines changed

src/acl/module_manager/mod_factory.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void ModFactory::create_valid_message_mod()
358358
{
359359
chars_view ok_text = TR(trkeys::accepted, language(this->ini));
360360
chars_view cancel = TR(trkeys::refused, language(this->ini));
361-
chars_view caption = "Information"_av;
361+
chars_view caption = TR(trkeys::information, language(this->ini));
362362
auto mod_pack = Impl::create_dialog(*this, ok_text, cancel, caption);
363363
Impl::set_mod(*this, ModuleName::valid, mod_pack, false);
364364
}
@@ -367,14 +367,14 @@ void ModFactory::create_display_message_mod()
367367
{
368368
chars_view ok_text = TR(trkeys::OK, language(this->ini));
369369
chars_view cancel = nullptr;
370-
chars_view caption = "Information"_av;
370+
chars_view caption = TR(trkeys::information, language(this->ini));
371371
auto mod_pack = Impl::create_dialog(*this, ok_text, cancel, caption);
372372
Impl::set_mod(*this, ModuleName::confirm, mod_pack, false);
373373
}
374374

375375
void ModFactory::create_dialog_challenge_mod()
376376
{
377-
chars_view caption = "Challenge"_av;
377+
chars_view caption = TR(trkeys::challenge, language(this->ini));
378378
const auto challenge = this->ini.get<cfg::context::authentication_challenge>()
379379
? DialogWithChallengeMod::ChallengeOpt::Echo
380380
: DialogWithChallengeMod::ChallengeOpt::Hide;
@@ -398,18 +398,17 @@ void ModFactory::create_dialog_challenge_mod()
398398

399399
void ModFactory::create_display_link_mod()
400400
{
401-
chars_view caption = "URL Redirection"_av;
402-
chars_view link_label = "Copy to clipboard: "_av;
403401
auto new_mod = new WidgetDialogWithCopyableLinkMod(
404402
this->ini,
405403
this->graphics,
406404
this->client_info.screen_info.width,
407405
this->client_info.screen_info.height,
408406
this->rail_client_execute.adjust_rect(this->client_info.get_widget_rect()),
409-
caption,
407+
TR(trkeys::link_caption, language(ini)),
410408
this->ini.get<cfg::context::message>(),
411409
this->ini.get<cfg::context::display_link>(),
412-
link_label,
410+
TR(trkeys::link_label, language(ini)),
411+
TR(trkeys::link_copied, language(ini)),
413412
this->rail_client_execute,
414413
this->glyphs,
415414
this->theme,

src/mod/internal/dialog_mod.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ WidgetDialogWithCopyableLinkMod::WidgetDialogWithCopyableLinkMod(
121121
gdi::GraphicApi & drawable,
122122
uint16_t width, uint16_t height,
123123
Rect const widget_rect, chars_view caption, chars_view message,
124-
chars_view link_value, chars_view link_label,
124+
chars_view link_value, chars_view link_label, chars_view copied_msg_label,
125125
ClientExecute & rail_client_execute,
126126
Font const& font, Theme const& theme, CopyPaste& copy_paste
127127
)
@@ -138,8 +138,7 @@ WidgetDialogWithCopyableLinkMod::WidgetDialogWithCopyableLinkMod(
138138
this->set_mod_signal(BACK_EVENT_NEXT);
139139
}
140140
},
141-
caption, message, link_value, link_label,
142-
TR(trkeys::link_copied, language(vars)),
141+
caption, message, link_value, link_label, copied_msg_label,
143142
TR(trkeys::OK, language(vars)),
144143
font, theme, copy_paste)
145144
, vars(vars)

src/mod/internal/dialog_mod.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class WidgetDialogWithCopyableLinkMod : public RailInternalModBase
111111
gdi::GraphicApi & drawable,
112112
uint16_t width, uint16_t height,
113113
Rect const widget_rect, chars_view caption, chars_view message,
114-
chars_view link_value, chars_view link_label,
114+
chars_view link_value, chars_view link_label, chars_view copied_msg_label,
115115
ClientExecute & rail_client_execute,
116116
Font const& font, Theme const& theme, CopyPaste& copy_paste);
117117

src/utils/trkeys.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ namespace trkeys
212212
TR_KV(accepted, "I accept");
213213
TR_KV(refused, "I decline");
214214

215-
// ModuleName::link_confirm / WidgetDialogWithCopyableLink
215+
// ModuleName::challenge
216+
TR_KV(challenge, "Challenge");
217+
218+
// ModuleName::link_confirm
219+
TR_KV(link_caption, "URL Redirection");
220+
TR_KV(link_label, "Copy to clipboard: ");
216221
TR_KV(link_copied, "The link is copied.");
217222

218223
#undef TR_KV

tools/i18n/po/en/redemption.po

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-06-20 15:39+0200\n"
10+
"POT-Creation-Date: 2024-11-13 16:20+0100\n"
1111
"PO-Revision-Date: 2021-03-01 14:06+0100\n"
1212
"Last-Translator: Automatically generated\n"
1313
"Language-Team: none\n"
@@ -505,3 +505,19 @@ msgstr ""
505505
#: src/utils/trkeys.hpp:213
506506
msgid "I decline"
507507
msgstr ""
508+
509+
#: src/utils/trkeys.hpp:216
510+
msgid "Challenge"
511+
msgstr ""
512+
513+
#: src/utils/trkeys.hpp:219
514+
msgid "URL Redirection"
515+
msgstr ""
516+
517+
#: src/utils/trkeys.hpp:220
518+
msgid "Copy to clipboard: "
519+
msgstr ""
520+
521+
#: src/utils/trkeys.hpp:221
522+
msgid "The link is copied."
523+
msgstr ""

tools/i18n/po/fr/redemption.po

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-06-20 15:39+0200\n"
11+
"POT-Creation-Date: 2024-11-13 16:20+0100\n"
1212
"PO-Revision-Date: 2021-03-01 15:52+0100\n"
1313
"Last-Translator: Automatically generated\n"
1414
"Language-Team: none\n"
@@ -522,3 +522,19 @@ msgstr "J'accepte"
522522
#: src/utils/trkeys.hpp:213
523523
msgid "I decline"
524524
msgstr "Je refuse"
525+
526+
#: src/utils/trkeys.hpp:216
527+
msgid "Challenge"
528+
msgstr ""
529+
530+
#: src/utils/trkeys.hpp:219
531+
msgid "URL Redirection"
532+
msgstr ""
533+
534+
#: src/utils/trkeys.hpp:220
535+
msgid "Copy to clipboard: "
536+
msgstr ""
537+
538+
#: src/utils/trkeys.hpp:221
539+
msgid "The link is copied."
540+
msgstr ""

tools/i18n/po/redemption.pot

+17-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-06-20 15:39+0200\n"
11+
"POT-Creation-Date: 2024-11-13 16:20+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -546,3 +546,19 @@ msgstr ""
546546
#: src/utils/trkeys.hpp:213
547547
msgid "I decline"
548548
msgstr ""
549+
550+
#: src/utils/trkeys.hpp:216
551+
msgid "Challenge"
552+
msgstr ""
553+
554+
#: src/utils/trkeys.hpp:219
555+
msgid "URL Redirection"
556+
msgstr ""
557+
558+
#: src/utils/trkeys.hpp:220
559+
msgid "Copy to clipboard: "
560+
msgstr ""
561+
562+
#: src/utils/trkeys.hpp:221
563+
msgid "The link is copied."
564+
msgstr ""

0 commit comments

Comments
 (0)