Change translation keys for simple context keys

pull/367/head
Louis Delbosc 2 years ago
parent b76fe50bf9
commit 37dc0cc9fb

@ -240,7 +240,8 @@ export class DocPageModelImpl extends Disposable implements DocPageModel {
t("Reload"), t("Reload"),
async () => window.location.reload(true), async () => window.location.reload(true),
isDocOwner ? t("You can try reloading the document, or using recovery mode. Recovery mode opens the document to be fully accessible to owners, and inaccessible to others. It also disables formulas. [{{error}}]", {error: err.message}) : isDocOwner ? t("You can try reloading the document, or using recovery mode. Recovery mode opens the document to be fully accessible to owners, and inaccessible to others. It also disables formulas. [{{error}}]", {error: err.message}) :
t('AccessError', {context: isDenied ? 'denied' : 'recover', error: err.message}), isDenied ? t('Sorry, access to this document has been denied. [{{error}}]', {error: err.message}) :
t("Document owners can attempt to recover the document. [{{error}}]", {error: err.message}),
{ hideCancel: true, { hideCancel: true,
extraButtons: (isDocOwner && !isDenied) ? bigBasicButton(t("Enter recovery mode"), dom.on('click', async () => { extraButtons: (isDocOwner && !isDenied) ? bigBasicButton(t("Enter recovery mode"), dom.on('click', async () => {
await this._api.getDocAPI(this.currentDocId.get()!).recover(true); await this._api.getDocAPI(this.currentDocId.get()!).recover(true);

@ -20,34 +20,34 @@ interface WelcomeCard {
export const buildExamples = (): IExampleInfo[] => [{ export const buildExamples = (): IExampleInfo[] => [{
id: 1, // Identifies the example in UserPrefs.seenExamples id: 1, // Identifies the example in UserPrefs.seenExamples
urlId: 'lightweight-crm', urlId: 'lightweight-crm',
title: t('Title', {context: "CRM"}), title: t('Lightweight CRM'),
imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/lightweight-crm.png', imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/lightweight-crm.png',
tutorialUrl: 'https://support.getgrist.com/lightweight-crm/', tutorialUrl: 'https://support.getgrist.com/lightweight-crm/',
welcomeCard: { welcomeCard: {
title: t('WelcomeTitle', {context: "CRM"}), title: t('Welcome to the Lightweight CRM template'),
text: t('WelcomeText', {context: "CRM"}), text: t('Check out our related tutorial for how to link data, and create high-productivity layouts.'),
tutorialName: t('WelcomeTutorialName', {context: "CRM"}), tutorialName: t("Tutorial: Create a CRM"),
}, },
}, { }, {
id: 2, // Identifies the example in UserPrefs.seenExamples id: 2, // Identifies the example in UserPrefs.seenExamples
urlId: 'investment-research', urlId: 'investment-research',
title: t('Title', {context: "investmentResearch"}), title: t('Investment Research'),
imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/data-visualization.png', imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/data-visualization.png',
tutorialUrl: 'https://support.getgrist.com/investment-research/', tutorialUrl: 'https://support.getgrist.com/investment-research/',
welcomeCard: { welcomeCard: {
title: t('WelcomeTitle', {context: "investmentResearch"}), title: t("Welcome to the Investment Research template"),
text: t('WelcomeText', {context: "investmentResearch"}), text: t("Check out our related tutorial to learn how to create summary tables and charts, and to link charts dynamically."),
tutorialName: t('WelcomeTutorialName', {context: "investmentResearch"}), tutorialName: t("Tutorial: Analyze & Visualize"),
}, },
}, { }, {
id: 3, // Identifies the example in UserPrefs.seenExamples id: 3, // Identifies the example in UserPrefs.seenExamples
urlId: 'afterschool-program', urlId: 'afterschool-program',
title: t('Title', {context: "afterschool"}), title: t('Afterschool Program'),
imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/business-management.png', imgUrl: 'https://www.getgrist.com/themes/grist/assets/images/use-cases/business-management.png',
tutorialUrl: 'https://support.getgrist.com/afterschool-program/', tutorialUrl: 'https://support.getgrist.com/afterschool-program/',
welcomeCard: { welcomeCard: {
title: t('WelcomeTitle', {context: "afterschool"}), title: t("Welcome to the Afterschool Program template"),
text: t('WelcomeText', {context: "afterschool"}), text: t("Check out our related tutorial for how to model business data, use formulas, and manage complexity."),
tutorialName: t('WelcomeTutorialName', {context: "afterschool"}), tutorialName: t("Tutorial: Manage Business Data"),
}, },
}]; }];

@ -231,19 +231,19 @@ export function buildFormulaConfig(
// Converts data column to formula column. // Converts data column to formula column.
const convertDataColumnToFormulaOption = () => selectOption( const convertDataColumnToFormulaOption = () => selectOption(
() => (maybeFormula.set(true), formulaField?.focus()), () => (maybeFormula.set(true), formulaField?.focus()),
t('ConvertColumn', {context: 'formula'}), 'Script'); t("Clear and make into formula"), 'Script');
// Converts to empty column and opens up the editor. (label is the same, but this is used when we have no formula) // Converts to empty column and opens up the editor. (label is the same, but this is used when we have no formula)
const convertTriggerToFormulaOption = () => selectOption( const convertTriggerToFormulaOption = () => selectOption(
() => gristDoc.convertIsFormula([origColumn.id.peek()], {toFormula: true, noRecalc: true}), () => gristDoc.convertIsFormula([origColumn.id.peek()], {toFormula: true, noRecalc: true}),
t('ConvertColumn', {context: 'formula'}), 'Script'); t("Clear and make into formula"), 'Script');
// Convert column to data. // Convert column to data.
// This method is also available through a text button. // This method is also available through a text button.
const convertToData = () => gristDoc.convertIsFormula([origColumn.id.peek()], {toFormula: false, noRecalc: true}); const convertToData = () => gristDoc.convertIsFormula([origColumn.id.peek()], {toFormula: false, noRecalc: true});
const convertToDataOption = () => selectOption( const convertToDataOption = () => selectOption(
convertToData, convertToData,
t('ConvertColumn', {context: 'data'}), 'Database', t("Convert column to data"), 'Database',
dom.cls('disabled', isSummaryTable) dom.cls('disabled', isSummaryTable)
); );
@ -357,7 +357,7 @@ export function buildFormulaConfig(
formulaBuilder(onSaveConvertToFormula), formulaBuilder(onSaveConvertToFormula),
cssEmptySeparator(), cssEmptySeparator(),
cssRow(textButton( cssRow(textButton(
t('ConvertColumn', {context: 'triggerformula'}), t("Convert to trigger formula"),
dom.on("click", convertFormulaToTrigger), dom.on("click", convertFormulaToTrigger),
dom.hide(maybeFormula), dom.hide(maybeFormula),
dom.prop("disabled", use => use(isSummaryTable) || use(disableOtherActions)), dom.prop("disabled", use => use(isSummaryTable) || use(disableOtherActions)),

@ -13,10 +13,10 @@ const t = makeT('FieldMenus');
export function FieldSettingsMenu(useColOptions: boolean, disableSeparate: boolean, actions: IFieldOptions) { export function FieldSettingsMenu(useColOptions: boolean, disableSeparate: boolean, actions: IFieldOptions) {
useColOptions = useColOptions || disableSeparate; useColOptions = useColOptions || disableSeparate;
return [ return [
menuSubHeader(t('UsingSettings', {context: useColOptions ? 'common' : 'separate'})), menuSubHeader(useColOptions ? t("Using common settings") : t("Using separate settings")),
useColOptions ? menuItem(actions.useSeparate, t('Settings', {context: 'useseparate'}), dom.cls('disabled', disableSeparate)) : [ useColOptions ? menuItem(actions.useSeparate, t("Use separate settings"), dom.cls('disabled', disableSeparate)) : [
menuItem(actions.saveAsCommon, t('Settings', {context: 'savecommon'})), menuItem(actions.saveAsCommon, t("Save as common settings")),
menuItem(actions.revertToCommon, t('Settings', {context: 'revertcommon'})), menuItem(actions.revertToCommon, t("Revert to common settings")),
] ]
]; ];
} }

@ -87,8 +87,8 @@ export function createOtherErrorPage(appModel: AppModel, message?: string) {
document.title = t("Error{{suffix}}", {suffix: getPageTitleSuffix(getGristConfig())}); document.title = t("Error{{suffix}}", {suffix: getPageTitleSuffix(getGristConfig())});
return pagePanelsError(appModel, t("Something went wrong"), [ return pagePanelsError(appModel, t("Something went wrong"), [
cssErrorText(message ? t('ErrorHappened', {context: 'message', message: addPeriod(message)}) : cssErrorText(message ? t('There was an error: {{message}}', {message: addPeriod(message)}) :
t('ErrorHappened', {context: 'unknown'})), t('There was an unknown error.')),
cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'), cssButtonWrap(bigPrimaryButtonLink(t("Go to main page"), testId('error-primary-btn'),
urlState().setLinkUrl({}))), urlState().setLinkUrl({}))),
cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: 'https://getgrist.com/contact'})), cssButtonWrap(bigBasicButtonLink(t("Contact support"), {href: 'https://getgrist.com/contact'})),

Loading…
Cancel
Save