Change translation keys for aclui directory

This commit is contained in:
Louis Delbosc 2022-12-06 14:31:42 +01:00
parent 156a471db7
commit 32e3d25ae5
2 changed files with 26 additions and 25 deletions

View File

@ -329,21 +329,21 @@ export class AccessRules extends Disposable {
bigBasicButton({disabled: true}, dom.hide(this._savingEnabled), bigBasicButton({disabled: true}, dom.hide(this._savingEnabled),
dom.text((use) => { dom.text((use) => {
const s = use(this._ruleStatus); const s = use(this._ruleStatus);
return s === RuleStatus.CheckPending ? t('Checking') : return s === RuleStatus.CheckPending ? t("Checking...") :
s === RuleStatus.Unchanged ? t('Saved') : t('Invalid'); s === RuleStatus.Unchanged ? t("Saved") : t("Invalid");
}), }),
testId('rules-non-save') testId('rules-non-save')
), ),
bigPrimaryButton(t('Save'), dom.show(this._savingEnabled), bigPrimaryButton(t("Save"), dom.show(this._savingEnabled),
dom.on('click', () => this.save()), dom.on('click', () => this.save()),
testId('rules-save'), testId('rules-save'),
), ),
bigBasicButton(t('Reset'), dom.show(use => use(this._ruleStatus) !== RuleStatus.Unchanged), bigBasicButton(t("Reset"), dom.show(use => use(this._ruleStatus) !== RuleStatus.Unchanged),
dom.on('click', () => this.update()), dom.on('click', () => this.update()),
testId('rules-revert'), testId('rules-revert'),
), ),
bigBasicButton(t('AddTableRules'), cssDropdownIcon('Dropdown'), {style: 'margin-left: auto'}, bigBasicButton(t("Add Table Rules"), cssDropdownIcon('Dropdown'), {style: 'margin-left: auto'},
menu(() => menu(() =>
this.allTableIds.map((tableId) => this.allTableIds.map((tableId) =>
// Add the table on a timeout, to avoid disabling the clicked menu item // Add the table on a timeout, to avoid disabling the clicked menu item
@ -355,8 +355,8 @@ export class AccessRules extends Disposable {
), ),
), ),
), ),
bigBasicButton(t('AddUserAttributes'), dom.on('click', () => this._addUserAttributes())), bigBasicButton(t('Add User Attributes'), dom.on('click', () => this._addUserAttributes())),
bigBasicButton(t('ViewAs'), cssDropdownIcon('Dropdown'), bigBasicButton(t('View As'), cssDropdownIcon('Dropdown'),
elem => this._aclUsersPopup.attachPopup(elem, {placement: 'bottom-end'}), elem => this._aclUsersPopup.attachPopup(elem, {placement: 'bottom-end'}),
dom.style('visibility', use => use(this._aclUsersPopup.isInitialized) ? '' : 'hidden')), dom.style('visibility', use => use(this._aclUsersPopup.isInitialized) ? '' : 'hidden')),
), ),
@ -375,15 +375,15 @@ export class AccessRules extends Disposable {
shadowScroll( shadowScroll(
dom.maybe(use => use(this._userAttrRules).length, () => dom.maybe(use => use(this._userAttrRules).length, () =>
cssSection( cssSection(
cssSectionHeading(t('UserAttributes')), cssSectionHeading(t("User Attributes")),
cssTableRounded( cssTableRounded(
cssTableHeaderRow( cssTableHeaderRow(
cssCell1(cssCell.cls('-rborder'), cssCell.cls('-center'), cssColHeaderCell('Name')), cssCell1(cssCell.cls('-rborder'), cssCell.cls('-center'), cssColHeaderCell('Name')),
cssCell4( cssCell4(
cssColumnGroup( cssColumnGroup(
cssCell1(cssColHeaderCell(t('AttributeToLookUp'))), cssCell1(cssColHeaderCell(t("Attribute to Look Up"))),
cssCell1(cssColHeaderCell(t('LookupTable'))), cssCell1(cssColHeaderCell(t("Lookup Table"))),
cssCell1(cssColHeaderCell(t('LookupColumn'))), cssCell1(cssColHeaderCell(t("Lookup Column"))),
cssCellIcon(), cssCellIcon(),
), ),
), ),
@ -394,7 +394,7 @@ export class AccessRules extends Disposable {
), ),
dom.forEach(this._tableRules, (tableRules) => tableRules.buildDom()), dom.forEach(this._tableRules, (tableRules) => tableRules.buildDom()),
cssSection( cssSection(
cssSectionHeading(t("DefaultRules"), testId('rule-table-header')), cssSectionHeading(t("Default Rules"), testId('rule-table-header')),
cssTableRounded( cssTableRounded(
cssTableHeaderRow( cssTableHeaderRow(
cssCell1(cssCell.cls('-rborder'), cssCell.cls('-center'), cssColHeaderCell('Columns')), cssCell1(cssCell.cls('-rborder'), cssCell.cls('-center'), cssColHeaderCell('Columns')),
@ -628,13 +628,13 @@ class TableRules extends Disposable {
public buildDom() { public buildDom() {
return cssSection( return cssSection(
cssSectionHeading( cssSectionHeading(
dom('span', t('RulesForTable'), cssTableName(this._accessRules.getTableTitle(this.tableId))), dom('span', t("Rules for table "), cssTableName(this._accessRules.getTableTitle(this.tableId))),
cssIconButton(icon('Dots'), {style: 'margin-left: auto'}, cssIconButton(icon('Dots'), {style: 'margin-left: auto'},
menu(() => [ menu(() => [
menuItemAsync(() => this._addColumnRuleSet(), t('AddColumnRule')), menuItemAsync(() => this._addColumnRuleSet(), t("Add Column Rule")),
menuItemAsync(() => this._addDefaultRuleSet(), t('AddDefaultRule'), menuItemAsync(() => this._addDefaultRuleSet(), t("Add Default Rule"),
dom.cls('disabled', use => Boolean(use(this._defaultRuleSet)))), dom.cls('disabled', use => Boolean(use(this._defaultRuleSet)))),
menuItemAsync(() => this.remove(), t('DeleteTableRules')), menuItemAsync(() => this._accessRules.removeTableRules(this), t("Delete Table Rules")),
]), ]),
testId('rule-table-menu-btn'), testId('rule-table-menu-btn'),
), ),
@ -762,7 +762,7 @@ class TableRules extends Disposable {
class SpecialRules extends TableRules { class SpecialRules extends TableRules {
public buildDom() { public buildDom() {
return cssSection( return cssSection(
cssSectionHeading(t('SpecialRules'), testId('rule-table-header')), cssSectionHeading(t("Special Rules"), testId('rule-table-header')),
this.buildColumnRuleSets(), this.buildColumnRuleSets(),
this.buildErrors(), this.buildErrors(),
testId('rule-table'), testId('rule-table'),
@ -1009,17 +1009,18 @@ class DefaultObsRuleSet extends ObsRuleSet {
function getSpecialRuleDescription(type: string): string { function getSpecialRuleDescription(type: string): string {
switch (type) { switch (type) {
case 'AccessRules': case 'AccessRules':
return t('AccessRulesDescription'); return t("Allow everyone to view Access Rules.");
case 'FullCopies': case 'FullCopies':
return t('FullCopiesDescription'); return t(`Allow everyone to copy the entire document, or view it in full in fiddle mode.
Useful for examples and templates, but not for sensitive data.`);
default: return type; default: return type;
} }
} }
function getSpecialRuleName(type: string): string { function getSpecialRuleName(type: string): string {
switch (type) { switch (type) {
case 'AccessRules': return t('AccessRulesName'); case 'AccessRules': return t("Permission to view Access Rules");
case 'FullCopies': return t('FullCopies'); case 'FullCopies': return t("Permission to access the document in full when needed");
default: return type; default: return type;
} }
} }
@ -1157,7 +1158,7 @@ class ObsUserAttributeRule extends Disposable {
cssCell1(cssCell.cls('-rborder'), cssCell1(cssCell.cls('-rborder'),
cssCellContent( cssCellContent(
cssInput(this._name, async (val) => this._name.set(val), cssInput(this._name, async (val) => this._name.set(val),
{placeholder: t('AttributeNamePlaceholder')}, {placeholder: t("Attribute name")},
(this._options.focus ? (elem) => { setTimeout(() => elem.focus(), 0); } : null), (this._options.focus ? (elem) => { setTimeout(() => elem.focus(), 0); } : null),
testId('rule-userattr-name'), testId('rule-userattr-name'),
), ),

View File

@ -64,13 +64,13 @@ export function permissionsWidget(
null null
), ),
// If the set matches any recognized pattern, mark that item with a tick (checkmark). // If the set matches any recognized pattern, mark that item with a tick (checkmark).
cssMenuItem(() => setPermissions(allowAll), tick(isEqual(pset.get(), allowAll)), t('AllowAll'), cssMenuItem(() => setPermissions(allowAll), tick(isEqual(pset.get(), allowAll)), t("Allow All"),
dom.cls('disabled', options.disabled) dom.cls('disabled', options.disabled)
), ),
cssMenuItem(() => setPermissions(denyAll), tick(isEqual(pset.get(), denyAll)), t('DenyAll'), cssMenuItem(() => setPermissions(denyAll), tick(isEqual(pset.get(), denyAll)), t("Deny All"),
dom.cls('disabled', options.disabled) dom.cls('disabled', options.disabled)
), ),
cssMenuItem(() => setPermissions(readOnly), tick(isEqual(pset.get(), readOnly)), t('ReadOnly'), cssMenuItem(() => setPermissions(readOnly), tick(isEqual(pset.get(), readOnly)), t("Read Only"),
dom.cls('disabled', options.disabled) dom.cls('disabled', options.disabled)
), ),
cssMenuItem(() => setPermissions(empty), cssMenuItem(() => setPermissions(empty),