Skip to content

Commit

Permalink
Merge branch 'improve-references-to-settings-and-non-translated-strings'
Browse files Browse the repository at this point in the history
  • Loading branch information
raksooo committed Oct 7, 2024
2 parents bdd4675 + 66aecb6 commit a10c8a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions gui/locales/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ msgstr ""
msgid "Enable"
msgstr ""

msgid "Enable \"Direct only\""
msgid "Enable \"%(directOnly)s\""
msgstr ""

msgid "Enable anyway"
Expand Down Expand Up @@ -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"
Expand Down
20 changes: 14 additions & 6 deletions gui/src/renderer/components/DaitaSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ export default function DaitaSettings() {
)}
</StyledHeaderSubTitle>
<StyledHeaderSubTitle>
{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 },
)}
</StyledHeaderSubTitle>
</React.Fragment>,
Expand Down Expand Up @@ -155,6 +158,8 @@ function DaitaToggle() {
hideConfirmationDialog();
}, []);

const directOnlyString = messages.gettext('Direct only');

return (
<>
<AriaInputGroup>
Expand All @@ -177,7 +182,7 @@ function DaitaToggle() {
<AriaInputGroup>
<Cell.Container disabled={!daita || unavailable}>
<AriaLabel>
<Cell.InputLabel>{messages.gettext('Direct only')}</Cell.InputLabel>
<Cell.InputLabel>{directOnlyString}</Cell.InputLabel>
</AriaLabel>
<InfoButton>
<DirectOnlyModalMessage />
Expand Down Expand Up @@ -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 })}
</SmallButton>,
<SmallButton key="cancel" onClick={hideConfirmationDialog} color={SmallButtonColor.blue}>
{messages.pgettext('wireguard-settings-view', 'Cancel')}
Expand All @@ -231,15 +236,18 @@ function DaitaToggle() {
}

function DirectOnlyModalMessage() {
const directOnlyString = messages.gettext('Direct only');

return (
<ModalMessage>
{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,
},
)}
</ModalMessage>
Expand Down

0 comments on commit a10c8a6

Please sign in to comment.