Extend i18n support: Add new translation keys for Download and Share modals

This commit is contained in:
Ryan
2025-04-13 18:38:21 -04:00
committed by GitHub
parent 97559873dc
commit a9c4200827
6 changed files with 54 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
# Changelog
## Changes 4/13/2025
## Changes 4/13/2025 v1.1.3
- Decreased header height some more and clickable logo.
- authModals.js fully updated with i18n.js keys.
@@ -8,6 +8,7 @@
- New Admin section Header Settings to change Header Title.
- Admin Panel confirm unsaved changes.
- Added translations and data attributes for almost all user-facing text
- Extend i18n support: Add new translation keys for Download and Share modals
---

View File

@@ -391,29 +391,31 @@
</div> <!-- end mainColumn -->
</div> <!-- end main-wrapper -->
<!-- Download Progress Modal -->
<div id="downloadProgressModal" class="modal" style="display: none;">
<div class="modal-content" style="text-align: center; padding: 20px;">
<!-- Material icon spinner with a dedicated class -->
<span class="material-icons download-spinner">autorenew</span>
<p>Preparing your download...</p>
</div>
<!-- Download Progress Modal -->
<div id="downloadProgressModal" class="modal" style="display: none;">
<div class="modal-content" style="text-align: center; padding: 20px;">
<!-- Material icon spinner with a dedicated class -->
<span class="material-icons download-spinner">autorenew</span>
<p data-i18n-key="preparing_download">Preparing your download...</p>
</div>
</div>
<!-- Single File Download Modal -->
<div id="downloadFileModal" class="modal" style="display: none;">
<div class="modal-content" style="text-align: center; padding: 20px;">
<h4>Download File</h4>
<p>Confirm or change the download file name:</p>
<input type="text" id="downloadFileNameInput" class="form-control" placeholder="Filename" />
<div style="margin-top: 15px; text-align: right;">
<button id="cancelDownloadFile" class="btn btn-secondary"
onclick="document.getElementById('downloadFileModal').style.display = 'none';">Cancel</button>
<button id="confirmSingleDownloadButton" class="btn btn-primary"
onclick="confirmSingleDownload()">Download</button>
</div>
<!-- Single File Download Modal -->
<div id="downloadFileModal" class="modal" style="display: none;">
<div class="modal-content" style="text-align: center; padding: 20px;">
<h4 data-i18n-key="download_file">Download File</h4>
<p data-i18n-key="confirm_or_change_filename">Confirm or change the download file name:</p>
<input type="text" id="downloadFileNameInput" class="form-control" data-i18n-placeholder="filename" placeholder="Filename" />
<div style="margin-top: 15px; text-align: right;">
<button id="cancelDownloadFile" class="btn btn-secondary"
onclick="document.getElementById('downloadFileModal').style.display = 'none';"
data-i18n-key="cancel">Cancel</button>
<button id="confirmSingleDownloadButton" class="btn btn-primary"
onclick="confirmSingleDownload()"
data-i18n-key="download">Download</button>
</div>
</div>
</div>
<!-- Change Password, Add User, Remove User, Rename File, and Custom Confirm Modals (unchanged) -->
<div id="changePasswordModal" class="modal" style="display:none;">

View File

@@ -2,7 +2,7 @@ import { showToast, toggleVisibility, attachEnterKeyListener } from './domUtils.
import { sendRequest } from './networkUtils.js';
import { t, applyTranslations, setLocale } from './i18n.js';
const version = "v1.1.2";
const version = "v1.1.3";
// Use t() for the admin panel title. (Make sure t("admin_panel") returns "Admin Panel" in English.)
const adminTitle = `${t("admin_panel")} <small style="font-size: 12px; color: gray;">${version}</small>`;

View File

@@ -26,7 +26,7 @@ export function openShareModal(file, folder) {
<option value="240">240 minutes</option>
<option value="1440">1 Day</option>
</select>
<p>Password (optional):</p>
<p>${t("password_optional")}</p>
<input type="text" id="sharePassword" placeholder=${t("password_optional")} style="width: 100%;"/>
<br>
<button id="generateShareLinkBtn" class="btn btn-primary" style="margin-top:10px;">${t("generate_share_link")}</button>

View File

@@ -28,7 +28,7 @@ export function openFolderShareModal(folder) {
<option value="1440">1 ${t("day")}</option>
</select>
<p>${t("password_optional")}</p>
<input type="text" id="folderSharePassword" placeholder="${t("password")}" style="width: 100%;"/>
<input type="text" id="folderSharePassword" placeholder="${t("enter_password")}" style="width: 100%;"/>
<br>
<label>
<input type="checkbox" id="folderShareAllowUpload"> ${t("allow_uploads")}

View File

@@ -126,6 +126,13 @@ const translations = {
"create_new_user_title": "Create New User",
"username": "Username:",
"password": "Password:",
"enter_password": "Password",
"preparing_download": "Preparing your download...",
"download_file": "Download File",
"confirm_or_change_filename": "Confirm or change the download file name:",
"filename": "Filename",
"cancel": "Cancel",
"download": "Download",
"grant_admin": "Grant Admin Access",
"save_user": "Save User",
@@ -349,6 +356,13 @@ const translations = {
"create_new_user_title": "Crear nuevo usuario",
"username": "Usuario:",
"password": "Contraseña:",
"enter_password": "Contraseña",
"preparing_download": "Preparando su descarga...",
"download_file": "Descargar Archivo",
"confirm_or_change_filename": "Confirme o cambie el nombre del archivo a descargar:",
"filename": "Nombre de archivo",
"cancel": "Cancelar",
"download": "Descargar",
"grant_admin": "Otorgar acceso de administrador",
"save_user": "Guardar usuario",
@@ -569,6 +583,13 @@ const translations = {
"create_new_user_title": "Créer un nouvel utilisateur",
"username": "Nom d'utilisateur :",
"password": "Mot de passe :",
"enter_password": "Mot de passe",
"preparing_download": "Préparation de votre téléchargement...",
"download_file": "Télécharger le fichier",
"confirm_or_change_filename": "Confirmez ou modifiez le nom du fichier à télécharger :",
"filename": "Nom du fichier",
"cancel": "Annuler",
"download": "Télécharger",
"grant_admin": "Accorder l'accès administrateur",
"save_user": "Enregistrer l'utilisateur",
@@ -797,6 +818,13 @@ const translations = {
"create_new_user_title": "Neuen Benutzer erstellen",
"username": "Benutzername:",
"password": "Passwort:",
"enter_password": "Passwort",
"preparing_download": "Bereite Ihren Download vor...",
"download_file": "Datei herunterladen",
"confirm_or_change_filename": "Bestätigen oder ändern Sie den Dateinamen zum Download:",
"filename": "Dateiname",
"cancel": "Abbrechen",
"download": "Herunterladen",
"grant_admin": "Admin-Rechte vergeben",
"save_user": "Benutzer speichern",