From 6cc7ab3f5ac4df088363761aa969664787822f26 Mon Sep 17 00:00:00 2001 From: Oskar Date: Mon, 7 Oct 2024 16:17:51 +0200 Subject: [PATCH 1/2] Fix references to WireGuard and Direct only in help texts --- gui/src/renderer/components/DaitaSettings.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gui/src/renderer/components/DaitaSettings.tsx b/gui/src/renderer/components/DaitaSettings.tsx index 2d09a3996e68..4ddfe6a8538c 100644 --- a/gui/src/renderer/components/DaitaSettings.tsx +++ b/gui/src/renderer/components/DaitaSettings.tsx @@ -104,9 +104,12 @@ export default function DaitaSettings() { )} - {messages.pgettext( - 'wireguard-settings-view', - 'Attention: Be cautious if you have a limited data plan as this feature will increase your network traffic. This feature can only be used with WireGuard.', + {sprintf( + messages.pgettext( + 'wireguard-settings-view', + 'Attention: Be cautious if you have a limited data plan as this feature will increase your network traffic. This feature can only be used with %(wireguard)s.', + ), + { wireguard: strings.wireguard }, )} , @@ -155,6 +158,8 @@ function DaitaToggle() { hideConfirmationDialog(); }, []); + const directOnlyString = messages.gettext('Direct only'); + return ( <> @@ -177,7 +182,7 @@ function DaitaToggle() { - {messages.gettext('Direct only')} + {directOnlyString} @@ -208,7 +213,7 @@ function DaitaToggle() { key="confirm" onClick={confirmEnableDirectOnly} color={SmallButtonColor.blue}> - {messages.gettext('Enable "Direct only"')} + {sprintf(messages.gettext('Enable "%(directOnly)s"'), { directOnly: directOnlyString })} , {messages.pgettext('wireguard-settings-view', 'Cancel')} @@ -231,15 +236,18 @@ function DaitaToggle() { } function DirectOnlyModalMessage() { + const directOnlyString = messages.gettext('Direct only'); + return ( {sprintf( messages.pgettext( 'wireguard-settings-view', - 'By enabling “Direct only” you will have to manually select a server that is %(daita)s-enabled. This can cause you to end up in a blocked state until you have selected a compatible server in the “Select location” view.', + 'By enabling “%(directOnly)s” you will have to manually select a server that is %(daita)s-enabled. This can cause you to end up in a blocked state until you have selected a compatible server in the “Select location” view.', ), { daita: strings.daita, + directOnly: directOnlyString, }, )} From 66aecb635d3484c84780dc3758f98cdcdb1b3660 Mon Sep 17 00:00:00 2001 From: Oskar Date: Mon, 7 Oct 2024 16:18:11 +0200 Subject: [PATCH 2/2] Update translation templates --- gui/locales/messages.pot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/locales/messages.pot b/gui/locales/messages.pot index 174688cf27f7..31110d0b3396 100644 --- a/gui/locales/messages.pot +++ b/gui/locales/messages.pot @@ -152,7 +152,7 @@ msgstr "" msgid "Enable" msgstr "" -msgid "Enable \"Direct only\"" +msgid "Enable \"%(directOnly)s\"" msgstr "" msgid "Enable anyway" @@ -2066,11 +2066,11 @@ msgid "%(wireguard)s settings" msgstr "" msgctxt "wireguard-settings-view" -msgid "Attention: Be cautious if you have a limited data plan as this feature will increase your network traffic. This feature can only be used with WireGuard." +msgid "Attention: Be cautious if you have a limited data plan as this feature will increase your network traffic. This feature can only be used with %(wireguard)s." msgstr "" msgctxt "wireguard-settings-view" -msgid "By enabling “Direct only” you will have to manually select a server that is %(daita)s-enabled. This can cause you to end up in a blocked state until you have selected a compatible server in the “Select location” view." +msgid "By enabling “%(directOnly)s” you will have to manually select a server that is %(daita)s-enabled. This can cause you to end up in a blocked state until you have selected a compatible server in the “Select location” view." msgstr "" msgctxt "wireguard-settings-view"