From a6c4c1d39c2d9039cabb1dd1751dcb0628057748 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 8 Apr 2025 18:40:01 -0400 Subject: [PATCH] Start i18n Integration --- CHANGELOG.md | 22 ++ README.md | 2 + index.html | 180 ++++++++-------- js/auth.js | 6 +- js/authModals.js | 33 ++- js/domUtils.js | 15 +- js/fileActions.js | 8 +- js/fileEditor.js | 11 +- js/fileListView.js | 8 +- js/fileMenu.js | 21 +- js/filePreview.js | 13 +- js/fileTags.js | 9 +- js/folderManager.js | 3 +- js/i18n.js | 449 +++++++++++++++++++++++++++++++++++++++ js/main.js | 14 +- js/trashRestoreDelete.js | 5 +- js/upload.js | 7 +- 17 files changed, 662 insertions(+), 144 deletions(-) create mode 100644 js/i18n.js diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4eea1..5c596cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## Changes 4/8/2025 + +**May have missed some stuff or could have bugs. Please report any issue you may encounter.** + +- **i18n Integration:** + - Implemented a complete internationalization (i18n) system for all user-facing texts in FileRise. + - Created an `i18n.js` module containing a translations object with full keys for English (en), Spanish (es), and French (fr). + - Updated JavaScript code to replace hard-coded strings with the `t()` translation function. + - Enhanced HTML and modal templates to support dynamic language translations using data attributes (data-i18n-key, data-i18n-placeholder, etc.). + +- **Language Dropdown & Persistence:** + - Added a language dropdown to the user panel modal allowing users to select their preferred language. + - Persisted the selected language in localStorage, ensuring that the preferred language is automatically applied on page refresh. + - Updated main.js to load and set the user’s language preference on DOMContentLoaded by calling `setLocale()` and `applyTranslations()`. + +- **Bug Fixes & Improvements:** + - Fixed issues with evaluation of translation function calls in template literals (ensured proper syntax with `${t("key")}`). + - Updated the t() function to be more defensive against missing keys. + - Provided instructions and code examples to ensure the language change settings are reliably saved and applied across sessions. + +--- + ## Changes 4/7/2025 v1.0.9 - TOTP one time recovery code added diff --git a/README.md b/README.md index 78eb73c..3129d59 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Upload, organize, and share files through a sleek web interface. **FileRise** is - 🎨 **Responsive UI (Dark/Light Mode):** FileRise is mobile-friendly out of the box – manage files from your phone or tablet with a responsive layout. Choose between Dark mode or Light theme, or let it follow your system preference. The interface remembers your preferences (layout, items per page, last visited folder, etc.) for a personalized experience each time. +- 🌐 **Internationalization & Localization:** FileRise supports multiple languages via an integrated i18n system. Users can switch languages through a user panel dropdown, and their choice is saved in local storage for a consistent experience across sessions. Currently available in English, Spanish, and French—please report any translation issues you encounter. + - 🗑️ **Trash & File Recovery:** Mistakenly deleted files? No worries – deleted items go to the Trash instead of immediate removal. Admins can restore files from Trash or empty it to free space. FileRise auto-purges old trash entries (default 3 days) to keep your storage tidy. - ⚙️ **Lightweight & Self-Contained:** FileRise runs on PHP 8.1+ with no external database required – data is stored in files (users, metadata) for simplicity. It’s a single-folder web app you can drop into any Apache/PHP server or run as a container. Docker & Unraid ready: use our pre-built image for a hassle-free setup. Memory and CPU footprint is minimal, yet the app scales to thousands of files with pagination and sorting features. diff --git a/index.html b/index.html index 4dfe64f..c82b48b 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - FileRise + FileRise