Skip to content

Commit a6486b7

Browse files
committed
tidy translations and add some
1 parent ab462ea commit a6486b7

File tree

3 files changed

+65
-34
lines changed

3 files changed

+65
-34
lines changed

html/src/Components/Haffix.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ import { IconArrowLeft, IconLogout } from "@tabler/icons-react";
33
import { Link, useMatch } from "react-router-dom";
44
import { H } from "@/APIClient";
55
import { useAuthContext } from "@/AuthContext";
6+
import { useTranslation } from "react-i18next";
67

78
export function Haffix() {
9+
const { t } = useTranslation();
10+
811
const location = useMatch('/:share')
912
const { setAuthInfo } = useAuthContext()
1013

1114
return(
1215
<>
1316
<Affix position={{ bottom: 50 }} w="100%" ta="center">
14-
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Shares">
17+
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("shares")}>
1518
<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>
1619
</Tooltip>
17-
<Tooltip withArrow arrowOffset={10} arrowSize={4} label="Logout">
20+
<Tooltip withArrow arrowOffset={10} arrowSize={4} label={t("logout")}>
1821
<ActionIcon size="lg" variant="light" color="red" radius="xl" onClick={() => { setAuthInfo(null);H.logoutNow(); window.location.href='/'}}><IconLogout style={{ width: '70%', height: '70%' }} /></ActionIcon>
1922
</Tooltip>
2023
</Affix>

html/src/Components/ShareComponent.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useTranslation } from "react-i18next";
1515

1616
export function ShareComponent(props: {share: Share}) {
1717
const { t } = useTranslation();
18+
1819
// Initialize States
1920
const [share,setShare] = useState(props.share)
2021
const [deleted,setDeleted] = useState(false)
@@ -155,7 +156,7 @@ export function ShareComponent(props: {share: Share}) {
155156
<IconDots style={{ width: '70%', height: '70%' }} stroke={1.5}/>
156157
</ActionIcon>
157158
</Tooltip>
158-
<ShareEditor buttonTitle="Update" onChange={setNewOptions} onClick={updateShare} options={newOptions}/>
159+
<ShareEditor buttonTitle={t("update")} onChange={setNewOptions} onClick={updateShare} options={newOptions}/>
159160
</ResponsivePopover>
160161
</ActionIconGroup>
161162
</Flex>

html/src/i18n/config.ts

+58-31
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,29 @@ i18n
4040
// `translation` is the default namespace.
4141
// More details about namespaces shortly.
4242
translation: {
43+
// Generic
44+
copy_url: "Copy URL",
45+
copied: "Copied!",
46+
download_button: "Download",
47+
48+
// Share page
4349
drag_area: "Drag files here or click to select files",
50+
51+
sorry_share_expired: "Sorry, this share has expired.",
52+
share_does_not_exists: "Share does not exists.",
53+
please_check_link: "Please check the link used to access this page.",
54+
reload: "Reload",
55+
56+
download_all: "Download all",
57+
58+
// Shares page
4459
no_shares: "There are currently no shares.",
4560
create_share: "Create Share",
4661
your_shares: "Your Shares",
4762
other_shares: "Other Shares",
63+
create: "Create",
4864

65+
// Share component
4966
guests_can_upload: "Guests can upload",
5067
guests_can_download: "Guests can download",
5168
guests_can_upload_and_download: "Guests can upload & download",
@@ -57,7 +74,15 @@ i18n
5774
unlimited: "Unlimited",
5875
expired: "Expired",
5976
created: "Created",
77+
delete_share: "Delete Share",
78+
edit_share: "Edit",
79+
update: "Update",
80+
81+
// Item Component
82+
delete_file: "Delete",
83+
delete_this_item: "Delete this file?",
6084

85+
// Share editor
6186
exposure: "Exposure",
6287
you_want_to: "You want to :",
6388
send: "Send",
@@ -68,36 +93,41 @@ i18n
6893
number_of_days_the_share_is_valid: "Number of days the share is valid. 0 is unlimited.",
6994
description: "Description",
7095

71-
create: "Create",
72-
96+
// Markdown Editor
7397
message: "Message",
7498
markdown_description: "This markdown will be displayed to the user",
7599

76-
sorry_share_expired: "Sorry, this share has expired.",
77-
share_does_not_exists: "Share does not exists.",
78-
please_check_link: "Please check the link used to access this page.",
79-
reload: "Reload",
80-
81-
delete_share: "Delete Share",
82-
edit_share: "Edit",
83-
84-
copy_url: "Copy URL",
85-
copied: "Copied!",
86-
download_all: "Download all",
87-
download_button: "Download",
88-
delete_file: "Delete",
89-
delete_this_item: "Delete this file?",
100+
// Haffix
101+
shares: "Shares",
102+
logout: "Logout",
90103
},
91104
},
92105
// Arabic
93106
fr: {
94107
translation: {
108+
// Generic
109+
copy_url: "Copier le lien",
110+
copied: "Copié!",
111+
download_button: "Télécharger",
112+
113+
// Share page
95114
drag_area: "Glissez des fichiers ou cliquez pour sélectionner",
115+
116+
sorry_share_expired: "Désolé, ce partage a expiré.",
117+
share_does_not_exists: "Ce partage n'existe pas.",
118+
please_check_link: "Merci de vérifier le lien qui vous a été transmis.",
119+
reload: "Recharger",
120+
121+
download_all: "Tout Télécharger",
122+
123+
// Shares page
96124
no_shares: "Il n'y a aucun partage.",
97125
create_share: "Créer un partage",
98126
your_shares: "Vos Partages",
99127
other_shares: "Autres Partages",
128+
create: "Créer",
100129

130+
// Share component
101131
guests_can_upload: "Les invités peuvent envoyer",
102132
guests_can_download: "Les invités peuvent télécharger",
103133
guests_can_upload_and_download: "Les invités peuvent envoyer & télécharger",
@@ -109,7 +139,15 @@ i18n
109139
unlimited: "Illimité",
110140
expired: "Expiré",
111141
created: "Créé le",
142+
delete_share: "Supprimer",
143+
edit_share: "Modifier",
144+
update: "Mettre à jour",
112145

146+
// Item Component
147+
delete_file: "Supprimer",
148+
delete_this_item: "Supprimer ce fichier ?",
149+
150+
// Share editor
113151
exposure: "Type de partage",
114152
you_want_to: "Vous souhaitez :",
115153
send: "Envoyer",
@@ -120,24 +158,13 @@ i18n
120158
number_of_days_the_share_is_valid: "Nombre de jours pendant lesquels le partage est valide. 0 signifie illimité.",
121159
description: "Description",
122160

123-
create: "Créer",
124-
161+
// Markdown Editor
125162
message: "Message",
126163
markdown_description: "Ce markdown sera affiché à l'utilisateur",
127164

128-
sorry_share_expired: "Désolé, ce partage a expiré.",
129-
share_does_not_exists: "Ce partage n'existe pas.",
130-
please_check_link: "Merci de vérifier le lien qui vous a été transmis.",
131-
reload: "Recharger",
132-
133-
delete_share: "Supprimer",
134-
edit_share: "Modifier",
135-
copy_url: "Copier le lien",
136-
copied: "Copié!",
137-
download_all: "Tout Télécharger",
138-
download_button: "Télécharger",
139-
delete_file: "Supprimer",
140-
delete_this_item: "Supprimer ce fichier ?",
165+
// Haffix
166+
shares: "Partages",
167+
logout: "Quitter",
141168
},
142169
},
143170
},

0 commit comments

Comments
 (0)