mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
Changing domT to a default translation function for browser
This commit is contained in:
@@ -3,7 +3,7 @@ import {icon} from 'app/client/ui2018/icons';
|
||||
import {dom, DomElementArg, Observable, styled} from "grainjs";
|
||||
import {t} from 'app/client/lib/localization';
|
||||
|
||||
const translate = (x: string, args?: any): string => t(`AddNewButton.${x}`, args);
|
||||
const translate = (x: string, args?: any) => t(`AddNewButton.${x}`, args);
|
||||
|
||||
export function addNewButton(isOpen: Observable<boolean> | boolean = true, ...args: DomElementArg[]) {
|
||||
return cssAddNewButton(
|
||||
|
||||
@@ -34,7 +34,7 @@ import {localStorageBoolObs} from 'app/client/lib/localStorageObs';
|
||||
import {bigBasicButton} from 'app/client/ui2018/buttons';
|
||||
import sortBy = require('lodash/sortBy');
|
||||
|
||||
const translate = (x: string, args?: any): string => t(`DocMenu.${x}`, args);
|
||||
const translate = (x: string, args?: any) => t(`DocMenu.${x}`, args);
|
||||
|
||||
const testId = makeTestId('test-dm-');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {domT, t} from 'app/client/lib/localization';
|
||||
import {t} from 'app/client/lib/localization';
|
||||
import {getLoginOrSignupUrl, urlState} from 'app/client/models/gristUrlState';
|
||||
import {HomeModel} from 'app/client/models/HomeModel';
|
||||
import {productPill} from 'app/client/ui/AppHeader';
|
||||
@@ -14,7 +14,7 @@ import {FullUser} from 'app/common/LoginSessionAPI';
|
||||
import * as roles from 'app/common/roles';
|
||||
import {Computed, dom, DomContents, styled} from 'grainjs';
|
||||
|
||||
const translate = (x: string, args?: any): string => t(`HomeIntro.${x}`, args);
|
||||
const translate = (x: string, args?: any) => t(`HomeIntro.${x}`, args);
|
||||
|
||||
export function buildHomeIntro(homeModel: HomeModel): DomContents {
|
||||
const isViewer = homeModel.app.currentOrg?.access === roles.VIEWER;
|
||||
@@ -103,7 +103,7 @@ function makePersonalIntro(homeModel: HomeModel, user: FullUser) {
|
||||
css.docListHeader(`Welcome to Grist, ${user.name}!`, testId('welcome-title')),
|
||||
cssIntroLine('Get started by creating your first Grist document.'),
|
||||
(shouldHideUiElement('helpCenter') ? null :
|
||||
cssIntroLine(domT('HomeIntro.VisitHelpCenter', { link: helpCenterLink() }),
|
||||
cssIntroLine(t('HomeIntro.VisitHelpCenter', { link: helpCenterLink() }),
|
||||
testId('welcome-text'))
|
||||
),
|
||||
makeCreateButtons(homeModel),
|
||||
@@ -116,7 +116,7 @@ function makeAnonIntro(homeModel: HomeModel) {
|
||||
css.docListHeader(translate('Welcome'), testId('welcome-title')),
|
||||
cssIntroLine('Get started by exploring templates, or creating your first Grist document.'),
|
||||
cssIntroLine(signUp, ' to save your work. ',
|
||||
(shouldHideUiElement('helpCenter') ? null : domT('HomeIntro.VisitHelpCenter', { link: helpCenterLink() })),
|
||||
(shouldHideUiElement('helpCenter') ? null : t('HomeIntro.VisitHelpCenter', { link: helpCenterLink() })),
|
||||
testId('welcome-text')),
|
||||
makeCreateButtons(homeModel),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user