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,3 +1,4 @@
|
||||
import {makeT} from 'app/client/lib/localization';
|
||||
import {GristDoc} from 'app/client/components/GristDoc';
|
||||
import {AppModel} from 'app/client/models/AppModel';
|
||||
import {DocPageModel} from 'app/client/models/DocPageModel';
|
||||
@@ -10,6 +11,8 @@ import {ANONYMOUS_USER_EMAIL, Document, EVERYONE_EMAIL, FullUser, getRealAccess,
|
||||
import {computed, Computed, Disposable, obsArray, ObsArray, observable, Observable} from 'grainjs';
|
||||
import some = require('lodash/some');
|
||||
|
||||
const t = makeT('models.UserManagerModel');
|
||||
|
||||
export interface UserManagerModel {
|
||||
initData: PermissionData; // PermissionData used to initialize the UserManager
|
||||
resource: Resource|null; // The access resource.
|
||||
@@ -97,28 +100,28 @@ interface IBuildMemberOptions {
|
||||
export class UserManagerModelImpl extends Disposable implements UserManagerModel {
|
||||
// Select options for each individual user's role dropdown.
|
||||
public readonly userSelectOptions: IMemberSelectOption[] = [
|
||||
{ value: roles.OWNER, label: 'Owner' },
|
||||
{ value: roles.EDITOR, label: 'Editor' },
|
||||
{ value: roles.VIEWER, label: 'Viewer' }
|
||||
{ value: roles.OWNER, label: t('Owner') },
|
||||
{ value: roles.EDITOR, label: t('Editor') },
|
||||
{ value: roles.VIEWER, label: t('Viewer') }
|
||||
];
|
||||
// Select options for each individual user's role dropdown in the org.
|
||||
public readonly orgUserSelectOptions: IOrgMemberSelectOption[] = [
|
||||
{ value: roles.OWNER, label: 'Owner' },
|
||||
{ value: roles.EDITOR, label: 'Editor' },
|
||||
{ value: roles.VIEWER, label: 'Viewer' },
|
||||
{ value: roles.MEMBER, label: 'No Default Access' },
|
||||
{ value: roles.OWNER, label: t('Owner') },
|
||||
{ value: roles.EDITOR, label: t('Editor') },
|
||||
{ value: roles.VIEWER, label: t('Viewer') },
|
||||
{ value: roles.MEMBER, label: t('NoDefaultAccess') },
|
||||
];
|
||||
// Select options for the resource's maxInheritedRole dropdown.
|
||||
public readonly inheritSelectOptions: IMemberSelectOption[] = [
|
||||
{ value: roles.OWNER, label: 'In Full' },
|
||||
{ value: roles.EDITOR, label: 'View & Edit' },
|
||||
{ value: roles.VIEWER, label: 'View Only' },
|
||||
{ value: null, label: 'None' }
|
||||
{ value: roles.OWNER, label: t('InFull') },
|
||||
{ value: roles.EDITOR, label: t('ViewAndEdit') },
|
||||
{ value: roles.VIEWER, label: t('ViewOnly') },
|
||||
{ value: null, label: t('None') }
|
||||
];
|
||||
// Select options for the public member's role dropdown.
|
||||
public readonly publicUserSelectOptions: IMemberSelectOption[] = [
|
||||
{ value: roles.EDITOR, label: 'Editor' },
|
||||
{ value: roles.VIEWER, label: 'Viewer' },
|
||||
{ value: roles.EDITOR, label: t('Editor') },
|
||||
{ value: roles.VIEWER, label: t('Viewer') },
|
||||
];
|
||||
|
||||
public activeUser: FullUser|null = this._options.activeUser ?? null;
|
||||
|
||||
Reference in New Issue
Block a user