hook up some missing translations in deck options screen

This commit is contained in:
Damien Elmes 2021-05-26 14:41:18 +10:00
parent 5b5b654c33
commit 7c5e974ae5
5 changed files with 40 additions and 25 deletions

View File

@ -170,24 +170,26 @@ deck-config-minimum-interval-tooltip = The minimum interval given to a review ca
## Adding/renaming
deck-config-add-group = Add Group
deck-config-name-prompt = Name:
deck-config-rename-group = Rename Group
deck-config-add-group = Add Preset
deck-config-name-prompt = Name
deck-config-rename-group = Rename Preset
deck-config-clone-group = Clone Preset
## Removing
deck-config-remove-group = Remove Group
deck-config-remove-group = Remove Preset
deck-config-confirm-normal = Remove { $name }?
-deck-config-will-require-full-sync = This will require a one-way sync.
# You don't need to translate this
deck-config-confirm-full =
{ deck-config-confirm-normal }
{ -deck-config-will-require-full-sync }
deck-config-will-require-full-sync =
The requested change will require a full upload of the database when you
next synchronize your collection. If you have reviews or other changes
waiting on another device that haven't been synchronized here yet, they will
be lost.
deck-config-confirm-remove-name = Remove { $name }?
## Other Buttons
deck-config-save-button = Save
deck-config-save-to-all-children = Save to All Children
deck-config-save-to-all-subdecks = Save to All Subdecks
deck-config-revert-button-tooltip = Restore this setting to its default value.
## These strings are shown via the Description button at the bottom of the

View File

@ -274,7 +274,6 @@ def askUser(
default = QMessageBox.Yes
r = msgfunc(parent, title, text, cast(QMessageBox.StandardButtons, sb), default)
if r == QMessageBox.Help:
openHelp(help)
else:
break

View File

@ -59,21 +59,21 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let modalSuccess = (_text: string) => {};
function promptToAdd() {
modalTitle = "Add Config";
modalTitle = tr.deckConfigAddGroup();
modalSuccess = onAddConfig;
modalStartingValue = "";
modals.get(modalKey)!.show();
}
function promptToClone() {
modalTitle = "Clone Config";
modalTitle = tr.deckConfigCloneGroup();
modalSuccess = onCloneConfig;
modalStartingValue = state.getCurrentName();
modals.get(modalKey)!.show();
}
function promptToRename() {
modalTitle = "Rename Config";
modalTitle = tr.deckConfigRenameGroup();
modalSuccess = onRenameConfig;
modalStartingValue = state.getCurrentName();
modals.get(modalKey)!.show();
@ -82,7 +82,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<TextInputModal
title={modalTitle}
prompt="Name"
prompt={tr.deckConfigNamePrompt()}
value={modalStartingValue}
onOk={modalSuccess}
bind:modalKey

View File

@ -29,10 +29,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
// fixme: move tr.qt_misc schema mod msg into core
// fixme: include name of deck in msg
const msg = state.removalWilLForceFullSync()
? "This will require a one-way sync. Are you sure?"
: "Are you sure?";
if (confirm(msg)) {
const msg =
(state.removalWilLForceFullSync()
? tr.deckConfigWillRequireFullSync() + " "
: "") +
tr.deckConfigConfirmRemoveName({ name: state.getCurrentName() });
if (confirm(tr.i18n.withCollapsedWhitespace(msg))) {
try {
state.removeCurrentConfig();
} catch (err) {
@ -49,24 +51,30 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<ButtonGroup>
<ButtonGroupItem>
<LabelButton theme="primary" on:click={() => save(false)}>Save</LabelButton>
<LabelButton theme="primary" on:click={() => save(false)}
>{tr.deckConfigSaveButton()}</LabelButton
>
</ButtonGroupItem>
<ButtonGroupItem>
<WithDropdownMenu let:createDropdown let:activateDropdown let:menuId>
<LabelButton on:mount={createDropdown} on:click={activateDropdown} />
<DropdownMenu id={menuId}>
<DropdownItem on:click={() => dispatch("add")}>Add Config</DropdownItem>
<DropdownItem on:click={() => dispatch("add")}
>{tr.deckConfigAddGroup()}</DropdownItem
>
<DropdownItem on:click={() => dispatch("clone")}
>Clone Config</DropdownItem
>{tr.deckConfigCloneGroup()}</DropdownItem
>
<DropdownItem on:click={() => dispatch("rename")}>
Rename Config
{tr.deckConfigRenameGroup()}
</DropdownItem>
<DropdownItem on:click={removeConfig}>Remove Config</DropdownItem>
<DropdownItem on:click={removeConfig}
>{tr.deckConfigRemoveGroup()}</DropdownItem
>
<DropdownDivider />
<DropdownItem on:click={() => save(true)}>
Save to All Children
{tr.deckConfigSaveToAllSubdecks()}
</DropdownItem>
</DropdownMenu>
</WithDropdownMenu>

View File

@ -65,6 +65,12 @@ export class I18n {
weekday: "narrow",
});
}
/// Treat text like HTML, merging multiple spaces and converting
/// newlines to spaces.
withCollapsedWhitespace(s: string): string {
return s.replace(/\s+/g, " ");
}
}
// global singleton