🌐 Translation of modals and forms to French (120) (#122)
This commit is contained in:
@@ -6,6 +6,8 @@ import { DriveApiClient } from '../api-client/api-client';
|
||||
import { DriveItemAtom, DriveItemChildrenAtom } from '../state/store';
|
||||
import { BrowseFilter, DriveItem, DriveItemVersion } from '../types';
|
||||
import { SharedWithMeFilterState } from '../state/shared-with-me-filter';
|
||||
import Languages from "features/global/services/languages-service";
|
||||
|
||||
/**
|
||||
* Returns the children of a drive item
|
||||
* @param id
|
||||
@@ -36,7 +38,7 @@ export const useDriveActions = () => {
|
||||
}
|
||||
return details;
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to load your files.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_load_file'));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -51,7 +53,7 @@ export const useDriveActions = () => {
|
||||
driveFile = await DriveApiClient.create(companyId, { item, version });
|
||||
await refresh(item.parent_id!);
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to create a new file.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_create_file'));
|
||||
}
|
||||
return driveFile;
|
||||
},
|
||||
@@ -64,7 +66,7 @@ export const useDriveActions = () => {
|
||||
const url = await DriveApiClient.getDownloadUrl(companyId, id, versionId);
|
||||
(window as any).open(url, '_blank').focus();
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to download this file.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_download_file'));
|
||||
}
|
||||
},
|
||||
[companyId],
|
||||
@@ -76,7 +78,7 @@ export const useDriveActions = () => {
|
||||
const url = await DriveApiClient.getDownloadZipUrl(companyId, ids);
|
||||
(window as any).open(url, '_blank').focus();
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to download this files.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_download_file'));
|
||||
}
|
||||
},
|
||||
[companyId],
|
||||
@@ -88,7 +90,7 @@ export const useDriveActions = () => {
|
||||
await DriveApiClient.remove(companyId, id);
|
||||
await refresh(parentId || '');
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to remove this file.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_remove_file'));
|
||||
}
|
||||
},
|
||||
[refresh],
|
||||
@@ -102,7 +104,7 @@ export const useDriveActions = () => {
|
||||
await refresh(parentId || '');
|
||||
if (update?.parent_id !== parentId) await refresh(update?.parent_id || '');
|
||||
} catch (e) {
|
||||
ToasterService.error('Unable to update this file.');
|
||||
ToasterService.error(Languages.t('hooks.use-drive-actions.unable_update_file'));
|
||||
}
|
||||
},
|
||||
[refresh],
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Info } from '@atoms/text';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
import _ from 'lodash';
|
||||
|
||||
|
||||
export default (props: {
|
||||
className?: string;
|
||||
onChange: (users: UserType[]) => void;
|
||||
@@ -38,7 +39,7 @@ export default (props: {
|
||||
}
|
||||
}, 200);
|
||||
}}
|
||||
placeholder="Search users"
|
||||
placeholder={Languages.t('components.select-users_search_users')}
|
||||
className={props.className + ' ' + className + ' w-full'}
|
||||
theme="plain"
|
||||
onChange={e => search(e.target.value)}
|
||||
|
||||
@@ -7,6 +7,8 @@ import { DriveItemSelectedList } from '@features/drive/state/store';
|
||||
import { DriveItem } from '@features/drive/types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
|
||||
|
||||
export type ConfirmTrashModalType = {
|
||||
open: boolean;
|
||||
@@ -45,12 +47,11 @@ const ConfirmTrashModalContent = ({ items }: { items: DriveItem[] }) => {
|
||||
return (
|
||||
<ModalContent
|
||||
title={
|
||||
items.length === 1 ? `Move ${item?.name} to trash` : `Move ${items.length} items to trash`
|
||||
items.length === 1 ? Languages.t('compenents.ConfirmTrashModalContent_move') + " '" + item?.name + "' " + Languages.t('compenents.ConfirmTrashModalContent_to_trash') : Languages.t('compenents.ConfirmTrashModalContent_move') + " " + items.length + " " + Languages.t('compenents.ConfirmTrashModalContent_items_to_trash')
|
||||
}
|
||||
>
|
||||
<Base className="block my-3">
|
||||
Click 'Move to trash' to move the selected items to the trash folder. You can restore them
|
||||
later from the trash.
|
||||
{Languages.t('compenents.ConfirmTrashModalContent_move_to_trash_desc')}
|
||||
</Base>
|
||||
<br />
|
||||
<Button
|
||||
@@ -65,7 +66,7 @@ const ConfirmTrashModalContent = ({ items }: { items: DriveItem[] }) => {
|
||||
setState({ ...state, open: false });
|
||||
}}
|
||||
>
|
||||
Move to trash
|
||||
{Languages.t('compenents.ConfirmTrashModalContent_move_to_trash')}
|
||||
</Button>
|
||||
</ModalContent>
|
||||
);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { useDriveActions } from '@features/drive/hooks/use-drive-actions';
|
||||
import { useDriveItem } from '@features/drive/hooks/use-drive-item';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
|
||||
export type PropertiesModalType = {
|
||||
open: boolean;
|
||||
@@ -47,15 +48,15 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
|
||||
}, [item?.name]);
|
||||
|
||||
return (
|
||||
<ModalContent title={'Rename ' + item?.name}>
|
||||
<ModalContent title={Languages.t('compenents.ProprietiesModalContent_rename') + " " + item?.name}>
|
||||
<InputLabel
|
||||
className="mt-4"
|
||||
label={'Name'}
|
||||
label={Languages.t('compenents.ProprietiesModalContent_name')}
|
||||
input={
|
||||
<Input
|
||||
value={name}
|
||||
onChange={e => setName(e.target.value)}
|
||||
placeholder="Document or folder name"
|
||||
placeholder={Languages.t('compenents.ProprietiesModalContent_place_holder')}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
@@ -79,7 +80,7 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
Update name
|
||||
{Languages.t('compenents.ProprietiesModalContent_update_button')}
|
||||
</Button>
|
||||
</ModalContent>
|
||||
);
|
||||
|
||||
@@ -7,6 +7,8 @@ import { DriveItem } from '@features/drive/types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import { PathRender } from '../../header-path';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
|
||||
|
||||
export type SelectorModalType = {
|
||||
open: boolean;
|
||||
@@ -134,13 +136,13 @@ const SelectorModalContent = () => {
|
||||
}}
|
||||
>
|
||||
{selected.length === 0 ? (
|
||||
<>No item selected</>
|
||||
<>{Languages.t('components.SelectorModalContent_no_items')}</>
|
||||
) : state.mode === 'move' ? (
|
||||
<>Move to '{selected[0]?.name}'</>
|
||||
<>{Languages.t('components.SelectorModalContent_move_to')} '{selected[0]?.name}'</>
|
||||
) : selected.length > 1 ? (
|
||||
<>Select {selected.length} files</>
|
||||
<> {selected.length} {Languages.t('components.SelectorModalContent_select')} {Languages.t('components.SelectorModalContent_files')}</>
|
||||
) : (
|
||||
<>Select '{selected[0]?.name}'</>
|
||||
<>{Languages.t('components.SelectorModalContent_select')} '{selected[0]?.name}'</>
|
||||
)}
|
||||
</Button>
|
||||
</ModalContent>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Select from '@atoms/input/input-select';
|
||||
import { DriveFileAccessLevel } from '@features/drive/types';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
export const AccessLevel = ({
|
||||
disabled,
|
||||
@@ -27,10 +28,10 @@ export const AccessLevel = ({
|
||||
value={level || 'none'}
|
||||
onChange={e => onChange(e.target.value as DriveFileAccessLevel & 'remove')}
|
||||
>
|
||||
{!hiddenLevels?.includes('manage') && <option value={'manage'}>Full access</option>}
|
||||
{!hiddenLevels?.includes('write') && <option value={'write'}>Write</option>}
|
||||
{!hiddenLevels?.includes('read') && <option value={'read'}>Read</option>}
|
||||
{!hiddenLevels?.includes('none') && <option value={'none'}>No access</option>}
|
||||
{!hiddenLevels?.includes('manage') && <option value={'manage'}>{Languages.t('common.access-level_full_acess')}</option>}
|
||||
{!hiddenLevels?.includes('write') && <option value={'write'}>{Languages.t('common.access-level_write')}</option>}
|
||||
{!hiddenLevels?.includes('read') && <option value={'read'}>{Languages.t('common.access-level_read')}</option>}
|
||||
{!hiddenLevels?.includes('none') && <option value={'none'}>{Languages.t('common.access-level_no_access')}</option>}
|
||||
{canRemove && <option value={'remove'}>Remove</option>}
|
||||
</Select>
|
||||
);
|
||||
|
||||
@@ -4,6 +4,8 @@ import { useEffect } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import { InternalAccessManager } from './internal-access';
|
||||
import { PublicLinkManager } from './public-link-access';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
|
||||
export type AccessModalType = {
|
||||
open: boolean;
|
||||
@@ -38,7 +40,7 @@ const AccessModalContent = ({ id }: { id: string }) => {
|
||||
console.log(item?.access_info?.public?.level, 'item');
|
||||
|
||||
return (
|
||||
<ModalContent title={'Manage access to ' + item?.name}>
|
||||
<ModalContent title={Languages.t('components.item_context_menu.manage_access_to') + " " + item?.name}>
|
||||
<PublicLinkManager id={id} disabled={access !== 'manage'} />
|
||||
<InternalAccessManager id={id} disabled={access !== 'manage'} />
|
||||
</ModalContent>
|
||||
|
||||
+11
-9
@@ -11,6 +11,8 @@ import { UserType } from '@features/users/types/user';
|
||||
import { useState } from 'react';
|
||||
import SelectUsers from '../../components/select-users';
|
||||
import { AccessLevel } from './common';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
|
||||
export const InternalAccessManager = ({ id, disabled }: { id: string; disabled: boolean }) => {
|
||||
const { item, loading, update } = useDriveItem(id);
|
||||
@@ -26,15 +28,15 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
|
||||
|
||||
return (
|
||||
<>
|
||||
<Base className="block mt-4 mb-1">General access management</Base>
|
||||
<Base className="block mt-4 mb-1">{Languages.t('components.internal-access_access_manage')}</Base>
|
||||
|
||||
<div className="rounded-md border overflow-hidden">
|
||||
{folderEntity && (
|
||||
<div className="p-4 border-b flex flex-row items-center justify-center">
|
||||
<div className="grow">
|
||||
<Base>Inherit parent folder</Base>
|
||||
<Base>{Languages.t('components.internal-access_inherit_parent')}</Base>
|
||||
<br />
|
||||
<Info>Choose to inherit or not the parent folder permissions.</Info>
|
||||
<Info>{Languages.t('components.internal-access_inherit_parent_perm')}</Info>
|
||||
</div>
|
||||
<div className="shrink-0 ml-2">
|
||||
<Checkbox
|
||||
@@ -59,7 +61,7 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
|
||||
{companyEntity && folderEntity.level === 'none' && (
|
||||
<div className="p-4 border-b flex flex-row items-center justify-center">
|
||||
<div className="grow">
|
||||
<Base>Every member from the company</Base>
|
||||
<Base>{Languages.t('components.internal-access_company_member')}</Base>
|
||||
</div>
|
||||
<div className="shrink-0 ml-2">
|
||||
<AccessLevel
|
||||
@@ -84,10 +86,10 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
|
||||
{channelEntities.length > 0 && (
|
||||
<div className="p-4 border-b flex flex-row items-center justify-center">
|
||||
<div className="grow">
|
||||
<Base>Channel access</Base>
|
||||
<Base>{Languages.t('components.internal-access_cannal')}</Base>
|
||||
<br />
|
||||
<Info>
|
||||
{channelEntities.length} channel(s) from Tdrive chat have access to this item.
|
||||
{channelEntities.length} {Languages.t('components.internal-access_cannal_info')}
|
||||
</Info>
|
||||
</div>
|
||||
<div className="shrink-0 ml-2">
|
||||
@@ -112,7 +114,7 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
|
||||
//Do nothing
|
||||
},
|
||||
{
|
||||
text: 'You will need to go to Tdrive chat to give back access to this item.',
|
||||
text: Languages.t('components.internal-access_cannal_info_give_back'),
|
||||
},
|
||||
);
|
||||
} else {
|
||||
@@ -139,7 +141,7 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
|
||||
<div className="-mb-px" />
|
||||
</div>
|
||||
|
||||
<Base className="block mt-4 mb-1">Specific access rules</Base>
|
||||
<Base className="block mt-4 mb-1">{Languages.t('components.internal-access_specific_rules')}</Base>
|
||||
<div className="rounded-md border mt-2">
|
||||
<UserAccessSelector id={id} disabled={disabled} />
|
||||
|
||||
@@ -219,7 +221,7 @@ const UserAccessLevel = ({
|
||||
</div>
|
||||
<div className="grow ml-2">
|
||||
<Base>{!!user && currentUserService.getFullName(user)}</Base>{' '}
|
||||
{user?.id === currentUser?.id && <Info>(you)</Info>}
|
||||
{user?.id === currentUser?.id && <Info>{Languages.t('components.internal-access_specific_rules_you')}</Info>}
|
||||
</div>
|
||||
<div className="shrink-0 ml-2">
|
||||
<AccessLevel
|
||||
|
||||
+13
-12
@@ -8,6 +8,7 @@ import { Input } from 'app/atoms/input/input-text';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { AccessLevel } from './common';
|
||||
import moment from 'moment';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
export const PublicLinkManager = ({ id, disabled }: { id: string; disabled?: boolean }) => {
|
||||
const { item, loading, update } = useDriveItem(id);
|
||||
@@ -15,15 +16,15 @@ export const PublicLinkManager = ({ id, disabled }: { id: string; disabled?: boo
|
||||
|
||||
return (
|
||||
<>
|
||||
<Base className="block mt-2 mb-1">Public link access</Base>
|
||||
<Base className="block mt-2 mb-1">{Languages.t('components.public-link-acess.public_link_acess')}</Base>
|
||||
<div className="p-4 rounded-md border">
|
||||
<div className="flex flex-row overflow-hidden w-full">
|
||||
<div className="grow">
|
||||
{item?.access_info?.public?.level !== 'none' && (
|
||||
<Info>Anyone with this link will have access to this item.</Info>
|
||||
<Info>{Languages.t('components.public-link-acess.info_acess_true')}</Info>
|
||||
)}
|
||||
{item?.access_info?.public?.level === 'none' && (
|
||||
<Info>This item is not available by public link.</Info>
|
||||
<Info>{Languages.t('components.public-link-acess.info_acess_false')}</Info>
|
||||
)}
|
||||
{item?.access_info?.public?.level !== 'none' && (
|
||||
<>
|
||||
@@ -32,10 +33,10 @@ export const PublicLinkManager = ({ id, disabled }: { id: string; disabled?: boo
|
||||
className="inline-block"
|
||||
onClick={() => {
|
||||
copyToClipboard(publicLink);
|
||||
ToasterService.success('Public link copied to clipboard');
|
||||
ToasterService.success(Languages.t('components.public-link-copied-info'));
|
||||
}}
|
||||
>
|
||||
Copy public link to clip board
|
||||
{Languages.t('components.public-link-copy')}
|
||||
</A>
|
||||
</>
|
||||
)}
|
||||
@@ -116,7 +117,7 @@ const PublicLinkOptions = (props: {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Subtitle className="block mt-4 mb-1">Public link security</Subtitle>
|
||||
<Subtitle className="block mt-4 mb-1">{Languages.t('components.public-link-security')}</Subtitle>
|
||||
<div className="flex items-center justify-center w-full h-10">
|
||||
<Checkbox
|
||||
disabled={props.disabled}
|
||||
@@ -125,7 +126,7 @@ const PublicLinkOptions = (props: {
|
||||
if (!password && s) setPassword(Math.random().toString(36).slice(-8));
|
||||
}}
|
||||
value={!!usePassword}
|
||||
label="Password"
|
||||
label={Languages.t('components.public-link-security_password')}
|
||||
/>
|
||||
<div className="grow mr-2" />
|
||||
{!!usePassword && (
|
||||
@@ -142,14 +143,14 @@ const PublicLinkOptions = (props: {
|
||||
e.preventDefault();
|
||||
if (password) {
|
||||
copyToClipboard(password);
|
||||
ToasterService.success('Password copied to clipboard');
|
||||
ToasterService.success(Languages.t('components.public-link-security_password_copied'));
|
||||
}
|
||||
}
|
||||
}}
|
||||
// saves and copies password
|
||||
onClick={() => {
|
||||
if (password) copyToClipboard(password);
|
||||
ToasterService.success('Password copied to clipboard');
|
||||
ToasterService.success(Languages.t('components.public-link-security_password_copied'));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -162,13 +163,13 @@ const PublicLinkOptions = (props: {
|
||||
if (!expiration && s) setExpiration(Date.now() + 1000 * 60 * 60 * 24 * 7);
|
||||
}}
|
||||
value={!!useExpiration}
|
||||
label="Expiration"
|
||||
label={Languages.t('components.public-link-security_expired')}
|
||||
/>
|
||||
{useExpiration && (expiration || 0) < Date.now() && (
|
||||
<Info className="ml-2 text-red-500">(Expired)</Info>
|
||||
<Info className="ml-2 text-red-500">({Languages.t('components.public-link-security_expired')})</Info>
|
||||
)}
|
||||
{useExpiration && (expiration || 0) > Date.now() && (
|
||||
<Info className="ml-2">({moment(expiration).fromNow(true)})</Info>
|
||||
<Info className="ml-2">({moment(expiration).fromNow(true).toLocaleString()})</Info>
|
||||
)}{' '}
|
||||
<div className="grow mr-2" />
|
||||
{!!useExpiration && (
|
||||
|
||||
@@ -9,6 +9,8 @@ import { formatDate } from '@features/global/utils/format-date';
|
||||
import _ from 'lodash';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
|
||||
|
||||
export type VersionsModalType = {
|
||||
open: boolean;
|
||||
@@ -47,7 +49,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
if (!item?.last_version_cache) return <></>;
|
||||
|
||||
return (
|
||||
<ModalContent title={'Versions of ' + item?.name}>
|
||||
<ModalContent title={Languages.t('compenents.VersionModalContent_version') + " " + item?.name}>
|
||||
<UploadZone
|
||||
overClassName={'!m-4'}
|
||||
disableClick
|
||||
@@ -68,8 +70,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
<div className="flex flex-row">
|
||||
<div className="grow flex items-center">
|
||||
<Base>
|
||||
Manage your document version here: Download older version of this document or
|
||||
upload a new version now.
|
||||
{Languages.t('compenents.VersionModalContent_version_dec')}
|
||||
</Base>
|
||||
</div>
|
||||
<div className="shrink-0 ml-4 flex items-center">
|
||||
@@ -78,7 +79,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
onClick={() => uploadZoneRef.current?.open()}
|
||||
loading={loading}
|
||||
>
|
||||
Create version
|
||||
{Languages.t('compenents.VersionModalContent_create')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,7 +109,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
</div>
|
||||
<div className="shrink-0 ml-4">
|
||||
<Button theme="outline" onClick={() => download(id, version.id)}>
|
||||
Download
|
||||
{Languages.t('compenents.VersionModalContent_donwload')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@ export default () => {
|
||||
theme="white"
|
||||
className={'w-full mb-1 ' + (folderType === 'shared' && viewId == ''? activeClass : '')}
|
||||
>
|
||||
<UserGroupIcon className="w-5 h-5 mr-4" /> Shared with me
|
||||
<UserGroupIcon className="w-5 h-5 mr-4" /> {Languages.t('components.side_menu.shared_with_me')}
|
||||
</Button>
|
||||
{false && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user