Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: userManager translation + some forgotten translations #557

Merged
merged 4 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/client/aclui/AccessRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,8 @@ Useful for examples and templates, but not for sensitive data.`),
},
SchemaEdit: {
name: t("Permission to edit document structure"),
description: t("Allow editors to edit structure (e.g. modify and delete tables, columns, " +
"layouts), and to write formulas, which give access to all data regardless of read restrictions."),
description: t("Allow editors to edit structure (e.g. modify and delete tables, columns, \
layouts), and to write formulas, which give access to all data regardless of read restrictions."),
availableBits: ['schemaEdit'],
...schemaEditRules.denyEditors,
},
Expand Down Expand Up @@ -1323,7 +1323,7 @@ class SpecialSchemaObsRuleSet extends SpecialObsRuleSet {
return dom.maybe(
(use) => use(this._body).every(rule => rule.isBuiltInOrEmpty(use)),
() => cssConditionError({style: 'margin-left: 56px; margin-bottom: 8px;'},
"This default should be changed if editors' access is to be limited. ",
t("This default should be changed if editors' access is to be limited. "),
dom('a', {style: 'color: inherit; text-decoration: underline'},
'Dismiss', dom.on('click', () => this._allowEditors('confirm'))),
testId('rule-schema-edit-warning'),
Expand Down
5 changes: 3 additions & 2 deletions app/client/components/ChartView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,9 @@ export class ChartConfig extends GrainJSDisposable {
),
dom.domComputed(this._optionsObj.prop('errorBars'), (value: ChartOptions["errorBars"]) =>
value === 'symmetric' ? cssRowHelp(t("Each Y series is followed by a series for the length of error bars.")) :
value === 'separate' ? cssRowHelp(t("Each Y series is followed by two series, for " +
"top and bottom error bars."))
value === 'separate' ? cssRowHelp(
t("Each Y series is followed by two series, for top and bottom error bars.")
)
: null
),
]),
Expand Down
7 changes: 3 additions & 4 deletions app/client/models/DocPageModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,9 @@ export class DocPageModelImpl extends Disposable implements DocPageModel {
{
explanation: (
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("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})
: 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})
Expand Down
9 changes: 6 additions & 3 deletions app/client/models/SearchModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import {TableData} from 'app/common/TableData';
import {BaseFormatter} from 'app/common/ValueFormatter';
import {Computed, Disposable, Observable} from 'grainjs';
import debounce = require('lodash/debounce');
import { makeT } from 'app/client/lib/localization';

const t = makeT('SearchModel');

/**
* SearchModel used to maintain the state of the search UI.
Expand Down Expand Up @@ -201,7 +204,7 @@ class FinderImpl implements IFinder {
// sort in order that is the same as on the raw data list page,
.sort((a, b) => nativeCompare(a.tableNameDef.peek(), b.tableNameDef.peek()))
// get rawViewSection,
.map(t => t.rawViewSection.peek())
.map(table => table.rawViewSection.peek())
// and test if it isn't an empty record.
.filter(s => Boolean(s.id.peek()));
// Pretend that those are pages.
Expand All @@ -218,7 +221,7 @@ class FinderImpl implements IFinder {
// Else read all visible pages.
const pages = this._gristDoc.docModel.visibleDocPages.peek();
this._pageStepper.array = pages.map(p => new PageRecWrapper(p, this._openDocPageCB));
this._pageStepper.index = pages.findIndex(t => t.viewRef.peek() === this._gristDoc.activeViewId.get());
this._pageStepper.index = pages.findIndex(page => page.viewRef.peek() === this._gristDoc.activeViewId.get());
if (this._pageStepper.index < 0) { return false; }
}

Expand Down Expand Up @@ -468,7 +471,7 @@ export class SearchModelImpl extends Disposable implements SearchModel {
this.autoDispose(this.multiPage.addListener(v => { if (v) { this.noMatch.set(false); } }));

this.allLabel = Computed.create(this, use => use(this._gristDoc.activeViewId) === 'data' ?
'Search all tables' : 'Search all pages');
t('Search all tables') : t('Search all pages'));

// Schedule a search restart when user changes pages (otherwise search would resume from the
// previous page that is not shown anymore). Also revert noMatch flag when in single page mode.
Expand Down
5 changes: 2 additions & 3 deletions app/client/ui/AccountPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ export class AccountPage extends Disposable {
),
css.subHeader(t("Two-factor authentication")),
css.description(
t("Two-factor authentication is an extra layer of security for your Grist account " +
"designed to ensure that you're the only person who can access your account, " +
"even if someone knows your password.")
t("Two-factor authentication is an extra layer of security for your Grist account \
designed to ensure that you're the only person who can access your account, even if someone knows your password.")
),
dom.create(MFAConfig, user),
),
Expand Down
8 changes: 4 additions & 4 deletions app/client/ui/ApiKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export class ApiKey extends Disposable {
dom.maybe((use) => !(use(this._apiKey) || this._anonymous), () => [
basicButton(t("Create"), dom.on('click', () => this._onCreate()), testId('create'),
dom.boolAttr('disabled', this._loading)),
description(t("By generating an API key, you will be able to " +
"make API calls for your own account."), testId('description')),
description(t("By generating an API key, you will be able to \
make API calls for your own account."), testId('description')),
]),
);
}
Expand Down Expand Up @@ -117,8 +117,8 @@ export class ApiKey extends Disposable {
() => this._onDelete(),
{
explanation: t(
"You're about to delete an API key. This will cause all future requests " +
"using this API key to be rejected. Do you still want to delete?"
"You're about to delete an API key. This will cause all future requests \
using this API key to be rejected. Do you still want to delete?"
),
}
);
Expand Down
4 changes: 2 additions & 2 deletions app/client/ui/DocTour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export async function startDocTour(docData: DocData, docComm: DocComm, onFinishC

const invalidDocTour: IOnBoardingMsg[] = [{
title: t("No valid document tour"),
body: t("Cannot construct a document tour from the data in this document. " +
"Ensure there is a table named GristDocTour with columns Title, Body, Placement, and Location."),
body: t("Cannot construct a document tour from the data in this document. \
Ensure there is a table named GristDocTour with columns Title, Body, Placement, and Location."),
selector: 'document',
showHasModal: true,
}];
Expand Down
4 changes: 2 additions & 2 deletions app/client/ui/ExampleInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const buildExamples = (): IExampleInfo[] => [{
tutorialUrl: 'https://support.getgrist.com/investment-research/',
welcomeCard: {
title: t("Welcome to the Investment Research template"),
text: t("Check out our related tutorial to learn how to create " +
"summary tables and charts, and to link charts dynamically."),
text: t("Check out our related tutorial to learn how to create \
summary tables and charts, and to link charts dynamically."),
tutorialName: t("Tutorial: Analyze & Visualize"),
},
}, {
Expand Down
28 changes: 12 additions & 16 deletions app/client/ui/GristTooltips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export const GristTooltips: Record<Tooltip, TooltipContentFunc> = {
t('Formulas that trigger in certain cases, and store the calculated value as data.')
),
dom('div',
t('Useful for storing the timestamp or author of a new record, data cleaning, and '
+ 'more.')
t('Useful for storing the timestamp or author of a new record, data cleaning, and more.')
),
dom('div',
cssLink({href: commonUrls.helpTriggerFormulas, target: '_blank'}, t('Learn more.')),
Expand All @@ -76,8 +75,8 @@ export const GristTooltips: Record<Tooltip, TooltipContentFunc> = {
),
openAccessRules: (...args: DomElementArg[]) => cssTooltipContent(
dom('div',
t('Access rules give you the power to create nuanced rules to determine who can '
+ 'see or edit which parts of your document.')
t('Access rules give you the power to create nuanced rules to determine who can \
see or edit which parts of your document.')
),
dom('div',
cssLink({href: commonUrls.helpAccessRules, target: '_blank'}, t('Learn more.')),
Expand Down Expand Up @@ -126,8 +125,8 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
title: () => t('Reference Columns'),
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div', t('Select the table to link to.')),
dom('div', t('Cells in a reference column always identify an {{entire}} ' +
'record in that table, but you may select which column from that record to show.', {
dom('div', t('Cells in a reference column always identify an {{entire}} \
record in that table, but you may select which column from that record to show.', {
entire: cssItalicizedText(t('entire'))
})),
dom('div',
Expand All @@ -140,8 +139,8 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
rawDataPage: {
title: () => t('Raw Data page'),
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div', t('The Raw Data page lists all data tables in your document, '
+ 'including summary tables and tables not included in page layouts.')),
dom('div', t('The Raw Data page lists all data tables in your document, \
including summary tables and tables not included in page layouts.')),
dom('div', cssLink({href: commonUrls.helpRawData, target: '_blank'}, t('Learn more.'))),
...args,
),
Expand All @@ -150,8 +149,8 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
accessRules: {
title: () => t('Access Rules'),
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div', t('Access rules give you the power to create nuanced rules '
+ 'to determine who can see or edit which parts of your document.')),
dom('div', t('Access rules give you the power to create nuanced rules \
to determine who can see or edit which parts of your document.')),
dom('div', cssLink({href: commonUrls.helpAccessRules, target: '_blank'}, t('Learn more.'))),
...args,
),
Expand Down Expand Up @@ -209,8 +208,7 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
addNew: {
title: () => t('Add New'),
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div', t('Click the Add New button to create new documents or workspaces, '
+ 'or import data.')),
dom('div', t('Click the Add New button to create new documents or workspaces, or import data.')),
...args,
),
deploymentTypes: ['saas'],
Expand All @@ -219,8 +217,7 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
title: () => t('Anchor Links'),
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div',
t('To make an anchor link that takes the user to a specific cell, click on'
+ ' a row and press {{shortcut}}.',
t('To make an anchor link that takes the user to a specific cell, click on a row and press {{shortcut}}.',
{
shortcut: ShortcutKey(ShortcutKeyContent(commands.allCommands.copyLink.humanKeys[0])),
}
Expand All @@ -235,8 +232,7 @@ export const GristBehavioralPrompts: Record<BehavioralPrompt, BehavioralPromptCo
content: (...args: DomElementArg[]) => cssTooltipContent(
dom('div',
t(
'You can choose one of our pre-made widgets or embed your own ' +
'by providing its full URL.'
'You can choose one of our pre-made widgets or embed your own by providing its full URL.'
),
),
dom('div', cssLink({href: commonUrls.helpCustomWidgets, target: '_blank'}, t('Learn more.'))),
Expand Down
4 changes: 2 additions & 2 deletions app/client/ui/MakeCopyMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export async function replaceTrunkWithFork(user: FullUser|null, doc: Document, a
if (cmp.summary === 'left' || cmp.summary === 'both') {
titleText = t("Original Has Modifications");
buttonText = t("Overwrite");
warningText = `${warningText} ${t("Be careful, the original has changes " +
"not in this document. Those changes will be overwritten.")}`;
warningText = `${warningText} ${t("Be careful, the original has changes \
not in this document. Those changes will be overwritten.")}`;
} else if (cmp.summary === 'unrelated') {
titleText = t("Original Looks Unrelated");
buttonText = t("Overwrite");
Expand Down
6 changes: 3 additions & 3 deletions app/client/ui/ShareMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function shareButton(buttonText: string|null, menuCreateFunc: MenuCreateFunc,
return cssHoverCircle({ style: `margin: 5px;` },
cssTopBarBtn('Share', dom.cls('tour-share-icon')),
menu(menuCreateFunc, {placement: 'bottom-end'}),
hoverTooltip('Share', {key: 'topBarBtnTooltip'}),
hoverTooltip(t('Share'), {key: 'topBarBtnTooltip'}),
testId('tb-share'),
);
} else if (options.buttonAction) {
Expand All @@ -115,7 +115,7 @@ function shareButton(buttonText: string|null, menuCreateFunc: MenuCreateFunc,
cssShareCircle(
cssShareIcon('Share'),
menu(menuCreateFunc, {placement: 'bottom-end'}),
hoverTooltip('Share', {key: 'topBarBtnTooltip'}),
hoverTooltip(t('Share'), {key: 'topBarBtnTooltip'}),
testId('tb-share'),
),
);
Expand All @@ -128,7 +128,7 @@ function shareButton(buttonText: string|null, menuCreateFunc: MenuCreateFunc,
cssShareIcon('Share')
),
menu(menuCreateFunc, {placement: 'bottom-end'}),
hoverTooltip('Share', {key: 'topBarBtnTooltip'}),
hoverTooltip(t('Share'), {key: 'topBarBtnTooltip'}),
testId('tb-share'),
);
}
Expand Down
Loading