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:
@@ -4,11 +4,14 @@ import {
|
||||
IDomArgs, MultiHolder, styled, TagElem
|
||||
} from "grainjs";
|
||||
import { GristDoc } from "app/client/components/GristDoc";
|
||||
import { makeT } from 'app/client/lib/localization';
|
||||
import { ITooltipControl, showTooltip, tooltipCloseButton } from "app/client/ui/tooltips";
|
||||
import { FieldEditorStateEvent } from "app/client/widgets/FieldEditor";
|
||||
import { testId, theme } from "app/client/ui2018/cssVars";
|
||||
import { cssLink } from "app/client/ui2018/links";
|
||||
|
||||
const t = makeT('components.Drafts');
|
||||
|
||||
/**
|
||||
* Component that keeps track of editor's state (draft value). If user hits an escape button
|
||||
* by accident, this component will provide a way to continue the work.
|
||||
@@ -270,7 +273,7 @@ class NotificationAdapter extends Disposable implements Notification {
|
||||
}
|
||||
public showUndoDiscard() {
|
||||
const notifier = this._doc.app.topAppModel.notifier;
|
||||
const notification = notifier.createUserMessage("Undo discard", {
|
||||
const notification = notifier.createUserMessage(t("UndoDiscard"), {
|
||||
message: () =>
|
||||
discardNotification(
|
||||
dom.on("click", () => {
|
||||
@@ -418,7 +421,7 @@ const styledTooltip = styled('div', `
|
||||
function cellTooltip(clb: () => any) {
|
||||
return function (ctl: ITooltipControl) {
|
||||
return styledTooltip(
|
||||
cssLink('Restore last edit',
|
||||
cssLink(t('RestoreLastEdit'),
|
||||
dom.on('mousedown', (ev) => { ev.preventDefault(); ctl.close(); clb(); }),
|
||||
testId('draft-tooltip'),
|
||||
),
|
||||
@@ -437,7 +440,7 @@ const styledNotification = styled('div', `
|
||||
`);
|
||||
function discardNotification(...args: IDomArgs<TagElem<"div">>) {
|
||||
return styledNotification(
|
||||
"Undo Discard",
|
||||
t("UndoDiscard"),
|
||||
testId("draft-notification"),
|
||||
...args
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user