mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Make a good part of the app localizable and add French translations (#325)
Co-authored-by: Yohan Boniface <yohanboniface@free.fr>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Command } from 'app/client/components/commands';
|
||||
import { makeT } from 'app/client/lib/localization';
|
||||
import { NeedUpgradeError, reportError } from 'app/client/models/errors';
|
||||
import { textButton } from 'app/client/ui2018/buttons';
|
||||
import { cssCheckboxSquare, cssLabel, cssLabelText } from 'app/client/ui2018/checkbox';
|
||||
@@ -10,6 +11,8 @@ import { BindableValue, Computed, dom, DomElementArg, DomElementMethod, IDomArgs
|
||||
MaybeObsArray, MutableObsArray, Observable, styled } from 'grainjs';
|
||||
import * as weasel from 'popweasel';
|
||||
|
||||
const t = makeT('ui2018.menus');
|
||||
|
||||
export interface IOptionFull<T> {
|
||||
value: T;
|
||||
label: string;
|
||||
@@ -175,7 +178,7 @@ export function multiSelect<T>(selectedOptions: MutableObsArray<T>,
|
||||
|
||||
const selectedOptionsText = Computed.create(null, selectedOptionsSet, (use, selectedOpts) => {
|
||||
if (selectedOpts.size === 0) {
|
||||
return options.placeholder ?? 'Select fields';
|
||||
return options.placeholder ?? t('SelectFields');
|
||||
}
|
||||
|
||||
const optionArray = Array.isArray(availableOptions) ? availableOptions : use(availableOptions);
|
||||
@@ -309,8 +312,8 @@ export function upgradableMenuItem(needUpgrade: boolean, action: () => void, ...
|
||||
|
||||
export function upgradeText(needUpgrade: boolean, onClick: () => void) {
|
||||
if (!needUpgrade) { return null; }
|
||||
return menuText(dom('span', '* Workspaces are available on team plans. ',
|
||||
cssUpgradeTextButton('Upgrade now', dom.on('click', () => onClick()))));
|
||||
return menuText(dom('span', t('WorkspacesAvailableOnTeamPlans'),
|
||||
cssUpgradeTextButton(t('UpgradeNow'), dom.on('click', () => onClick()))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user