Skip to content

Commit

Permalink
i18n adapt components etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Nov 25, 2024
1 parent ab19d2e commit 5eb2796
Show file tree
Hide file tree
Showing 17 changed files with 296 additions and 70 deletions.
4 changes: 2 additions & 2 deletions web/src/core/usecases/fileExplorer/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export namespace ShareView {
isPublic: false;
validityDurationSecond: number;
validityDurationSecondOptions: number[];
signedUrl: string | undefined;
url: string | undefined;
isSignedUrlBeingRequested: boolean;
};
}
Expand Down Expand Up @@ -262,7 +262,7 @@ const shareView = createSelector(
...common,
isPublic: false,
isSignedUrlBeingRequested,
signedUrl: url,
url,
validityDurationSecond,
validityDurationSecondOptions
});
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/de.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,30 @@ export const translations: Translations<"de"> = {
)
},
ShareDialog: {
cancel: "Abbrechen",
"create and copy link": "Erstellen und kopieren"
title: "Ihre Daten teilen",
close: "Schließen",
"create and copy link": "Link erstellen und kopieren",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Ihre Datei ist öffentlich, jeder mit dem Link kann sie herunterladen.";
case "private":
return "Ihre Datei ist derzeit privat.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "Um den Zugriff einzuschränken, ändern Sie den Freigabestatus Ihrer Datei.";
case "private":
return "Um Ihre Datei freizugeben und Zugriff zu gewähren, ändern Sie den Freigabestatus oder erstellen Sie einen temporären Zugriffslink.";
}
},
"hint link access": params =>
params.policy === "private"
? `Dieser Link gewährt für ${params.expiration} Zugriff auf Ihre Daten.`
: "Ihr Link ist verfügbar, solange die Datei öffentlich ist",
"label input link": "Zugriffslink"
},
MySecrets: {
"page title - my secrets": "Meine Geheimnisse",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/en.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,30 @@ export const translations: Translations<"en"> = {
)
},
ShareDialog: {
cancel: "Cancel",
"create and copy link": "Create and copy link"
title: "Share your data",
close: "Close",
"create and copy link": "Create and copy link",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Your file is public, anyone with the link can download it.";
case "private":
return "Your file is currently private.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "To restrict its access, change your file's sharing status.";
case "private":
return "To share and provide access to your file, change the sharing status or create a temporary access link.";
}
},
"hint link access": params =>
params.policy === "private"
? `This link will grant access to your data for ${params.expiration}.`
: "Your link is available as long as the file is public",
"label input link": "Access link"
},
MySecrets: {
"page title - my secrets": "My Secrets",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/es.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,30 @@ export const translations: Translations<"en"> = {
)
},
ShareDialog: {
cancel: "Cancelar",
"create and copy link": "Crear y copiar enlace"
title: "Compartir tus datos",
close: "Cerrar",
"create and copy link": "Crear y copiar enlace",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Tu archivo es público, cualquier persona con el enlace puede descargarlo.";
case "private":
return "Tu archivo está actualmente privado.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "Para restringir su acceso, cambia el estado de difusión de tu archivo.";
case "private":
return "Para compartir y dar acceso a tu archivo, cambia el estado de difusión o crea un enlace de acceso temporal.";
}
},
"hint link access": params =>
params.policy === "private"
? `Este enlace otorgará acceso a tus datos durante ${params.expiration}.`
: "Tu enlace está disponible mientras el archivo sea público",
"label input link": "Enlace de acceso"
},
MySecrets: {
"page title - my secrets": "Mis Secretos",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/fi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,30 @@ export const translations: Translations<"fi"> = {
)
},
ShareDialog: {
cancel: "Peruuta",
"create and copy link": "Luo ja kopioi linkki"
title: "Jaa tietosi",
close: "Sulje",
"create and copy link": "Luo ja kopioi linkki",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Tiedostosi on julkinen, kuka tahansa linkin omistava voi ladata sen.";
case "private":
return "Tiedostosi on tällä hetkellä yksityinen.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "Rajoittaaksesi pääsyä muuta tiedostosi jakamisen tilaa.";
case "private":
return "Jaa tiedosto ja anna pääsy muuttamalla jakamisen tilaa tai luomalla väliaikainen linkki.";
}
},
"hint link access": params =>
params.policy === "private"
? `Tämä linkki antaa pääsyn tietoihisi ${params.expiration} ajaksi.`
: "Linkkisi on käytettävissä niin kauan kuin tiedosto on julkinen",
"label input link": "Pääsylinkki"
},
MySecrets: {
"page title - my secrets": "Omat salaisuudet",
Expand Down
31 changes: 20 additions & 11 deletions web/src/ui/i18n/resources/fr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,26 @@ export const translations: Translations<"fr"> = {
title: "Partager vos données",
close: "Fermer",
"create and copy link": "Créer et copier le lien",
"paragraph current policy": ({
policy
}) => `Votre fichier est public, toute personne ayant le lien peut
télécharger votre fichier`,
"paragraph change policy": ({
policy
}) => `Pour restreindre son accès, changez le statut de diffusion de
votre fichier.`,
"hint link access": ({ policy, expirationDate }) =>
policy === "private"
? `Votre lien ....`
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return `Votre fichier est public, toute personne ayant le lien peut télécharger votre fichier.`;
case "private":
return "Votre fichier est actuellement privé.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return `Pour restreindre son accès, changez le statut de diffusion de
votre fichier.`;
case "private":
return `Pour partager et donner accès à votre fichier, changez le statut de diffusion ou créez un lien d’accès temporaire.`;
}
},
"hint link access": params =>
params.policy === "private"
? `Ce lien donnera un accès à vos données pendant ${params.expiration}.`
: "Votre lien est disponible tant que le fichier est publique",
"label input link": "Lien d'accès"
},
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/it.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,30 @@ export const translations: Translations<"it"> = {
)
},
ShareDialog: {
cancel: "Annulla",
"create and copy link": "Creare e copiare il link"
title: "Condividi i tuoi dati",
close: "Chiudi",
"create and copy link": "Crea e copia il link",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Il tuo file è pubblico, chiunque abbia il link può scaricarlo.";
case "private":
return "Il tuo file è attualmente privato.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "Per limitare l'accesso, modifica lo stato di condivisione del tuo file.";
case "private":
return "Per condividere e dare accesso al tuo file, modifica lo stato di condivisione o crea un link di accesso temporaneo.";
}
},
"hint link access": params =>
params.policy === "private"
? `Questo link garantirà l'accesso ai tuoi dati per ${params.expiration}.`
: "Il tuo link è disponibile finché il file è pubblico",
"label input link": "Link di accesso"
},
MySecrets: {
"page title - my secrets": "I miei segreti",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/nl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,30 @@ export const translations: Translations<"nl"> = {
)
},
ShareDialog: {
cancel: "Annuleren",
"create and copy link": "Creare e copiare il link"
title: "Deel je gegevens",
close: "Sluiten",
"create and copy link": "Link maken en kopiëren",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Je bestand is openbaar, iedereen met de link kan het downloaden.";
case "private":
return "Je bestand is momenteel privé.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "Om toegang te beperken, verander de deelstatus van je bestand.";
case "private":
return "Om toegang te geven tot je bestand, verander de deelstatus of maak een tijdelijke toegangslink.";
}
},
"hint link access": params =>
params.policy === "private"
? `Deze link geeft toegang tot je gegevens gedurende ${params.expiration}.`
: "Je link is beschikbaar zolang het bestand openbaar is",
"label input link": "Toegangslink"
},
MySecrets: {
"page title - my secrets": "My Secrets",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/no.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,30 @@ export const translations: Translations<"no"> = {
)
},
ShareDialog: {
cancel: "Avbryt",
"create and copy link": "Opprett og kopier lenke"
title: "Del dataene dine",
close: "Lukk",
"create and copy link": "Opprett og kopier lenke",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "Filen din er offentlig, alle med lenken kan laste den ned.";
case "private":
return "Filen din er for øyeblikket privat.";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "For å begrense tilgangen, endre delingsstatusen til filen din.";
case "private":
return "For å dele og gi tilgang til filen din, endre delingsstatusen eller opprett en midlertidig tilgangslenke.";
}
},
"hint link access": params =>
params.policy === "private"
? `Denne lenken gir tilgang til dataene dine i ${params.expiration}.`
: "Lenken din er tilgjengelig så lenge filen er offentlig",
"label input link": "Tilgangslenke"
},
MySecrets: {
"page title - my secrets": "Mine hemmeligheter",
Expand Down
26 changes: 24 additions & 2 deletions web/src/ui/i18n/resources/zh-CN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,30 @@ export const translations: Translations<"zh-CN"> = {
)
},
ShareDialog: {
cancel: "取消",
"create and copy link": "创建并复制链接"
title: "分享您的数据",
close: "关闭",
"create and copy link": "创建并复制链接",
"paragraph current policy": ({ policy }) => {
switch (policy) {
case "public":
return "您的文件是公开的,任何拥有链接的人都可以下载。";
case "private":
return "您的文件当前是私密的。";
}
},
"paragraph change policy": ({ policy }) => {
switch (policy) {
case "public":
return "要限制访问,请更改文件的共享状态。";
case "private":
return "要分享并提供对文件的访问,请更改共享状态或创建一个临时访问链接。";
}
},
"hint link access": params =>
params.policy === "private"
? `此链接将在 ${params.expiration} 内提供对您的数据的访问权限。`
: "只要文件是公开的,您的链接就可用",
"label input link": "访问链接"
},
MySecrets: {
"page title - my secrets": "我的密钥",
Expand Down
4 changes: 1 addition & 3 deletions web/src/ui/pages/myFiles/Explorer/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ import {
import type { Item } from "../shared/types";
import { ViewMode } from "../shared/types";
import { isDirectory } from "../shared/tools";
import { ShareDialog } from "../ShareFile/ShareDialog";
import { on } from "events";

export type ExplorerProps = {
/**
Expand Down Expand Up @@ -486,7 +484,7 @@ export const Explorer = memo((props: ExplorerProps) => {
}
/>

<ShareDialog file={} onClose={} isOpen={} />
{/* <ShareDialog file={} onClose={} isOpen={} /> */}

<ExplorerUploadModal
isOpen={isUploadModalOpen}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ export const Default: Story = {
onCopyPath: action("Copy path"),
onSelectedItemKindValueChange: action("Selected item kind changed"),
onPolicyChange: action("Policy change"),
evtAction: Evt.create<"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH">()
evtAction: Evt.create<
"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH" | "SHARE SELECTED FILE"
>(),
onShare: action("Share file")
}
};

Expand All @@ -87,6 +90,9 @@ export const EmptyDirectory: Story = {
onCopyPath: action("Copy path"),
onPolicyChange: action("Policy change"),
onSelectedItemKindValueChange: action("Selected item kind changed"),
evtAction: Evt.create<"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH">()
evtAction: Evt.create<
"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH" | "SHARE SELECTED FILE"
>(),
onShare: action("Share file")
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export const Default: Story = {
onPolicyChange: action("Policy change"),
onCopyPath: action("Copy path"),
onSelectedItemKindValueChange: action("Selected item kind changed"),
evtAction: Evt.create<"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH">()
evtAction: Evt.create<
"DELETE SELECTED ITEM" | "COPY SELECTED ITEM PATH" | "SHARE SELECTED FILE"
>(),
onShare: action("Share file")
}
};
3 changes: 1 addition & 2 deletions web/src/ui/pages/myFiles/MyFiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export default function MyFiles(props: Props) {
uploadProgress,
currentWorkingDirectoryView,
pathMinDepth,
viewMode,
shareView
viewMode
} = useCoreState("fileExplorer", "main");

const { fileExplorer } = useCore().functions;
Expand Down
7 changes: 0 additions & 7 deletions web/src/ui/pages/myFiles/ShareFile/SelectTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ import Select, { SelectChangeEvent } from "@mui/material/Select";
import { tss } from "tss";
import { assert } from "tsafe/assert";

const expirationOptions = [
{ id: "1 heure", name: "1 heure" },
{ id: "12 heures", name: "12 heures" },
{ id: "24 heures", name: "24 heures" },
{ id: "48 heures", name: "48 heures" },
{ id: "7 jours", name: "7 jours" }
];
type Props = {
className?: string;
validityDurationSecondOptions: number[];
Expand Down
Loading

0 comments on commit 5eb2796

Please sign in to comment.