feat(i18n): add i18n on server side

- remove the hardcoded list of locales in favor of a discovry on start time
    - server will stop on badly formatted locale .json
    - add server.* entries for serer side translation

    server side translation will be used for templating and email
    note: no json in some embded html (like in /magic), amount of work was similar
This commit is contained in:
Edouard Vanbelle
2026-06-03 13:18:05 +02:00
parent e0f59aa942
commit 044bd76738
32 changed files with 1520 additions and 149 deletions
+33
View File
@@ -1,4 +1,37 @@
{
"server": {
"magic_link": {
"page": {
"expired_title": "This sign-in link is no longer valid",
"expired_body": "The link may have expired or already been used. We can send you a fresh one — it'll arrive in your inbox in a few seconds.",
"resend_to": "Send a fresh link to {{email}}",
"generic_unavailable": "This sign-in link is no longer valid. It may have already been used or expired. Request a fresh link from the login page.",
"service_unavailable": "Magic-link sign-in is not enabled on this server.",
"internal_error": "Something went wrong while signing you in. Please try again.",
"resend_failure": "Something went wrong while sending the link. Please try again.",
"cross_browser_title": "Continue signing in on this device?",
"cross_browser_body": "You opened this sign-in link in a different browser or device than the one where you requested it.",
"cross_browser_warning": "If you requested this link, it's safe to continue. If you didn't, close this page — clicking Continue would sign someone else into your account.",
"cross_browser_continue": "Continue and sign in",
"resend_confirmation_title": "Check your inbox",
"resend_confirmation_body": "If the sign-in link belonged to an active account, a fresh link has just been sent. Please check your inbox.",
"return_link": "Return to OxiCloud"
},
"email": {
"invitation": {
"subject": "{{inviter}} shared a {{kind}} with you on OxiCloud",
"body": "{{inviter}} shared a {{kind}} with you on OxiCloud.\n\nOpen it by clicking the link below:\n{{link}}\n\nThe link works once and expires in {{ttl_hours}} hours.\nIf you didn't expect this invitation, you can safely ignore this message.\n\n— OxiCloud"
},
"login": {
"subject": "Sign in to OxiCloud",
"body": "Hello,\n\nUse the link below to sign in to OxiCloud. The link works once and expires in {{ttl_minutes}} minutes. Open it on the same device where you requested it.\n\n{{link}}\n\nIf you didn't request this sign-in link, you can safely ignore this message — no further action is needed.\n\n— OxiCloud"
},
"kind_file": "file",
"kind_folder": "folder",
"english_fallback_divider": "--- English version below ---"
}
}
},
"app": {
"title": "OxiCloud",
"description": "Minimalist cloud storage system"