Skip to content

Commit

Permalink
tidy translations and add some
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Sep 28, 2024
1 parent ab462ea commit a6486b7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 34 deletions.
7 changes: 5 additions & 2 deletions html/src/Components/Haffix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ import { IconArrowLeft, IconLogout } from "@tabler/icons-react";
import { Link, useMatch } from "react-router-dom";
import { H } from "@/APIClient";
import { useAuthContext } from "@/AuthContext";
import { useTranslation } from "react-i18next";

export function Haffix() {
const { t } = useTranslation();

const location = useMatch('/:share')
const { setAuthInfo } = useAuthContext()

return(
<>
<Affix position={{ bottom: 50 }} w="100%" ta="center">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Shares">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("shares")}>
<ActionIcon size="lg" mr="lg" disabled={location?.params.share == 'shares'} component={Link} to="/shares" color="blue" radius="xl"><IconArrowLeft style={{ width: '70%', height: '70%' }} /></ActionIcon>
</Tooltip>
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Logout">
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("logout")}>
<ActionIcon size="lg" variant="light" color="red" radius="xl" onClick={() => { setAuthInfo(null);H.logoutNow(); window.location.href='/'}}><IconLogout style={{ width: '70%', height: '70%' }} /></ActionIcon>
</Tooltip>
</Affix>
Expand Down
3 changes: 2 additions & 1 deletion html/src/Components/ShareComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useTranslation } from "react-i18next";

export function ShareComponent(props: {share: Share}) {
const { t } = useTranslation();

// Initialize States
const [share,setShare] = useState(props.share)
const [deleted,setDeleted] = useState(false)
Expand Down Expand Up @@ -155,7 +156,7 @@ export function ShareComponent(props: {share: Share}) {
<IconDots style={{ width: '70%', height: '70%' }} stroke={1.5}/>
</ActionIcon>
</Tooltip>
<ShareEditor buttonTitle="Update" onChange={setNewOptions} onClick={updateShare} options={newOptions}/>
<ShareEditor buttonTitle={t("update")} onChange={setNewOptions} onClick={updateShare} options={newOptions}/>
</ResponsivePopover>
</ActionIconGroup>
</Flex>
Expand Down
89 changes: 58 additions & 31 deletions html/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,29 @@ i18n
// `translation` is the default namespace.
// More details about namespaces shortly.
translation: {
// Generic
copy_url: "Copy URL",
copied: "Copied!",
download_button: "Download",

// Share page
drag_area: "Drag files here or click to select files",

sorry_share_expired: "Sorry, this share has expired.",
share_does_not_exists: "Share does not exists.",
please_check_link: "Please check the link used to access this page.",
reload: "Reload",

download_all: "Download all",

// Shares page
no_shares: "There are currently no shares.",
create_share: "Create Share",
your_shares: "Your Shares",
other_shares: "Other Shares",
create: "Create",

// Share component
guests_can_upload: "Guests can upload",
guests_can_download: "Guests can download",
guests_can_upload_and_download: "Guests can upload & download",
Expand All @@ -57,7 +74,15 @@ i18n
unlimited: "Unlimited",
expired: "Expired",
created: "Created",
delete_share: "Delete Share",
edit_share: "Edit",
update: "Update",

// Item Component
delete_file: "Delete",
delete_this_item: "Delete this file?",

// Share editor
exposure: "Exposure",
you_want_to: "You want to :",
send: "Send",
Expand All @@ -68,36 +93,41 @@ i18n
number_of_days_the_share_is_valid: "Number of days the share is valid. 0 is unlimited.",
description: "Description",

create: "Create",

// Markdown Editor
message: "Message",
markdown_description: "This markdown will be displayed to the user",

sorry_share_expired: "Sorry, this share has expired.",
share_does_not_exists: "Share does not exists.",
please_check_link: "Please check the link used to access this page.",
reload: "Reload",

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?",
// Haffix
shares: "Shares",
logout: "Logout",
},
},
// Arabic
fr: {
translation: {
// Generic
copy_url: "Copier le lien",
copied: "Copié!",
download_button: "Télécharger",

// Share page
drag_area: "Glissez des fichiers ou cliquez pour sélectionner",

sorry_share_expired: "Désolé, ce partage a expiré.",
share_does_not_exists: "Ce partage n'existe pas.",
please_check_link: "Merci de vérifier le lien qui vous a été transmis.",
reload: "Recharger",

download_all: "Tout Télécharger",

// Shares page
no_shares: "Il n'y a aucun partage.",
create_share: "Créer un partage",
your_shares: "Vos Partages",
other_shares: "Autres Partages",
create: "Créer",

// Share component
guests_can_upload: "Les invités peuvent envoyer",
guests_can_download: "Les invités peuvent télécharger",
guests_can_upload_and_download: "Les invités peuvent envoyer & télécharger",
Expand All @@ -109,7 +139,15 @@ i18n
unlimited: "Illimité",
expired: "Expiré",
created: "Créé le",
delete_share: "Supprimer",
edit_share: "Modifier",
update: "Mettre à jour",

// Item Component
delete_file: "Supprimer",
delete_this_item: "Supprimer ce fichier ?",

// Share editor
exposure: "Type de partage",
you_want_to: "Vous souhaitez :",
send: "Envoyer",
Expand All @@ -120,24 +158,13 @@ i18n
number_of_days_the_share_is_valid: "Nombre de jours pendant lesquels le partage est valide. 0 signifie illimité.",
description: "Description",

create: "Créer",

// Markdown Editor
message: "Message",
markdown_description: "Ce markdown sera affiché à l'utilisateur",

sorry_share_expired: "Désolé, ce partage a expiré.",
share_does_not_exists: "Ce partage n'existe pas.",
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 ?",
// Haffix
shares: "Partages",
logout: "Quitter",
},
},
},
Expand Down

0 comments on commit a6486b7

Please sign in to comment.