Skip to content

Commit 7d2cb98

Browse files
authored
docs: update README language list + refresh CONTRIBUTING i18n guide for locale loaders
1 parent 76819f8 commit 7d2cb98

2 files changed

Lines changed: 83 additions & 152 deletions

File tree

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 82 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Thank you for your interest in contributing to FileRise! We appreciate your help
2525
cd FileRise
2626
```
2727

28-
3. **Set Up a Local Environment**
29-
FileRise runs on a standard LAMP stack. Ensure you have PHP, Apache, and the necessary dependencies installed.
28+
3. **Set Up a Local Environment**
29+
FileRise runs on a standard LAMP stack. Ensure you have PHP, Apache, and the necessary dependencies installed.
3030

31-
4. **Configuration**
32-
Copy any example configuration files (if provided) and adjust them as needed for your local setup.
31+
4. **Configuration**
32+
Copy any example configuration files (if provided) and adjust them as needed for your local setup.
3333

3434
## Reporting Bugs
3535

@@ -90,153 +90,84 @@ If you have any questions, ideas, or need support, please open an issue or join
9090

9191
## Adding New Language Translations
9292

93-
FileRise supports internationalization (i18n) and localization via a central translation file (`i18n.js`). If you would like to contribute a new language translation, please follow these steps:
94-
95-
1. **Update `i18n.js`:**
96-
Open the `i18n.js` file located in the `js` directory. Within the `translations` object, add a new property using the appropriate [ISO language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) as the key. Copy the structure from an existing language block and translate each key.
97-
98-
**Example (for German):**
99-
100-
```js
101-
de: {
102-
"please_log_in_to_continue": "Bitte melden Sie sich an, um fortzufahren.",
103-
"no_files_selected": "Keine Dateien ausgewΓ€hlt.",
104-
"confirm_delete_files": "Sind Sie sicher, dass Sie {count} ausgewΓ€hlte Datei(en) lΓΆschen mΓΆchten?",
105-
"element_not_found": "Element mit der ID \"{id}\" wurde nicht gefunden.",
106-
"search_placeholder": "Suche nach Dateien oder Tags...",
107-
"file_name": "Dateiname",
108-
"date_modified": "Γ„nderungsdatum",
109-
"upload_date": "Hochladedatum",
110-
"file_size": "Dateigrâße",
111-
"uploader": "Hochgeladen von",
112-
"enter_totp_code": "Geben Sie den TOTP-Code ein",
113-
"use_recovery_code_instead": "Verwenden Sie stattdessen den Wiederherstellungscode",
114-
"enter_recovery_code": "Geben Sie den Wiederherstellungscode ein",
115-
"editing": "Bearbeitung",
116-
"decrease_font": "A-",
117-
"increase_font": "A+",
118-
"save": "Speichern",
119-
"close": "Schließen",
120-
"no_files_found": "Keine Dateien gefunden.",
121-
"switch_to_table_view": "Zur Tabellenansicht wechseln",
122-
"switch_to_gallery_view": "Zur Galerieansicht wechseln",
123-
"share_file": "Datei teilen",
124-
"set_expiration": "Ablauf festlegen:",
125-
"password_optional": "Passwort (optional):",
126-
"generate_share_link": "Freigabelink generieren",
127-
"shareable_link": "Freigabelink:",
128-
"copy_link": "Link kopieren",
129-
"tag_file": "Datei taggen",
130-
"tag_name": "Tagname:",
131-
"tag_color": "Tagfarbe:",
132-
"save_tag": "Tag speichern",
133-
"files_in": "Dateien in",
134-
"light_mode": "Heller Modus",
135-
"dark_mode": "Dunkler Modus",
136-
"upload_instruction": "Ziehen Sie Dateien/Ordner hierher oder klicken Sie auf 'Dateien auswΓ€hlen'",
137-
"no_files_selected_default": "Keine Dateien ausgewΓ€hlt",
138-
"choose_files": "Dateien auswΓ€hlen",
139-
"delete_selected": "AusgewΓ€hlte lΓΆschen",
140-
"copy_selected": "AusgewΓ€hlte kopieren",
141-
"move_selected": "AusgewΓ€hlte verschieben",
142-
"tag_selected": "AusgewΓ€hlte taggen",
143-
"download_zip": "Zip herunterladen",
144-
"extract_zip": "Zip entpacken",
145-
"preview": "Vorschau",
146-
"edit": "Bearbeiten",
147-
"rename": "Umbenennen",
148-
"trash_empty": "Papierkorb ist leer.",
149-
"no_trash_selected": "Keine Elemente im Papierkorb fΓΌr die Wiederherstellung ausgewΓ€hlt.",
150-
151-
// Additional keys for HTML translations:
152-
"title": "FileRise",
153-
"header_title": "FileRise",
154-
"logout": "Abmelden",
155-
"change_password": "Passwort Γ€ndern",
156-
"restore_text": "Wiederherstellen oder",
157-
"delete_text": "PapierkorbeintrΓ€ge lΓΆschen",
158-
"restore_selected": "AusgewΓ€hlte wiederherstellen",
159-
"restore_all": "Alle wiederherstellen",
160-
"delete_selected_trash": "AusgewΓ€hlte lΓΆschen",
161-
"delete_all": "Alle lΓΆschen",
162-
"upload_header": "Dateien/Ordner hochladen",
163-
164-
// Folder Management keys:
165-
"folder_navigation": "Ordnernavigation & Verwaltung",
166-
"create_folder": "Ordner erstellen",
167-
"create_folder_title": "Ordner erstellen",
168-
"enter_folder_name": "Geben Sie den Ordnernamen ein",
169-
"cancel": "Abbrechen",
170-
"create": "Erstellen",
171-
"rename_folder": "Ordner umbenennen",
172-
"rename_folder_title": "Ordner umbenennen",
173-
"rename_folder_placeholder": "Neuen Ordnernamen eingeben",
174-
"delete_folder": "Ordner lΓΆschen",
175-
"delete_folder_title": "Ordner lΓΆschen",
176-
"delete_folder_message": "Sind Sie sicher, dass Sie diesen Ordner lΓΆschen mΓΆchten?",
177-
"folder_help": "Ordnerhilfe",
178-
"folder_help_item_1": "Klicken Sie auf einen Ordner, um dessen Dateien anzuzeigen.",
179-
"folder_help_item_2": "Verwenden Sie [-] um zu minimieren und [+] um zu erweitern.",
180-
"folder_help_item_3": "Klicken Sie auf \"Ordner erstellen\", um einen Unterordner hinzuzufΓΌgen.",
181-
"folder_help_item_4": "Um einen Ordner umzubenennen oder zu lΓΆschen, wΓ€hlen Sie ihn und klicken Sie auf die entsprechende SchaltflΓ€che.",
182-
183-
// File List keys:
184-
"file_list_title": "Dateien in (Root)",
185-
"delete_files": "Dateien lΓΆschen",
186-
"delete_selected_files_title": "AusgewΓ€hlte Dateien lΓΆschen",
187-
"delete_files_message": "Sind Sie sicher, dass Sie die ausgewΓ€hlten Dateien lΓΆschen mΓΆchten?",
188-
"copy_files": "Dateien kopieren",
189-
"copy_files_title": "AusgewΓ€hlte Dateien kopieren",
190-
"copy_files_message": "WΓ€hlen Sie einen Zielordner, um die ausgewΓ€hlten Dateien zu kopieren:",
191-
"move_files": "Dateien verschieben",
192-
"move_files_title": "AusgewΓ€hlte Dateien verschieben",
193-
"move_files_message": "WΓ€hlen Sie einen Zielordner, um die ausgewΓ€hlten Dateien zu verschieben:",
194-
"move": "Verschieben",
195-
"extract_zip_button": "Zip entpacken",
196-
"download_zip_title": "AusgewΓ€hlte Dateien als Zip herunterladen",
197-
"download_zip_prompt": "Geben Sie einen Namen fΓΌr die Zip-Datei ein:",
198-
"zip_placeholder": "dateien.zip",
199-
200-
// Login Form keys:
201-
"login": "Anmelden",
202-
"remember_me": "Angemeldet bleiben",
203-
"login_oidc": "Mit OIDC anmelden",
204-
"basic_http_login": "HTTP-Basisauthentifizierung verwenden",
205-
206-
// Change Password keys:
207-
"change_password_title": "Passwort Γ€ndern",
208-
"old_password": "Altes Passwort",
209-
"new_password": "Neues Passwort",
210-
"confirm_new_password": "Neues Passwort bestΓ€tigen",
211-
212-
// Add User keys:
213-
"create_new_user_title": "Neuen Benutzer erstellen",
214-
"username": "Benutzername:",
215-
"password": "Passwort:",
216-
"grant_admin": "Admin-Rechte vergeben",
217-
"save_user": "Benutzer speichern",
218-
219-
// Remove User keys:
220-
"remove_user_title": "Benutzer entfernen",
221-
"select_user_remove": "WΓ€hlen Sie einen Benutzer zum Entfernen:",
222-
"delete_user": "Benutzer lΓΆschen",
223-
224-
// Rename File keys:
225-
"rename_file_title": "Datei umbenennen",
226-
"rename_file_placeholder": "Neuen Dateinamen eingeben",
227-
228-
// Custom Confirm Modal keys:
229-
"yes": "Ja",
230-
"no": "Nein",
231-
"delete": "LΓΆschen",
232-
"download": "Herunterladen",
233-
"upload": "Hochladen",
234-
"copy": "Kopieren",
235-
"extract": "Entpacken",
236-
237-
// Dark Mode Toggle
238-
"dark_mode_toggle": "Dunkler Modus"
239-
}
93+
FileRise supports internationalization (i18n). English (`en`) lives in `public/js/i18n.js`, and additional languages are loaded from separate locale files under:
94+
95+
- `FileRise/public/js/i18n/locales/`
96+
97+
When a translation key is missing in a locale, FileRise automatically falls back to English.
98+
99+
### Supported languages (current)
100+
101+
See `localeLoaders` in:
102+
103+
- `FileRise/public/js/i18n.js`
104+
105+
(Example codes include: `de`, `es`, `fr`, `pl`, `ru`, `ja`, `zh-CN`.)
106+
107+
### How language selection works
108+
109+
- Users can choose a language in the UI (stored in `localStorage`).
110+
- Admins can optionally set a **Default language** used when a user has not chosen one yet.
111+
- Client Portals include a language selector and use the same translation system.
112+
113+
### Add a new language (step-by-step)
114+
115+
1) **Pick a language code**
116+
Use ISO 639-1 codes when possible (e.g., `it`, `pt`, `nl`).
117+
For region-specific variants, use a BCP-47 tag (e.g., `pt-BR`, `zh-CN`).
118+
119+
2) **Create the locale file**
120+
Add a new file:
121+
122+
- `FileRise/public/js/i18n/locales/<code>.js`
123+
124+
It must export a default object of `key: "translation"` pairs.
125+
126+
Example (`it.js`):
127+
```js
128+
export default {
129+
"please_log_in_to_continue": "Accedi per continuare.",
130+
"no_files_selected": "Nessun file selezionato.",
131+
"download_zip": "Scarica archivio",
132+
};
133+
```
134+
135+
3) **Register the locale loader**
136+
In `FileRise/public/js/i18n.js`, add your language to `localeLoaders`:
137+
138+
```js
139+
const localeLoaders = {
140+
// ...
141+
it: () => import(new URL('./i18n/locales/it.js?v={{APP_QVER}}', import.meta.url)),
142+
};
143+
```
144+
145+
4) **Keep placeholders intact**
146+
Some strings contain placeholders like:
147+
- `{count}`, `{id}`, `{name}`, `{folder}`, `{error}`
148+
149+
Do **not** remove or rename placeholders. Translate only the surrounding text.
150+
151+
5) **Avoid HTML in translations**
152+
Translations should be plain text. Do not embed raw HTML tags in locale values.
153+
154+
6) **Test the language**
155+
- Switch the language in the main UI.
156+
- Also test Portals:
157+
- `/portal/<slug>`
158+
- `/portal-login.html?...`
159+
- Click through a few key flows to confirm strings render correctly:
160+
- Login + TOTP prompts
161+
- Uploads (including error/success toasts)
162+
- File actions (copy/move/delete/download/archive)
163+
- Share modals
164+
- Admin panel (partial coverage is OK; missing keys fall back to English)
165+
166+
### Improving existing translations / missing keys
167+
168+
If you notice untranslated text:
169+
- Prefer adding a new i18n key to English in `public/js/i18n.js` and then translating it in the locale files.
170+
- If you’re not sure where a string is used, search the codebase for the key or the English phrase.
240171
241172
---
242173

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Drag & drop uploads, OnlyOffice integration, and **optional folder-level encrypt
3333
- πŸ“š **API + live docs** – OpenAPI spec (`openapi.json`) plus an embedded Redoc viewer (`api.html`) for exploring endpoints.
3434
- πŸ“Š **Storage / disk usage summary** – CLI scanner with snapshots, total usage, and per-volume breakdowns surfaced in the admin panel.
3535
- 🎨 **Polished, responsive UI** – Dark/light mode, mobile-friendly layout, in-browser previews, and a built-in code editor powered by CodeMirror.
36-
- 🌐 **Internationalization** – English, Spanish, French, German, and Simplified Chinese included; community translations welcome.
36+
- 🌐 **Internationalization** – English, Spanish, French, German, Polish, Russian, Japanese and Simplified Chinese included; community translations welcome.
3737
- πŸ”‘ **Login + SSO** – Local users, TOTP 2FA, and OIDC (Auth0 / Authentik / Keycloak / etc.) with optional auto-provisioning, IdP-driven admin role assignment, and Pro user-group mapping.
3838
- πŸ›‘οΈ **ClamAV virus scanning (Core) + Pro virus log** – Optional ClamAV upload scanning, with a Pro virus detection log in the admin panel and CSV export.
3939
- 🌐 **Reverse proxy & subpath aware** – Designed to run cleanly behind Nginx, Traefik, Caddy, or Apache:

0 commit comments

Comments
Β (0)