Skip to content

Commit

Permalink
new: add missing french translations
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Sep 28, 2024
1 parent a38a551 commit ab462ea
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
12 changes: 8 additions & 4 deletions html/src/Components/ItemComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { QueueItem } from "../UploadQueue";
import { humanFileSize, Item } from "../hupload";
import classes from './ItemComponent.module.css';
import { ReactNode } from "react";
import { useTranslation } from "react-i18next";

export function ItemComponent(props: {download: boolean, onDelete?: (item:string) => void, canDelete: boolean, item?: Item, queueItem?: QueueItem}) {
const { t } = useTranslation();

// Initialize props
const {download, canDelete, onDelete, item, queueItem} = props
Expand Down Expand Up @@ -70,21 +72,23 @@ export function ItemComponent(props: {download: boolean, onDelete?: (item:string
{canDelete &&
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Delete File">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("delete_file")}>
<ActionIcon ml="sm" variant="light" color="red" >
<IconTrash style={{ width: '70%', height: '70%' }} stroke={1.5}/>
</ActionIcon>
</Tooltip>
</Popover.Target>
<Popover.Dropdown className={classes.popover}>
<Text ta="center" size="xs" mb="xs">Delete this item ?</Text>
<Button aria-description="delete" w="100%" variant='default' c='red' size="xs" onClick={() => {onDelete&&onDelete(item?.Path.split("/")[1])}}>Delete</Button>
<Text ta="center" size="xs" mb="xs">{t("delete_this_item")}</Text>
<Button aria-description="delete" w="100%" variant='default' c='red' size="xs" onClick={() => {onDelete&&onDelete(item?.Path.split("/")[1])}}>{t("delete_file")}</Button>
</Popover.Dropdown>
</Popover>
}
{download &&
<ActionIcon ml="sm" component="a" href={'/d/'+item?.Path.split("/")[0]+'/'+item?.Path.split("/")[1]} aria-label="Download" variant="light" color="blue">
<IconDownload style={{ width: '70%', height: '70%' }} stroke={1.5} />
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("download_button")}>
<IconDownload style={{ width: '70%', height: '70%' }} stroke={1.5} />
</Tooltip>
</ActionIcon>
}
</>
Expand Down
6 changes: 3 additions & 3 deletions html/src/Components/ShareComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function ShareComponent(props: {share: Share}) {
{/* Copy button */}
<CopyButton value={window.location.protocol + '//' + window.location.host + '/' + name}>
{({ copied, copy }) => (
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={copied?"Copied!":"Copy URL"}>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={copied?t("copied"):t("copy_url")}>
<ActionIcon id="copy" variant="light" color={copied ? 'teal' : 'blue'} onClick={copy} >
<IconLink style={{ width: '70%', height: '70%' }} stroke={1.5}/>
</ActionIcon>
Expand All @@ -136,7 +136,7 @@ export function ShareComponent(props: {share: Share}) {
{/* Delete button with confirmation Popover */}
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Delete Share">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("delete_share")}>
<ActionIcon id="delete" variant="light" color="red" >
<IconTrash style={{ width: '70%', height: '70%' }} stroke={1.5}/>
</ActionIcon>
Expand All @@ -150,7 +150,7 @@ export function ShareComponent(props: {share: Share}) {

{/* Edit share properties button */}
<ResponsivePopover withDrawer={!isBrowser}>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Edit Share">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("edit_share")}>
<ActionIcon id="edit" variant="light" color="blue" >
<IconDots style={{ width: '70%', height: '70%' }} stroke={1.5}/>
</ActionIcon>
Expand Down
6 changes: 4 additions & 2 deletions html/src/Pages/SharePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,15 @@ export function SharePage() {
<Group gap="md" justify={"center"} w="100%" mb="sm">
<CopyButton value={window.location.protocol + '//' + window.location.host + '/' + share.name}>
{({ copied, copy }) => (
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={copied?"Copied!":"Copy URL"}>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={copied?t("copied"):t("copy_url")}>
<Button justify="center" variant="outline" color={copied ? 'teal' : 'gray'} size="xs" onClick={copy}><IconLink style={{ width: '70%', height: '70%' }} stroke={1.5}/>{share.name}</Button>
</Tooltip>
)}
</CopyButton>
{canDownload() && items.length + queueItems.filter((i) => i.failed === false && i.finished === true ).length > 0 &&
<Button component="a" href={'/d/'+share.name} justify="center" variant="outline" size="xs"><IconDownload style={{ width: '70%', height: '70%' }} stroke={1.5}/>{t("download_button")}</Button>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("download_all")}>
<Button component="a" href={'/d/'+share.name} justify="center" variant="outline" size="xs"><IconDownload style={{ width: '70%', height: '70%' }} stroke={1.5}/>{t("download_button")}</Button>
</Tooltip>
}
</Group>
</Box>
Expand Down
16 changes: 15 additions & 1 deletion html/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ i18n
please_check_link: "Please check the link used to access this page.",
reload: "Reload",

download_button: "Download",
delete_share: "Delete Share",
edit_share: "Edit",

copy_url: "Copy URL",
copied: "Copied!",
download_all: "Download all",
download_button: "Download",
delete_file: "Delete",
delete_this_item: "Delete this file?",
},
},
// Arabic
Expand Down Expand Up @@ -123,7 +130,14 @@ i18n
please_check_link: "Merci de vérifier le lien qui vous a été transmis.",
reload: "Recharger",

delete_share: "Supprimer",
edit_share: "Modifier",
copy_url: "Copier le lien",
copied: "Copié!",
download_all: "Tout Télécharger",
download_button: "Télécharger",
delete_file: "Supprimer",
delete_this_item: "Supprimer ce fichier ?",
},
},
},
Expand Down

0 comments on commit ab462ea

Please sign in to comment.