Skip to content

Commit 80febc9

Browse files
authored
fix(i18n): localize hardcoded frontend text in English and German (Stirling-Tools#6993)
1 parent c500c2f commit 80febc9

16 files changed

Lines changed: 245 additions & 55 deletions

File tree

frontend/editor/public/locales/de-DE/translation.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ text = "Diese Berechtigungen kontrollieren, was Benutzer mit der PDF machen kön
356356
title = "Berechtigungen ändern"
357357

358358
[addStamp]
359+
preview = "Stempelvorschau"
359360
tags = "stamp,mark,seal,approved,rejected,confidential,stamp tool,rubber stamp,date stamp,approval stamp,received,void,copy,original"
360361

361362
[AddStampRequest]
@@ -1842,6 +1843,15 @@ export = "Export"
18421843
accessDenied = "Zugriff verweigert"
18431844
insufficientPermissions = "Sie haben keine Berechtigung, diese Aktion auszuführen."
18441845

1846+
[auth.callback]
1847+
completing = "Authentifizierung wird abgeschlossen"
1848+
invalidToken = "OAuth-Anmeldung fehlgeschlagen – ungültiges Token."
1849+
missingToken = "OAuth-Anmeldung fehlgeschlagen – kein Token empfangen."
1850+
oauthFailed = "OAuth-Anmeldung fehlgeschlagen. Bitte versuchen Sie es erneut."
1851+
pleaseWait = "Bitte warten Sie, während wir Ihre Anmeldung abschließen."
1852+
signedOut = "Sie wurden abgemeldet. Bitte melden Sie sich erneut an."
1853+
windowMayClose = "Sie können dieses Fenster schließen, sobald der Vorgang abgeschlossen ist."
1854+
18451855
[auth.displayName]
18461856
guest = "Gast"
18471857
user = "Benutzer"
@@ -2824,6 +2834,7 @@ next = "Weiter"
28242834
preview = "Vorschau"
28252835
previous = "Zurück"
28262836
refresh = "Aktualisieren"
2837+
remaining = "Verbleibend"
28272838
retry = "Wiederholen"
28282839
save = "Save"
28292840

@@ -4072,10 +4083,17 @@ discord = "Discord"
40724083
issues = "GitHub"
40734084

40744085
[formFill]
4086+
allSaved = "Alles gespeichert"
4087+
extractCsvError = "CSV konnte nicht extrahiert werden"
4088+
extractXlsxError = "XLSX konnte nicht extrahiert werden"
40754089
flattenAfterFilling = "Nach dem Ausfüllen ebnen"
4090+
requiredAbbreviation = "erf."
4091+
requiredFieldsError = "Bitte füllen Sie alle Pflichtfelder aus"
40764092
rescanFields = "Felder erneut scannen"
40774093
rescanFormFields = "Formularfelder erneut scannen"
40784094
save = "Speichern"
4095+
saveShortcut = "Strg+S zum Speichern"
4096+
unsavedChanges = "Nicht gespeicherte Änderungen"
40794097

40804098
[formFill.sidebar]
40814099
close = "Seitenleiste schließen"
@@ -4996,7 +5014,21 @@ titleWithOs = "Herunterladen für {{osLabel}}"
49965014

49975015
[onboarding.mfa]
49985016
authenticationCode = "Authentifizierungscode"
5017+
description = "Schützen Sie Ihr Konto, indem Sie eine Authenticator-App verknüpfen. Scannen Sie den QR-Code oder geben Sie den Einrichtungsschlüssel ein und bestätigen Sie anschließend den sechsstelligen Code."
5018+
enable = "MFA aktivieren"
5019+
enableError = "Die Multi-Faktor-Authentifizierung konnte nicht aktiviert werden. Prüfen Sie den Code und versuchen Sie es erneut."
5020+
enterCode = "Geben Sie den sechsstelligen Code aus Ihrer App ein."
5021+
enterCodeError = "Geben Sie den Authentifizierungscode ein, um fortzufahren."
5022+
logout = "Abmelden"
5023+
openAuthenticator = "Öffnen Sie Google Authenticator, Authy oder 1Password."
49995024
qrCodeLoading = "Ihr QR-Code wird erstellt…"
5025+
regenerateQrCode = "QR-Code neu erstellen"
5026+
scanQrCode = "Scannen Sie den QR-Code oder geben Sie den unten stehenden Einrichtungsschlüssel ein."
5027+
setupError = "Die Einrichtung der Zwei-Faktor-Authentifizierung konnte nicht gestartet werden. Bitte versuchen Sie es erneut."
5028+
setupKey = "Einrichtungsschlüssel (manuelle Eingabe)"
5029+
stepByStep = "Schritt für Schritt"
5030+
success = "MFA wurde aktiviert. Sie können jetzt fortfahren."
5031+
title = "Einrichtung der Multi-Faktor-Authentifizierung"
50005032

50015033
[onboarding.planOverview]
50025034
adminBodyLoginDisabled = "Sobald Sie den Login-Modus aktivieren, können Sie Nutzer verwalten, Einstellungen konfigurieren und die Servergesundheit überwachen. Die ersten <strong>{{freeTierLimit}}</strong> Personen auf Ihrem Server nutzen Stirling kostenlos."
@@ -9110,6 +9142,11 @@ security = "Sicherheit"
91109142
telegram = "Telegram"
91119143
title = "Sicherheit & Authentifizierung"
91129144

9145+
[settings.signOut]
9146+
confirm = "Möchten Sie sich wirklich abmelden?"
9147+
submit = "Abmelden"
9148+
title = "Abmelden"
9149+
91139150
[settings.team]
91149151
title = "Team"
91159152

@@ -9726,6 +9763,9 @@ uploadButton = "Auf Server hochladen"
97269763
title = "Stirling-PDF Survey"
97279764

97289765
[swagger]
9766+
clickHere = "hier klicken"
9767+
fallback = "Falls die Seite nicht automatisch geöffnet wurde,"
9768+
opening = "Swagger UI wird in einem neuen Tab geöffnet..."
97299769
tags = "API,Dokumentation,Swagger,Endpunkte,Entwicklung"
97309770
title = "API-Dokumentation"
97319771

@@ -10281,9 +10321,11 @@ title = "Attachments"
1028110321

1028210322
[viewer.bookmarks]
1028310323
bookmarkTitle = "Lesezeichentitel"
10324+
bookmarkTitleRequired = "Ein Lesezeichentitel ist erforderlich"
1028410325
closeSidebar = "Seitenleiste für Lesezeichen schließen"
1028510326
collapseAll = "Alle Lesezeichen einklappen"
1028610327
expandAll = "Alle Lesezeichen ausklappen"
10328+
searchPlaceholder = "Lesezeichen durchsuchen"
1028710329

1028810330
[viewer.comments]
1028910331
addComment = "Kommentar hinzufügen"

frontend/editor/public/locales/en-US/translation.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ text = "These permissions control what users can do with the PDF. Most effective
356356
title = "Change Permissions"
357357

358358
[addStamp]
359+
preview = "Preview Stamp"
359360
tags = "stamp,mark,seal,approved,rejected,confidential,stamp tool,rubber stamp,date stamp,approval stamp,received,void,copy,original"
360361

361362
[AddStampRequest]
@@ -1842,6 +1843,15 @@ export = "Export"
18421843
accessDenied = "Access Denied"
18431844
insufficientPermissions = "You do not have permission to perform this action."
18441845

1846+
[auth.callback]
1847+
completing = "Completing authentication"
1848+
invalidToken = "OAuth login failed - invalid token."
1849+
missingToken = "OAuth login failed - no token received."
1850+
oauthFailed = "OAuth login failed. Please try again."
1851+
pleaseWait = "Please wait while we finish signing you in."
1852+
signedOut = "You have been signed out. Please sign in again."
1853+
windowMayClose = "You can close this window once it completes."
1854+
18451855
[auth.displayName]
18461856
guest = "Guest"
18471857
user = "User"
@@ -2824,6 +2834,7 @@ next = "Next"
28242834
preview = "Preview"
28252835
previous = "Previous"
28262836
refresh = "Refresh"
2837+
remaining = "Remaining"
28272838
retry = "Retry"
28282839
save = "Save"
28292840

@@ -4072,10 +4083,17 @@ discord = "Discord"
40724083
issues = "GitHub"
40734084

40744085
[formFill]
4086+
allSaved = "All saved"
4087+
extractCsvError = "Failed to extract CSV"
4088+
extractXlsxError = "Failed to extract XLSX"
40754089
flattenAfterFilling = "Flatten after filling"
4090+
requiredAbbreviation = "req"
4091+
requiredFieldsError = "Please fill in all required fields"
40764092
rescanFields = "Re-scan fields"
40774093
rescanFormFields = "Re-scan form fields"
40784094
save = "Save"
4095+
saveShortcut = "Ctrl+S to save"
4096+
unsavedChanges = "Unsaved changes"
40794097

40804098
[formFill.sidebar]
40814099
close = "Close sidebar"
@@ -5016,7 +5034,21 @@ titleWithOs = "Download for {{osLabel}}"
50165034

50175035
[onboarding.mfa]
50185036
authenticationCode = "Authentication code"
5037+
description = "Secure your account by linking an authenticator app. Scan the QR code or enter the setup key, then confirm the 6-digit code to finish."
5038+
enable = "Enable MFA"
5039+
enableError = "Unable to enable two-factor authentication. Check the code and try again."
5040+
enterCode = "Enter the 6-digit code from your app."
5041+
enterCodeError = "Enter the authentication code to continue."
5042+
logout = "Logout"
5043+
openAuthenticator = "Open Google Authenticator, Authy, or 1Password."
50195044
qrCodeLoading = "Generating your QR code…"
5045+
regenerateQrCode = "Regenerate QR code"
5046+
scanQrCode = "Scan the QR code or enter the setup key below."
5047+
setupError = "Unable to start two-factor setup. Please try again."
5048+
setupKey = "Setup key (manual entry)"
5049+
stepByStep = "Step-by-step"
5050+
success = "MFA has been enabled. You can now continue."
5051+
title = "Multi-Factor Authentication Setup"
50205052

50215053
[onboarding.planOverview]
50225054
adminBodyLoginDisabled = "Once you enable login mode, you can manage users, configure settings, and monitor server health. The first <strong>{{freeTierLimit}}</strong> people on your server get to use Stirling free of charge."
@@ -9178,6 +9210,11 @@ security = "Security"
91789210
telegram = "Telegram"
91799211
title = "Security & Authentication"
91809212

9213+
[settings.signOut]
9214+
confirm = "Are you sure you want to sign out?"
9215+
submit = "Sign out"
9216+
title = "Sign out"
9217+
91819218
[settings.team]
91829219
title = "Team"
91839220

@@ -9794,6 +9831,9 @@ uploadButton = "Upload to Server"
97949831
title = "Stirling-PDF Survey"
97959832

97969833
[swagger]
9834+
clickHere = "click here"
9835+
fallback = "If it didn't open automatically,"
9836+
opening = "Opening Swagger UI in a new tab..."
97979837
tags = "api,documentation,swagger,endpoints,development"
97989838
title = "API Documentation"
97999839

@@ -10362,9 +10402,11 @@ title = "Attachments"
1036210402

1036310403
[viewer.bookmarks]
1036410404
bookmarkTitle = "Bookmark title"
10405+
bookmarkTitleRequired = "Bookmark title is required"
1036510406
closeSidebar = "Close bookmarks sidebar"
1036610407
collapseAll = "Collapse all bookmarks"
1036710408
expandAll = "Expand all bookmarks"
10409+
searchPlaceholder = "Search bookmarks"
1036810410

1036910411
[viewer.comments]
1037010412
addComment = "Add comment"

frontend/editor/src/core/components/onboarding/slides/MFASetupSlide.tsx

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import LocalIcon from "@app/components/shared/LocalIcon";
2626
import { BASE_PATH, withBasePath } from "@app/constants/app";
2727
import styles from "@app/components/onboarding/InitialOnboardingModal/InitialOnboardingModal.module.css";
2828
import { MfaSetupResponse } from "@app/responses/Mfa/MfaResponse";
29+
import i18n from "@app/i18n";
2930

3031
interface MFASetupSlideProps {
3132
onMfaSetupComplete?: () => void;
@@ -62,12 +63,15 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
6263
const axiosError = err as { response?: { data?: { error?: string } } };
6364
setMfaError(
6465
axiosError.response?.data?.error ||
65-
"Unable to start two-factor setup. Please try again.",
66+
t(
67+
"onboarding.mfa.setupError",
68+
"Unable to start two-factor setup. Please try again.",
69+
),
6670
);
6771
} finally {
6872
setMfaLoading(false);
6973
}
70-
}, []);
74+
}, [t]);
7175

7276
useEffect(() => {
7377
setupCompleteRef.current = setupComplete;
@@ -96,7 +100,12 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
96100
event.preventDefault();
97101

98102
if (!mfaSetupCode.trim()) {
99-
setMfaError("Enter the authentication code to continue.");
103+
setMfaError(
104+
t(
105+
"onboarding.mfa.enterCodeError",
106+
"Enter the authentication code to continue.",
107+
),
108+
);
100109
return;
101110
}
102111

@@ -110,13 +119,16 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
110119
const axiosError = err as { response?: { data?: { error?: string } } };
111120
setMfaError(
112121
axiosError.response?.data?.error ||
113-
"Unable to enable two-factor authentication. Check the code and try again.",
122+
t(
123+
"onboarding.mfa.enableError",
124+
"Unable to enable two-factor authentication. Check the code and try again.",
125+
),
114126
);
115127
} finally {
116128
setSubmitting(false);
117129
}
118130
},
119-
[mfaSetupCode, onMfaSetupComplete],
131+
[mfaSetupCode, onMfaSetupComplete, t],
120132
);
121133

122134
const isReady = Boolean(mfaSetupData);
@@ -138,15 +150,30 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
138150

139151
<Stack gap="xs">
140152
<Text size="sm" fw={600}>
141-
Step-by-step
153+
{t("onboarding.mfa.stepByStep", "Step-by-step")}
142154
</Text>
143155
<ol className={styles.mfaSteps}>
144-
<li>Open Google Authenticator, Authy, or 1Password.</li>
145-
<li>Scan the QR code or enter the setup key below.</li>
146-
<li>Enter the 6-digit code from your app.</li>
156+
<li>
157+
{t(
158+
"onboarding.mfa.openAuthenticator",
159+
"Open Google Authenticator, Authy, or 1Password.",
160+
)}
161+
</li>
162+
<li>
163+
{t(
164+
"onboarding.mfa.scanQrCode",
165+
"Scan the QR code or enter the setup key below.",
166+
)}
167+
</li>
168+
<li>
169+
{t(
170+
"onboarding.mfa.enterCode",
171+
"Enter the 6-digit code from your app.",
172+
)}
173+
</li>
147174
</ol>
148175
<Text size="xs" c="dimmed">
149-
Setup key (manual entry)
176+
{t("onboarding.mfa.setupKey", "Setup key (manual entry)")}
150177
</Text>
151178
<TextInput
152179
value={mfaSetupData.secret ?? ""}
@@ -163,9 +190,10 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
163190
<div className={styles.mfaCard}>
164191
<Stack gap="md">
165192
<Text size="sm" c="dimmed">
166-
Secure your account by linking an authenticator app. Scan the QR
167-
code or enter the setup key, then confirm the 6-digit code to
168-
finish.
193+
{t(
194+
"onboarding.mfa.description",
195+
"Secure your account by linking an authenticator app. Scan the QR code or enter the setup key, then confirm the 6-digit code to finish.",
196+
)}
169197
</Text>
170198

171199
{mfaError && (
@@ -215,7 +243,7 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
215243
onClick={fetchMfaSetup}
216244
disabled={mfaLoading || submitting || setupComplete}
217245
>
218-
Regenerate QR code
246+
{t("onboarding.mfa.regenerateQrCode", "Regenerate QR code")}
219247
</Button>
220248
<Button
221249
type="submit"
@@ -224,16 +252,19 @@ function MFASetupContent({ onMfaSetupComplete }: MFASetupSlideProps) {
224252
!isReady || setupComplete || mfaSetupCode.length < 6
225253
}
226254
>
227-
Enable MFA
255+
{t("onboarding.mfa.enable", "Enable MFA")}
228256
</Button>
229257
<Button variant="secondary" type="button" onClick={onLogout}>
230-
Logout
258+
{t("onboarding.mfa.logout", "Logout")}
231259
</Button>
232260
</Group>
233261

234262
{setupComplete && (
235263
<Alert color="green" variant="light">
236-
MFA has been enabled. You can now continue.
264+
{t(
265+
"onboarding.mfa.success",
266+
"MFA has been enabled. You can now continue.",
267+
)}
237268
</Alert>
238269
)}
239270
</Stack>
@@ -249,7 +280,7 @@ export default function MFASetupSlide({
249280
}: MFASetupSlideProps = {}): SlideConfig {
250281
return {
251282
key: "mfa-setup-slide",
252-
title: "Multi-Factor Authentication Setup",
283+
title: i18n.t("onboarding.mfa.title", "Multi-Factor Authentication Setup"),
253284
body: <MFASetupContent onMfaSetupComplete={onMfaSetupComplete} />,
254285
background: {
255286
gradientStops: ["#059669", "#0891B2"], // Green to teal - security/trust colors

frontend/editor/src/core/components/tools/addStamp/StampPreview.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import styles from "@app/components/tools/addStamp/StampPreview.module.css";
1313
import { PrivateContent } from "@app/components/shared/PrivateContent";
1414
import { Button } from "@app/ui/Button";
15+
import { useTranslation } from "react-i18next";
1516

1617
type Props = {
1718
parameters: AddStampParameters;
@@ -29,6 +30,7 @@ export default function StampPreview({
2930
file,
3031
showQuickGrid,
3132
}: Props) {
33+
const { t } = useTranslation();
3234
const containerRef = useRef<HTMLDivElement>(null);
3335
const [containerSize, setContainerSize] = useState<{
3436
width: number;
@@ -366,7 +368,9 @@ export default function StampPreview({
366368
<div>
367369
<div className={styles.previewHeader}>
368370
<div className={styles.divider} />
369-
<div className={styles.previewLabel}>Preview Stamp</div>
371+
<div className={styles.previewLabel}>
372+
{t("addStamp.preview", "Preview Stamp")}
373+
</div>
370374
</div>
371375
<div
372376
ref={containerRef}

0 commit comments

Comments
 (0)