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 {FocusLayer} from 'app/client/lib/FocusLayer';
|
||||
import {makeT} from 'app/client/lib/localization';
|
||||
import {reportError} from 'app/client/models/errors';
|
||||
import {cssInput} from 'app/client/ui/cssInput';
|
||||
import {prepareForTransition, TransitionWatcher} from 'app/client/ui/transitions';
|
||||
@@ -11,6 +12,8 @@ import {Computed, Disposable, dom, DomContents, DomElementArg, input, keyframes,
|
||||
MultiHolder, Observable, styled} from 'grainjs';
|
||||
import {cssMenuElem} from 'app/client/ui2018/menus';
|
||||
|
||||
const t = makeT('ui2018.modals');
|
||||
|
||||
// IModalControl is passed into the function creating the body of the modal.
|
||||
export interface IModalControl {
|
||||
// Observable for whether there is work in progress that's delaying the closing of the modal. It
|
||||
@@ -303,13 +306,13 @@ export function saveModal(createFunc: (ctl: IModalControl, owner: MultiHolder) =
|
||||
cssModalTitle(options.title, testId('modal-title')),
|
||||
cssModalBody(options.body),
|
||||
cssModalButtons(
|
||||
bigPrimaryButton(options.saveLabel || 'Save',
|
||||
bigPrimaryButton(options.saveLabel || t('Save'),
|
||||
dom.boolAttr('disabled', isSaveDisabled),
|
||||
dom.on('click', save),
|
||||
testId('modal-confirm'),
|
||||
),
|
||||
options.extraButtons,
|
||||
options.hideCancel ? null : bigBasicButton('Cancel',
|
||||
options.hideCancel ? null : bigBasicButton(t('Cancel'),
|
||||
dom.on('click', () => ctl.close()),
|
||||
testId('modal-cancel'),
|
||||
),
|
||||
@@ -423,7 +426,7 @@ export function invokePrompt(
|
||||
const prom = new Promise<string|undefined>((resolve) => {
|
||||
onResolve = resolve;
|
||||
});
|
||||
promptModal(title, onResolve!, btnText ?? 'Ok', initial, placeholder, () => {
|
||||
promptModal(title, onResolve!, btnText ?? t('Ok'), initial, placeholder, () => {
|
||||
if (onResolve) {
|
||||
onResolve(undefined);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user