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:
Arnaud Peich
2022-10-28 18:11:08 +02:00
committed by GitHub
parent ec20e7fb68
commit 79deeca640
78 changed files with 2364 additions and 665 deletions

View File

@@ -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;