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 ## Adding/renaming
deck-config-add-group = Add Group deck-config-add-group = Add Preset
deck-config-name-prompt = Name: deck-config-name-prompt = Name
deck-config-rename-group = Rename Group deck-config-rename-group = Rename Preset
deck-config-clone-group = Clone Preset
## Removing ## Removing
deck-config-remove-group = Remove Group deck-config-remove-group = Remove Preset
deck-config-confirm-normal = Remove { $name }? deck-config-confirm-normal = Remove { $name }?
-deck-config-will-require-full-sync = This will require a one-way sync. deck-config-will-require-full-sync =
# You don't need to translate this The requested change will require a full upload of the database when you
deck-config-confirm-full = next synchronize your collection. If you have reviews or other changes
{ deck-config-confirm-normal } waiting on another device that haven't been synchronized here yet, they will
{ -deck-config-will-require-full-sync } be lost.
deck-config-confirm-remove-name = Remove { $name }?
## Other Buttons ## Other Buttons
deck-config-save-button = Save 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. 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 ## These strings are shown via the Description button at the bottom of the

View file

@ -274,7 +274,6 @@ def askUser(
default = QMessageBox.Yes default = QMessageBox.Yes
r = msgfunc(parent, title, text, cast(QMessageBox.StandardButtons, sb), default) r = msgfunc(parent, title, text, cast(QMessageBox.StandardButtons, sb), default)
if r == QMessageBox.Help: if r == QMessageBox.Help:
openHelp(help) openHelp(help)
else: else:
break 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) => {}; let modalSuccess = (_text: string) => {};
function promptToAdd() { function promptToAdd() {
modalTitle = "Add Config"; modalTitle = tr.deckConfigAddGroup();
modalSuccess = onAddConfig; modalSuccess = onAddConfig;
modalStartingValue = ""; modalStartingValue = "";
modals.get(modalKey)!.show(); modals.get(modalKey)!.show();
} }
function promptToClone() { function promptToClone() {
modalTitle = "Clone Config"; modalTitle = tr.deckConfigCloneGroup();
modalSuccess = onCloneConfig; modalSuccess = onCloneConfig;
modalStartingValue = state.getCurrentName(); modalStartingValue = state.getCurrentName();
modals.get(modalKey)!.show(); modals.get(modalKey)!.show();
} }
function promptToRename() { function promptToRename() {
modalTitle = "Rename Config"; modalTitle = tr.deckConfigRenameGroup();
modalSuccess = onRenameConfig; modalSuccess = onRenameConfig;
modalStartingValue = state.getCurrentName(); modalStartingValue = state.getCurrentName();
modals.get(modalKey)!.show(); modals.get(modalKey)!.show();
@ -82,7 +82,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<TextInputModal <TextInputModal
title={modalTitle} title={modalTitle}
prompt="Name" prompt={tr.deckConfigNamePrompt()}
value={modalStartingValue} value={modalStartingValue}
onOk={modalSuccess} onOk={modalSuccess}
bind:modalKey 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: move tr.qt_misc schema mod msg into core
// fixme: include name of deck in msg // fixme: include name of deck in msg
const msg = state.removalWilLForceFullSync() const msg =
? "This will require a one-way sync. Are you sure?" (state.removalWilLForceFullSync()
: "Are you sure?"; ? tr.deckConfigWillRequireFullSync() + " "
if (confirm(msg)) { : "") +
tr.deckConfigConfirmRemoveName({ name: state.getCurrentName() });
if (confirm(tr.i18n.withCollapsedWhitespace(msg))) {
try { try {
state.removeCurrentConfig(); state.removeCurrentConfig();
} catch (err) { } catch (err) {
@ -49,24 +51,30 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<ButtonGroup> <ButtonGroup>
<ButtonGroupItem> <ButtonGroupItem>
<LabelButton theme="primary" on:click={() => save(false)}>Save</LabelButton> <LabelButton theme="primary" on:click={() => save(false)}
>{tr.deckConfigSaveButton()}</LabelButton
>
</ButtonGroupItem> </ButtonGroupItem>
<ButtonGroupItem> <ButtonGroupItem>
<WithDropdownMenu let:createDropdown let:activateDropdown let:menuId> <WithDropdownMenu let:createDropdown let:activateDropdown let:menuId>
<LabelButton on:mount={createDropdown} on:click={activateDropdown} /> <LabelButton on:mount={createDropdown} on:click={activateDropdown} />
<DropdownMenu id={menuId}> <DropdownMenu id={menuId}>
<DropdownItem on:click={() => dispatch("add")}>Add Config</DropdownItem> <DropdownItem on:click={() => dispatch("add")}
>{tr.deckConfigAddGroup()}</DropdownItem
>
<DropdownItem on:click={() => dispatch("clone")} <DropdownItem on:click={() => dispatch("clone")}
>Clone Config</DropdownItem >{tr.deckConfigCloneGroup()}</DropdownItem
> >
<DropdownItem on:click={() => dispatch("rename")}> <DropdownItem on:click={() => dispatch("rename")}>
Rename Config {tr.deckConfigRenameGroup()}
</DropdownItem> </DropdownItem>
<DropdownItem on:click={removeConfig}>Remove Config</DropdownItem> <DropdownItem on:click={removeConfig}
>{tr.deckConfigRemoveGroup()}</DropdownItem
>
<DropdownDivider /> <DropdownDivider />
<DropdownItem on:click={() => save(true)}> <DropdownItem on:click={() => save(true)}>
Save to All Children {tr.deckConfigSaveToAllSubdecks()}
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</WithDropdownMenu> </WithDropdownMenu>

View file

@ -65,6 +65,12 @@ export class I18n {
weekday: "narrow", 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 // global singleton