/* i18n.js */
const translations = {
  en: {
    "please_log_in_to_continue": "Please log in to continue.",
    "no_files_selected": "No files selected.",
    "confirm_delete_files": "Are you sure you want to delete {count} selected file(s)?",
    "element_not_found": "Element with id \"{id}\" not found.",
    "search_placeholder": "Search files, tags, & uploader...",
    "search_placeholder_advanced": "Advanced Search: files, tags, uploader & content...",
    "basic_search_tooltip": "Basic Search: Search by file name, tags, and uploader.",
    "advanced_search_tooltip": "Advanced Search: Includes file content, in addition to file name, tags, and uploader.",
    "file_name": "File Name",
    "date_modified": "Date Modified",
    "upload_date": "Upload Date",
    "file_size": "File Size",
    "uploader": "Uploader",
    "enter_totp_code": "Enter TOTP Code",
    "use_recovery_code_instead": "Use Recovery Code instead",
    "enter_recovery_code": "Enter Recovery Code",
    "editing": "Editing",
    "decrease_font": "A-",
    "increase_font": "A+",
    "save": "Save",
    "close": "Close",
    "no_files_found": "No files found.",
    "switch_to_table_view": "Switch to Table View",
    "switch_to_gallery_view": "Switch to Gallery View",
    "share_file": "Share File",
    "set_expiration": "Set Expiration:",
    "password_optional": "Password (optional):",
    "generate_share_link": "Generate Share Link",
    "shareable_link": "Shareable Link:",
    "copy_link": "Copy Link",
    "tag_file": "Tag File",
    "tag_name": "Tag Name:",
    "tag_color": "Tag Color:",
    "save_tag": "Save Tag",
    "light_mode": "Light Mode",
    "dark_mode": "Dark Mode",
    "upload_instruction": "Drop files/folders here or click 'Choose files'",
    "no_files_selected_default": "No files selected",
    "choose_files": "Choose files",
    "delete_selected": "Delete Selected",
    "copy_selected": "Copy Selected",
    "move_selected": "Move Selected",
    "tag_selected": "Tag Selected",
    "download_zip": "Download Zip",
    "extract_zip": "Extract Zip",
    "preview": "Preview",
    "edit": "Edit",
    "rename": "Rename",
    "trash_empty": "Trash is empty.",
    "no_trash_selected": "No trash items selected for restore.",

    // Additional keys for HTML translations:
    "title": "FileRise",
    "header_title": "FileRise",
    "header_title_text": "Header Title",
    "logout": "Logout",
    "change_password": "Change Password",
    "restore_text": "Restore or",
    "delete_text": "Delete Trash Items",
    "restore_selected": "Restore Selected",
    "restore_all": "Restore All",
    "delete_selected_trash": "Delete Selected",
    "delete_all": "Delete All",
    "upload_header": "Upload Files/Folders",

    // Folder Management keys:
    "folder_navigation": "Folder Navigation & Management",
    "create_folder": "Create Folder",
    "create_folder_title": "Create Folder",
    "enter_folder_name": "Enter folder name",
    "cancel": "Cancel",
    "create": "Create",
    "rename_folder": "Rename Folder",
    "rename_folder_title": "Rename Folder",
    "rename_folder_placeholder": "Enter new folder name",
    "delete_folder": "Delete Folder",
    "delete_folder_title": "Delete Folder",
    "delete_folder_message": "Are you sure you want to delete this folder?",
    "folder_help": "Folder Help",
    "folder_help_item_1": "Click on a folder in the tree to view its files.",
    "folder_help_item_2": "Use [-] to collapse and [+] to expand folders.",
    "folder_help_item_3": "Select a folder and click \"Create Folder\" to add a subfolder.",
    "folder_help_item_4": "To rename or delete a folder, select it and then click the appropriate button.",

    // File List keys:
    "actions": "Actions",
    "file_list_title": "Files in (Root)",
    "files_in": "Files in",
    "delete_files": "Delete Files",
    "delete_selected_files_title": "Delete Selected Files",
    "delete_files_message": "Are you sure you want to delete the selected files?",
    "copy_files": "Copy Files",
    "copy_files_title": "Copy Selected Files",
    "copy_files_message": "Select a target folder for copying the selected files:",
    "move_files": "Move Files",
    "move_files_title": "Move Selected Files",
    "move_files_message": "Select a target folder for moving the selected files:",
    "move": "Move",
    "extract_zip_button": "Extract Zip",
    "download_zip_title": "Download Selected Files as Zip",
    "download_zip_prompt": "Enter a name for the zip file:",
    "zip_placeholder": "files.zip",
    "share": "Share",
    "total_files": "Total Files",
    "total_size": "Total Size",
    "prev": "Prev",
    "next": "Next",
    "page": "Page",
    "of": "of",

    // Login Form keys:
    "login": "Login",
    "remember_me": "Remember me",
    "login_oidc": "Login with OIDC",
    "basic_http_login": "Use Basic HTTP Login",

    // Change Password keys:
    "change_password_title": "Change Password",
    "old_password": "Old Password",
    "new_password": "New Password",
    "confirm_new_password": "Confirm New Password",

    // Add User keys:
    "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",

    // Remove User keys:
    "remove_user_title": "Remove User",
    "select_user_remove": "Select a user to remove:",
    "delete_user": "Delete User",

    // Rename File keys:
    "rename_file_title": "Rename File",
    "rename_file_placeholder": "Enter new file name",

    // Folder Share
    "share_folder": "Share Folder",
    "allow_uploads": "Allow Uploads",
    "share_link_generated": "Share Link Generated",
    "error_generating_share_link": "Error Generating Share Link",
    "custom": "Custom",
    "duration": "Duration",
    "seconds": "Seconds",
    "minutes": "Minutes",
    "hours": "Hours",
    "days": "Days",
    "custom_duration_warning": "⚠️ Using a long expiration may pose security risks. Use with caution.",

    // Folder
    "folder_share": "Share Folder",

    // Custom Confirm Modal keys:
    "yes": "Yes",
    "no": "No",
    "unsaved_changes_confirm": "You have unsaved changes. Are you sure you want to close without saving?",
    "delete": "Delete",
    "download": "Download",
    "upload": "Upload",
    "copy": "Copy",
    "extract": "Extract",
    "user": "User:",
    "unknown_error": "Unknown Error",
    "link_copied": "Link Copied to Clipboard",
    "weeks": "weeks",
    "months": "months",

    // Dark Mode Toggle
    "dark_mode_toggle": "Dark Mode",
    "light_mode_toggle": "Light Mode",
    "switch_to_light_mode": "Switch to light mode",
    "switch_to_dark_mode": "Switch to dark mode",

    // Admin Panel
    "header_settings": "Header Settings",
    "shared_max_upload_size_bytes_title": "Shared Max Upload Size",
    "shared_max_upload_size_bytes": "Shared Max Upload Size (bytes)",
    "max_bytes_shared_uploads_note": "Enter maximum bytes allowed for shared-folder uploads",
    "manage_shared_links": "Manage Shared Links",
    "folder_shares": "Folder Shares",
    "file_shares": "File Shares",
    "loading": "Loading…",
    "error_loading_share_links": "Error loading share links",
    "share_deleted_successfully": "Share deleted successfully",
    "error_deleting_share": "Error deleting share",
    "password_protected": "Password protected",
    "no_shared_links_available": "No shared links available",


    // NEW KEYS ADDED FOR ADMIN, USER PANELS, AND TOTP MODALS:
    "admin_panel": "Admin Panel",
    "user_panel": "User Panel",
    "user_settings": "User Settings",
    "save_profile_picture": "Save Profile Picture",
    "please_select_picture": "Please select a picture",
    "profile_picture_updated": "Profile picture updated",
    "error_updating_picture": "Error updating profile picture",
    "trash_restore_delete": "Trash Restore/Delete",
    "totp_settings": "TOTP Settings",
    "enable_totp": "Enable TOTP",
    "language": "Language",
    "select_language": "Select Language",
    "english": "English",
    "spanish": "Spanish",
    "french": "French",
    "german": "German",
    "chinese_simplified": "Chinese (Simplified)",
    "use_totp_code_instead": "Use TOTP Code instead",
    "submit_recovery_code": "Submit Recovery Code",
    "please_enter_recovery_code": "Please enter your recovery code.",
    "recovery_code_verification_failed": "Recovery code verification failed",
    "error_verifying_recovery_code": "Error verifying recovery code",
    "totp_verification_failed": "TOTP verification failed",
    "error_verifying_totp_code": "Error verifying TOTP code",
    "totp_setup": "TOTP Setup",
    "scan_qr_code": "Scan this QR code with your authenticator app.",
    "enter_totp_confirmation": "Enter the 6-digit code from your app to confirm setup:",
    "confirm": "Confirm",
    "please_enter_valid_code": "Please enter a valid 6-digit code.",
    "totp_enabled_successfully": "TOTP successfully enabled.",
    "error_generating_recovery_code": "Error generating recovery code",
    "error_loading_qr_code": "Error loading QR code.",
    "error_disabling_totp_setting": "Error disabling TOTP setting",
    "user_management": "User Management",
    "add_user": "Add User",
    "remove_user": "Remove User",
    "user_permissions": "User Permissions",
    "oidc_configuration": "OIDC Configuration",
    "oidc_provider_url": "OIDC Provider URL",
    "oidc_client_id": "OIDC Client ID",
    "oidc_client_secret": "OIDC Client Secret",
    "oidc_redirect_uri": "OIDC Redirect URI",
    "global_totp_settings": "Global TOTP Settings",
    "global_otpauth_url": "Global OTPAuth URL",
    "login_options": "Login Options",
    "disable_login_form": "Disable Login Form",
    "disable_basic_http_auth": "Disable Basic HTTP Auth",
    "disable_oidc_login": "Disable OIDC Login (OIDC Config Required to enable)",
    "save_settings": "Save Settings",
    "at_least_one_login_method": "At least one login method must remain enabled.",
    "settings_updated_successfully": "Settings updated successfully.",
    "error_updating_settings": "Error updating settings",
    "user_permissions_updated_successfully": "User permissions updated successfully.",
    "error_updating_permissions": "Error updating permissions",
    "no_users_found": "No users found.",
    "user_folder_only": "User Folder Only",
    "read_only": "Read Only",
    "disable_upload": "Disable Upload",
    "error_loading_users": "Error loading users",
    "save_permissions": "Save Permissions",
    "your_recovery_code": "Your Recovery Code",
    "please_save_recovery_code": "Please save this code securely. It will not be shown again and can only be used once.",
    "ok": "OK",
    "show": "Show",
    "items_per_page": "items per page",
    "columns": "Columns",
    "row_height": "Row Height",
    "api_docs": "API Docs",
    "show_folders_above_files": "Show folders above files",
    "display": "Display",
    "create_file": "Create File",
    "create_new_file": "Create New File",
    "enter_file_name": "Enter file name",
    "newfile_placeholder": "New file name",
    "file_created_successfully": "File created successfully!",
    "error_creating_file": "Error creating file",
    "file_created": "File created successfully!",
    "no_access_to_resource": "You do not have access to this resource.",
    "can_share": "Can Share",
    "bypass_ownership": "Bypass Ownership",
    "error_loading_user_grants": "Error loading user grants",
    "click_to_edit": "Click to edit",
    "folder_access": "Folder Access",
    "move_folder": "Move Folder",
    "move_folder_message": "Select a destination folder to move this folder to:",
    "move_folder_title": "Move this folder",
    "move_folder_success": "Folder moved successfully.",
    "move_folder_error": "Error moving folder.",
    "move_folder_invalid": "Invalid source or destination folder.",
    "move_folder_denied": "You do not have permission to move this folder.",
    "move_folder_same_dest": "Destination cannot be the source or one of its subfolders.",
    "move_folder_same_owner": "Source and destination must have the same owner.",
    "move_folder_confirm": "Are you sure you want to move this folder?",
    "move_folder_select_dest": "Select a destination folder",
    "move_folder_select_dest_help": "Choose where this folder should be moved to.",
    "acl_move_folder_label": "Move Folder (source)",
    "acl_move_folder_help": "Allows moving this folder to a different parent. Requires Manage or Ownership on the folder.",
    "acl_move_in_label": "Allow Moves Into This Folder (destination)",
    "acl_move_in_help": "Allows items or folders from elsewhere to be moved into this folder. Requires Manage on the destination folder.",
    "acl_move_folder_info": "Moving folders is restricted to folder owners or managers. Destination folders must also allow moves in.",
    "context_move_folder": "Move Folder...",
    "context_move_here": "Move Here",
    "context_move_cancel": "Cancel Move",
    "mark_as_viewed": "Mark as viewed",
    "viewed": "Viewed",
    "resumed_from": "Resumed from",
    "clear_progress": "Clear progress",
    "marked_viewed": "Marked as viewed",
    "progress_cleared": "Progress cleared",
    "previous": "Previous",
    "next": "Next",
    "watched": "Watched",
    "reset_progress": "Reset Progress"
  },
  es: {
    "please_log_in_to_continue": "Por favor, inicie sesión para continuar.",
    "no_files_selected": "No se han seleccionado archivos.",
    "confirm_delete_files": "¿Está seguro de que desea eliminar {count} archivo(s) seleccionado(s)?",
    "element_not_found": "Elemento con id \"{id}\" no encontrado.",
    "search_placeholder": "Buscar archivos, etiquetas y cargador...",
    "search_placeholder_advanced": "Búsqueda avanzada: archivos, etiquetas, cargador y contenido...",
    "basic_search_tooltip": "Búsqueda básica: Buscar por nombre de archivo, etiquetas y cargador.",
    "advanced_search_tooltip": "Búsqueda avanzada: Incluye el contenido del archivo, además del nombre, etiquetas y cargador.",
    "file_name": "Nombre del archivo",
    "date_modified": "Fecha de modificación",
    "upload_date": "Fecha de carga",
    "file_size": "Tamaño del archivo",
    "uploader": "Cargado por",
    "enter_totp_code": "Ingrese el código TOTP",
    "use_recovery_code_instead": "Usar código de recuperación en su lugar",
    "enter_recovery_code": "Ingrese el código de recuperación",
    "editing": "Editando",
    "decrease_font": "A-",
    "increase_font": "A+",
    "save": "Guardar",
    "close": "Cerrar",
    "no_files_found": "No se encontraron archivos.",
    "switch_to_table_view": "Cambiar a vista de tabla",
    "switch_to_gallery_view": "Cambiar a vista de galería",
    "share_file": "Compartir archivo",
    "set_expiration": "Establecer vencimiento:",
    "password_optional": "Contraseña (opcional):",
    "generate_share_link": "Generar enlace para compartir",
    "shareable_link": "Enlace para compartir:",
    "copy_link": "Copiar enlace",
    "tag_file": "Etiquetar archivo",
    "tag_name": "Nombre de la etiqueta:",
    "tag_color": "Color de la etiqueta:",
    "save_tag": "Guardar etiqueta",
    "light_mode": "Modo claro",
    "dark_mode": "Modo oscuro",
    "upload_instruction": "Suelte archivos/carpetas aquí o haga clic en 'Elegir archivos'",
    "no_files_selected_default": "No se han seleccionado archivos",
    "choose_files": "Elegir archivos",
    "delete_selected": "Eliminar seleccionados",
    "copy_selected": "Copiar seleccionados",
    "move_selected": "Mover seleccionados",
    "tag_selected": "Etiquetar seleccionados",
    "download_zip": "Descargar Zip",
    "extract_zip": "Extraer Zip",
    "preview": "Vista previa",
    "edit": "Editar",
    "rename": "Renombrar",
    "trash_empty": "La papelera está vacía.",
    "no_trash_selected": "No se han seleccionado elementos de la papelera para restaurar.",

    // Additional keys for HTML translations:
    "title": "FileRise",
    "header_title": "FileRise",
    "header_title_text": "Header Title",
    "logout": "Cerrar sesión",
    "change_password": "Cambiar contraseña",
    "restore_text": "Restaurar o",
    "delete_text": "Eliminar elementos de la papelera",
    "restore_selected": "Restaurar seleccionados",
    "restore_all": "Restaurar todo",
    "delete_selected_trash": "Eliminar seleccionados",
    "delete_all": "Eliminar todo",
    "upload_header": "Cargar archivos/carpetas",

    // Folder Management keys:
    "folder_navigation": "Navegación y gestión de carpetas",
    "create_folder": "Crear carpeta",
    "create_folder_title": "Crear carpeta",
    "enter_folder_name": "Ingrese el nombre de la carpeta",
    "cancel": "Cancelar",
    "create": "Crear",
    "rename_folder": "Renombrar carpeta",
    "rename_folder_title": "Renombrar carpeta",
    "rename_folder_placeholder": "Ingrese el nuevo nombre de la carpeta",
    "delete_folder": "Eliminar carpeta",
    "delete_folder_title": "Eliminar carpeta",
    "delete_folder_message": "¿Está seguro de que desea eliminar esta carpeta?",
    "folder_help": "Ayuda de carpetas",
    "folder_help_item_1": "Haga clic en una carpeta en el árbol para ver sus archivos.",
    "folder_help_item_2": "Utilice [-] para contraer y [+] para expandir las carpetas.",
    "folder_help_item_3": "Seleccione una carpeta y haga clic en \"Crear carpeta\" para agregar una subcarpeta.",
    "folder_help_item_4": "Para renombrar o eliminar una carpeta, selecciónela y luego haga clic en el botón correspondiente.",

    // File List keys:
    "file_list_title": "Archivos en (Raíz)",
    "files_in": "Archivos en",
    "delete_files": "Eliminar archivos",
    "delete_selected_files_title": "Eliminar archivos seleccionados",
    "delete_files_message": "¿Está seguro de que desea eliminar los archivos seleccionados?",
    "copy_files": "Copiar archivos",
    "copy_files_title": "Copiar archivos seleccionados",
    "copy_files_message": "Seleccione una carpeta destino para copiar los archivos seleccionados:",
    "move_files": "Mover archivos",
    "move_files_title": "Mover archivos seleccionados",
    "move_files_message": "Seleccione una carpeta destino para mover los archivos seleccionados:",
    "move": "Mover",
    "extract_zip_button": "Extraer Zip",
    "download_zip_title": "Descargar archivos seleccionados en un Zip",
    "download_zip_prompt": "Ingrese un nombre para el archivo Zip:",
    "zip_placeholder": "files.zip",

    // Login Form keys:
    "login": "Iniciar sesión",
    "remember_me": "Recuérdame",
    "login_oidc": "Iniciar sesión con OIDC",
    "basic_http_login": "Usar autenticación HTTP básica",

    // Change Password keys:
    "change_password_title": "Cambiar contraseña",
    "old_password": "Contraseña antigua",
    "new_password": "Nueva contraseña",
    "confirm_new_password": "Confirmar nueva contraseña",

    // Add User keys:
    "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",

    // Remove User keys:
    "remove_user_title": "Eliminar usuario",
    "select_user_remove": "Seleccione un usuario para eliminar:",
    "delete_user": "Eliminar usuario",

    // Rename File keys:
    "rename_file_title": "Renombrar archivo",
    "rename_file_placeholder": "Ingrese el nuevo nombre del archivo",

    // Folder Share
    "share_folder": "Compartir carpeta",
    "allow_uploads": "Permitir cargas",
    "share_link_generated": "Enlace para compartir generado",
    "error_generating_share_link": "Error al generar el enlace para compartir",

    // Folder
    "folder_share": "Compartir carpeta",

    // Custom Confirm Modal keys:
    "yes": "Sí",
    "no": "No",
    "unsaved_changes_confirm": "Tiene cambios sin guardar. ¿Está seguro de que desea cerrar sin guardar?",
    "delete": "Eliminar",
    "download": "Descargar",
    "upload": "Cargar",
    "copy": "Copiar",
    "extract": "Extraer",
    "user": "Usuario:",
    "unknown_error": "Error desconocido",
    "link_copied": "Enlace copiado al portapapeles",
    "minutes": "minutos",
    "hours": "horas",
    "days": "días",
    "weeks": "semanas",
    "months": "meses",
    "seconds": "segundos",

    // Dark Mode Toggle
    "dark_mode_toggle": "Modo oscuro",
    "light_mode_toggle": "Modo claro",

    // NEW KEYS ADDED FOR ADMIN, USER PANELS, AND TOTP MODALS:
    "admin_panel": "Panel de Administración",
    "user_panel": "Panel de Usuario",
    "totp_settings": "Configuración TOTP",
    "enable_totp": "Activar TOTP",
    "language": "Idioma",
    "select_language": "Seleccionar idioma",
    "english": "Inglés",
    "spanish": "Español",
    "french": "Francés",
    "german": "Alemán",
    "chinese_simplified": "Chino (simplificado)",
    "use_totp_code_instead": "Usar código TOTP en su lugar",
    "submit_recovery_code": "Enviar código de recuperación",
    "please_enter_recovery_code": "Por favor, ingrese su código de recuperación.",
    "recovery_code_verification_failed": "La verificación del código de recuperación falló",
    "error_verifying_recovery_code": "Error al verificar el código de recuperación",
    "totp_verification_failed": "La verificación TOTP falló",
    "error_verifying_totp_code": "Error al verificar el código TOTP",
    "totp_setup": "Configuración TOTP",
    "scan_qr_code": "Escanee este código QR con su aplicación de autenticación.",
    "enter_totp_confirmation": "Ingrese el código de 6 dígitos de su aplicación para confirmar la configuración:",
    "confirm": "Confirmar",
    "please_enter_valid_code": "Por favor, ingrese un código válido de 6 dígitos.",
    "totp_enabled_successfully": "TOTP activado con éxito.",
    "error_generating_recovery_code": "Error al generar el código de recuperación",
    "error_loading_qr_code": "Error al cargar el código QR.",
    "error_disabling_totp_setting": "Error al desactivar la configuración TOTP",
    "user_management": "Gestión de Usuarios",
    "add_user": "Agregar usuario",
    "remove_user": "Eliminar usuario",
    "user_permissions": "Permisos de Usuario",
    "oidc_configuration": "Configuración OIDC",
    "oidc_provider_url": "URL del Proveedor OIDC",
    "oidc_client_id": "ID del Cliente OIDC",
    "oidc_client_secret": "Secreto del Cliente OIDC",
    "oidc_redirect_uri": "URI de Redirección OIDC",
    "global_totp_settings": "Configuración Global TOTP",
    "global_otpauth_url": "URL Global OTPAuth",
    "login_options": "Opciones de inicio de sesión",
    "disable_login_form": "Desactivar formulario de inicio de sesión",
    "disable_basic_http_auth": "Desactivar autenticación HTTP básica",
    "disable_oidc_login": "Desactivar inicio de sesión OIDC",
    "save_settings": "Guardar configuración",
    "at_least_one_login_method": "Al menos un método de inicio de sesión debe permanecer habilitado.",
    "settings_updated_successfully": "Configuración actualizada con éxito.",
    "error_updating_settings": "Error al actualizar la configuración",
    "user_permissions_updated_successfully": "Permisos de usuario actualizados con éxito.",
    "error_updating_permissions": "Error al actualizar los permisos",
    "no_users_found": "No se encontraron usuarios.",
    "user_folder_only": "Solo carpeta de usuario",
    "read_only": "Solo lectura",
    "disable_upload": "Desactivar carga",
    "error_loading_users": "Error al cargar usuarios",
    "save_permissions": "Guardar permisos",
    "your_recovery_code": "Su código de recuperación",
    "please_save_recovery_code": "Por favor, guarde este código de forma segura. No se mostrará de nuevo y solo podrá usarse una vez.",
    "ok": "OK",
    "columns": "Columnas"
  },
  fr: {
    "please_log_in_to_continue": "Veuillez vous connecter pour continuer.",
    "no_files_selected": "Aucun fichier sélectionné.",
    "confirm_delete_files": "Êtes-vous sûr de vouloir supprimer {count} fichier(s) sélectionné(s) ?",
    "element_not_found": "Élément avec l'id \"{id}\" non trouvé.",
    "search_placeholder": "Rechercher des fichiers, des balises et l'uploader...",
    "search_placeholder_advanced": "Recherche avancée : fichiers, balises, uploader et contenu...",
    "basic_search_tooltip": "Recherche basique : rechercher par nom de fichier, balises et uploader.",
    "advanced_search_tooltip": "Recherche avancée : inclut le contenu du fichier, en plus du nom, des balises et de l'uploader.",
    "file_name": "Nom du fichier",
    "date_modified": "Date de modification",
    "upload_date": "Date de téléchargement",
    "file_size": "Taille du fichier",
    "uploader": "Uploader",
    "enter_totp_code": "Entrez le code TOTP",
    "use_recovery_code_instead": "Utilisez le code de récupération à la place",
    "enter_recovery_code": "Entrez le code de récupération",
    "editing": "Modification",
    "decrease_font": "A-",
    "increase_font": "A+",
    "save": "Enregistrer",
    "close": "Fermer",
    "no_files_found": "Aucun fichier trouvé.",
    "switch_to_table_view": "Passer en vue tableau",
    "switch_to_gallery_view": "Passer en vue galerie",
    "share_file": "Partager le fichier",
    "set_expiration": "Définir l'expiration :",
    "password_optional": "Mot de passe (facultatif) :",
    "generate_share_link": "Générer le lien de partage",
    "shareable_link": "Lien partageable :",
    "copy_link": "Copier le lien",
    "tag_file": "Étiqueter le fichier",
    "tag_name": "Nom de l'étiquette :",
    "tag_color": "Couleur de l'étiquette :",
    "save_tag": "Enregistrer l'étiquette",
    "light_mode": "Mode clair",
    "dark_mode": "Mode sombre",
    "upload_instruction": "Déposez des fichiers/dossiers ici ou cliquez sur 'Choisir des fichiers'",
    "no_files_selected_default": "Aucun fichier sélectionné",
    "choose_files": "Choisir des fichiers",
    "delete_selected": "Supprimer la sélection",
    "copy_selected": "Copier la sélection",
    "move_selected": "Déplacer la sélection",
    "tag_selected": "Étiqueter la sélection",
    "download_zip": "Télécharger le Zip",
    "extract_zip": "Extraire le Zip",
    "preview": "Aperçu",
    "edit": "Modifier",
    "rename": "Renommer",
    "trash_empty": "La corbeille est vide.",
    "no_trash_selected": "Aucun élément de la corbeille sélectionné pour restauration.",

    // Additional keys for HTML translations:
    "title": "FileRise",
    "header_title": "FileRise",
    "logout": "Déconnexion",
    "change_password": "Changer le mot de passe",
    "restore_text": "Restaurer ou",
    "delete_text": "Supprimer les éléments de la corbeille",
    "restore_selected": "Restaurer la sélection",
    "restore_all": "Restaurer tout",
    "delete_selected_trash": "Supprimer la sélection",
    "delete_all": "Supprimer tout",
    "upload_header": "Téléverser des fichiers/dossiers",

    // Folder Management keys:
    "folder_navigation": "Navigation et gestion des dossiers",
    "create_folder": "Créer un dossier",
    "create_folder_title": "Créer un dossier",
    "enter_folder_name": "Entrez le nom du dossier",
    "cancel": "Annuler",
    "create": "Créer",
    "rename_folder": "Renommer le dossier",
    "rename_folder_title": "Renommer le dossier",
    "rename_folder_placeholder": "Entrez le nouveau nom du dossier",
    "delete_folder": "Supprimer le dossier",
    "delete_folder_title": "Supprimer le dossier",
    "delete_folder_message": "Êtes-vous sûr de vouloir supprimer ce dossier ?",
    "folder_help": "Aide des dossiers",
    "folder_help_item_1": "Cliquez sur un dossier dans l'arborescence pour voir ses fichiers.",
    "folder_help_item_2": "Utilisez [-] pour réduire et [+] pour développer les dossiers.",
    "folder_help_item_3": "Sélectionnez un dossier et cliquez sur \"Créer un dossier\" pour ajouter un sous-dossier.",
    "folder_help_item_4": "Pour renommer ou supprimer un dossier, sélectionnez-le puis cliquez sur le bouton approprié.",

    // File List keys:
    "file_list_title": "Fichiers dans (Racine)",
    "files_in": "Fichiers dans",
    "delete_files": "Supprimer les fichiers",
    "delete_selected_files_title": "Supprimer les fichiers sélectionnés",
    "delete_files_message": "Êtes-vous sûr de vouloir supprimer les fichiers sélectionnés ?",
    "copy_files": "Copier les fichiers",
    "copy_files_title": "Copier les fichiers sélectionnés",
    "copy_files_message": "Sélectionnez un dossier de destination pour copier les fichiers sélectionnés :",
    "move_files": "Déplacer les fichiers",
    "move_files_title": "Déplacer les fichiers sélectionnés",
    "move_files_message": "Sélectionnez un dossier de destination pour déplacer les fichiers sélectionnés :",
    "move": "Déplacer",
    "extract_zip_button": "Extraire le Zip",
    "download_zip_title": "Télécharger les fichiers sélectionnés en Zip",
    "download_zip_prompt": "Entrez un nom pour le fichier Zip :",
    "zip_placeholder": "files.zip",

    // Login Form keys:
    "login": "Connexion",
    "remember_me": "Se souvenir de moi",
    "login_oidc": "Se connecter avec OIDC",
    "basic_http_login": "Utiliser l'authentification HTTP basique",

    // Change Password keys:
    "change_password_title": "Changer le mot de passe",
    "old_password": "Ancien mot de passe",
    "new_password": "Nouveau mot de passe",
    "confirm_new_password": "Confirmer le nouveau mot de passe",

    // Add User keys:
    "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",

    // Remove User keys:
    "remove_user_title": "Supprimer un utilisateur",
    "select_user_remove": "Sélectionnez un utilisateur à supprimer :",
    "delete_user": "Supprimer l'utilisateur",

    // Rename File keys:
    "rename_file_title": "Renommer le fichier",
    "rename_file_placeholder": "Entrez le nouveau nom du fichier",

    // Folder Share
    "share_folder": "Partager le dossier",
    "allow_uploads": "Autoriser les téléchargements",
    "share_link_generated": "Lien de partage généré",
    "error_generating_share_link": "Erreur lors de la génération du lien de partage",

    // Folder
    "folder_share": "Partager le dossier",

    // Custom Confirm Modal keys:
    "yes": "Oui",
    "no": "Non",
    "unsaved_changes_confirm": "Vous avez des modifications non enregistrées. Êtes-vous sûr de vouloir fermer sans enregistrer ?",
    "delete": "Supprimer",
    "download": "Télécharger",
    "upload": "Téléverser",
    "copy": "Copier",
    "extract": "Extraire",
    "user": "Utilisateur :",
    "unknown_error": "Erreur inconnue",
    "link_copied": "Lien copié dans le presse-papiers",
    "minutes": "minutes",
    "hours": "heures",
    "days": "jours",
    "weeks": "semaines",
    "months": "mois",
    "seconds": "secondes",

    // Dark Mode Toggle
    "dark_mode_toggle": "Mode sombre",
    "light_mode_toggle": "Mode clair",

    // NEW KEYS ADDED FOR ADMIN, USER PANELS, AND TOTP MODALS:
    "admin_panel": "Panneau d'administration",
    "user_panel": "Panneau utilisateur",
    "totp_settings": "Paramètres TOTP",
    "enable_totp": "Activer TOTP",
    "language": "Langue",
    "select_language": "Sélectionnez la langue",
    "english": "Anglais",
    "spanish": "Espagnol",
    "french": "Français",
    "german": "Allemand",
    "chinese_simplified": "Chinois (simplifié)",
    "use_totp_code_instead": "Utiliser le code TOTP à la place",
    "submit_recovery_code": "Soumettre le code de récupération",
    "please_enter_recovery_code": "Veuillez entrer votre code de récupération.",
    "recovery_code_verification_failed": "La vérification du code de récupération a échoué",
    "error_verifying_recovery_code": "Erreur lors de la vérification du code de récupération",
    "totp_verification_failed": "La vérification TOTP a échoué",
    "error_verifying_totp_code": "Erreur lors de la vérification du code TOTP",
    "totp_setup": "Configuration TOTP",
    "scan_qr_code": "Scannez ce QR code avec votre application d'authentification.",
    "enter_totp_confirmation": "Entrez le code à 6 chiffres de votre application pour confirmer la configuration :",
    "confirm": "Confirmer",
    "please_enter_valid_code": "Veuillez entrer un code valide à 6 chiffres.",
    "totp_enabled_successfully": "TOTP activé avec succès.",
    "error_generating_recovery_code": "Erreur lors de la génération du code de récupération",
    "error_loading_qr_code": "Erreur lors du chargement du QR code.",
    "error_disabling_totp_setting": "Erreur lors de la désactivation des paramètres TOTP",
    "user_management": "Gestion des utilisateurs",
    "add_user": "Ajouter un utilisateur",
    "remove_user": "Supprimer un utilisateur",
    "user_permissions": "Permissions des utilisateurs",
    "oidc_configuration": "Configuration OIDC",
    "oidc_provider_url": "URL du fournisseur OIDC",
    "oidc_client_id": "ID du client OIDC",
    "oidc_client_secret": "Secret du client OIDC",
    "oidc_redirect_uri": "URI de redirection OIDC",
    "global_totp_settings": "Paramètres globaux TOTP",
    "global_otpauth_url": "URL globale OTPAuth",
    "login_options": "Options de connexion",
    "disable_login_form": "Désactiver le formulaire de connexion",
    "disable_basic_http_auth": "Désactiver l'authentification HTTP basique",
    "disable_oidc_login": "Désactiver la connexion OIDC",
    "save_settings": "Enregistrer les paramètres",
    "at_least_one_login_method": "Au moins une méthode de connexion doit rester activée.",
    "settings_updated_successfully": "Paramètres mis à jour avec succès.",
    "error_updating_settings": "Erreur lors de la mise à jour des paramètres",
    "user_permissions_updated_successfully": "Permissions des utilisateurs mises à jour avec succès.",
    "error_updating_permissions": "Erreur lors de la mise à jour des permissions",
    "no_users_found": "Aucun utilisateur trouvé.",
    "user_folder_only": "Uniquement le dossier utilisateur",
    "read_only": "Lecture seule",
    "disable_upload": "Désactiver le téléchargement",
    "error_loading_users": "Erreur lors du chargement des utilisateurs",
    "save_permissions": "Enregistrer les permissions",
    "your_recovery_code": "Votre code de récupération",
    "please_save_recovery_code": "Veuillez sauvegarder ce code en toute sécurité. Il ne sera plus affiché et ne pourra être utilisé qu'une seule fois.",
    "ok": "OK",
    "columns": "Colonnes"
  },
  de: {
    "please_log_in_to_continue": "Bitte melden Sie sich an, um fortzufahren.",
    "no_files_selected": "Keine Dateien ausgewählt.",
    "confirm_delete_files": "Sind Sie sicher, dass Sie {count} ausgewählte Datei(en) löschen möchten?",
    "element_not_found": "Element mit der ID \"{id}\" wurde nicht gefunden.",
    "search_placeholder": "Dateien, Tags und Uploader suchen...",
    "search_placeholder_advanced": "Erweiterte Suche: Dateien, Tags, Uploader & Inhalt...",
    "basic_search_tooltip": "Einfache Suche: Nach Dateiname, Tags und Uploader suchen.",
    "advanced_search_tooltip": "Erweiterte Suche: Beinhaltet Dateiinhalte zusätzlich zum Dateinamen, Tags und Uploader.",
    "file_name": "Dateiname",
    "date_modified": "Änderungsdatum",
    "upload_date": "Hochladedatum",
    "file_size": "Dateigröße",
    "uploader": "Uploader",
    "enter_totp_code": "Geben Sie den TOTP-Code ein",
    "use_recovery_code_instead": "Verwenden Sie stattdessen den Wiederherstellungscode",
    "enter_recovery_code": "Geben Sie den Wiederherstellungscode ein",
    "editing": "Bearbeitung",
    "decrease_font": "A-",
    "increase_font": "A+",
    "save": "Speichern",
    "close": "Schließen",
    "no_files_found": "Keine Dateien gefunden.",
    "switch_to_table_view": "Zur Tabellenansicht wechseln",
    "switch_to_gallery_view": "Zur Galerieansicht wechseln",
    "share_file": "Datei teilen",
    "set_expiration": "Ablauf festlegen:",
    "password_optional": "Passwort (optional):",
    "generate_share_link": "Freigabelink generieren",
    "shareable_link": "Freigabelink:",
    "copy_link": "Link kopieren",
    "tag_file": "Datei taggen",
    "tag_name": "Tagname:",
    "tag_color": "Tagfarbe:",
    "save_tag": "Tag speichern",
    "light_mode": "Heller Modus",
    "dark_mode": "Dunkler Modus",
    "upload_instruction": "Ziehen Sie Dateien/Ordner hierher oder klicken Sie auf 'Dateien auswählen'",
    "no_files_selected_default": "Keine Dateien ausgewählt",
    "choose_files": "Dateien auswählen",
    "delete_selected": "Ausgewählte löschen",
    "copy_selected": "Ausgewählte kopieren",
    "move_selected": "Ausgewählte verschieben",
    "tag_selected": "Ausgewählte taggen",
    "download_zip": "Zip herunterladen",
    "extract_zip": "Zip entpacken",
    "preview": "Vorschau",
    "edit": "Bearbeiten",
    "rename": "Umbenennen",
    "trash_empty": "Papierkorb ist leer.",
    "no_trash_selected": "Keine Papierkorbeinträge zur Wiederherstellung ausgewählt.",

    // Additional keys for HTML translations:
    "title": "FileRise",
    "header_title": "FileRise",
    "logout": "Abmelden",
    "change_password": "Passwort ändern",
    "restore_text": "Wiederherstellen oder",
    "delete_text": "Papierkorbeinträge löschen",
    "restore_selected": "Ausgewählte wiederherstellen",
    "restore_all": "Alle wiederherstellen",
    "delete_selected_trash": "Ausgewählte löschen",
    "delete_all": "Alle löschen",
    "upload_header": "Dateien/Ordner hochladen",

    // Folder Management keys:
    "folder_navigation": "Ordnernavigation & Verwaltung",
    "create_folder": "Ordner erstellen",
    "create_folder_title": "Ordner erstellen",
    "enter_folder_name": "Geben Sie den Ordnernamen ein",
    "cancel": "Abbrechen",
    "create": "Erstellen",
    "rename_folder": "Ordner umbenennen",
    "rename_folder_title": "Ordner umbenennen",
    "rename_folder_placeholder": "Neuen Ordnernamen eingeben",
    "delete_folder": "Ordner löschen",
    "delete_folder_title": "Ordner löschen",
    "delete_folder_message": "Sind Sie sicher, dass Sie diesen Ordner löschen möchten?",
    "folder_help": "Ordnerhilfe",
    "folder_help_item_1": "Klicken Sie auf einen Ordner im Baum, um dessen Dateien anzuzeigen.",
    "folder_help_item_2": "Verwenden Sie [-] zum Einklappen und [+] zum Ausklappen der Ordner.",
    "folder_help_item_3": "Wählen Sie einen Ordner aus und klicken Sie auf \"Ordner erstellen\", um einen Unterordner hinzuzufügen.",
    "folder_help_item_4": "Um einen Ordner umzubenennen oder zu löschen, wählen Sie ihn aus und klicken Sie auf den entsprechenden Button.",

    // File List keys:
    "actions": "Aktionen",
    "file_list_title": "Dateien in (Root)",
    "files_in": "Dateien in",
    "delete_files": "Dateien löschen",
    "delete_selected_files_title": "Ausgewählte Dateien löschen",
    "delete_files_message": "Sind Sie sicher, dass Sie die ausgewählten Dateien löschen möchten?",
    "copy_files": "Dateien kopieren",
    "copy_files_title": "Ausgewählte Dateien kopieren",
    "copy_files_message": "Wählen Sie einen Zielordner, um die ausgewählten Dateien zu kopieren:",
    "move_files": "Dateien verschieben",
    "move_files_title": "Ausgewählte Dateien verschieben",
    "move_files_message": "Wählen Sie einen Zielordner, um die ausgewählten Dateien zu verschieben:",
    "move": "Verschieben",
    "extract_zip_button": "Zip entpacken",
    "download_zip_title": "Ausgewählte Dateien als Zip herunterladen",
    "download_zip_prompt": "Geben Sie einen Namen für die Zip-Datei ein:",
    "zip_placeholder": "files.zip",
    "share": "Teilen",
    "total_files": "Gesamtanzahl",
    "total_size": "Gesamtgröße",
    "prev": "Zurück",
    "next": "Weiter",
    "page": "Seite",
    "of": "von",

    // Login Form keys:
    "login": "Anmelden",
    "remember_me": "Angemeldet bleiben",
    "login_oidc": "Mit OIDC anmelden",
    "basic_http_login": "HTTP-Basisauthentifizierung verwenden",

    // Change Password keys:
    "change_password_title": "Passwort ändern",
    "old_password": "Altes Passwort",
    "new_password": "Neues Passwort",
    "confirm_new_password": "Neues Passwort bestätigen",

    // Add User keys:
    "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",

    // Remove User keys:
    "remove_user_title": "Benutzer entfernen",
    "select_user_remove": "Wählen Sie einen Benutzer zum Entfernen aus:",
    "delete_user": "Benutzer löschen",

    // Rename File keys:
    "rename_file_title": "Datei umbenennen",
    "rename_file_placeholder": "Geben Sie den neuen Dateinamen ein",

    // Folder Share
    "share_folder": "Ordner teilen",
    "allow_uploads": "Uploads erlauben",
    "share_link_generated": "Freigabelink generiert",
    "error_generating_share_link": "Fehler beim Generieren des Freigabelinks",

    // Folder
    "folder_share": "Ordner teilen",

    // Custom Confirm Modal keys:
    "yes": "Ja",
    "no": "Nein",
    "unsaved_changes_confirm": "Sie haben ungespeicherte Änderungen. Sind Sie sicher, dass Sie schließen möchten, ohne zu speichern?",
    "delete": "Löschen",
    "download": "Herunterladen",
    "upload": "Hochladen",
    "copy": "Kopieren",
    "extract": "Entpacken",
    "user": "Benutzer:",
    "unknown_error": "Unbekannter Fehler",
    "link_copied": "Link in die Zwischenablage kopiert",
    "minutes": "Minuten",
    "hours": "Stunden",
    "days": "Tage",
    "weeks": "Wochen",
    "months": "Monate",
    "seconds": "Sekunden",

    // Dark Mode Toggle
    "dark_mode_toggle": "Dunkler Modus",
    "light_mode_toggle": "Heller Modus",

    // NEW KEYS ADDED FOR ADMIN, USER PANELS, AND TOTP MODALS:
    "admin_panel": "Administrationsbereich",
    "user_panel": "Benutzerbereich",
    "trash_restore_delete": "Papierkorb wiederherstellen/löschen",
    "totp_settings": "TOTP-Einstellungen",
    "enable_totp": "TOTP aktivieren",
    "language": "Sprache",
    "select_language": "Sprache auswählen",
    "english": "Englisch",
    "spanish": "Spanisch",
    "french": "Französisch",
    "german": "Deutsch",
    "chinese_simplified": "Chinesisch (vereinfacht)",
    "use_totp_code_instead": "Stattdessen TOTP-Code verwenden",
    "submit_recovery_code": "Wiederherstellungscode absenden",
    "please_enter_recovery_code": "Bitte geben Sie Ihren Wiederherstellungscode ein.",
    "recovery_code_verification_failed": "Überprüfung des Wiederherstellungscodes fehlgeschlagen",
    "error_verifying_recovery_code": "Fehler bei der Überprüfung des Wiederherstellungscodes",
    "totp_verification_failed": "TOTP-Überprüfung fehlgeschlagen",
    "error_verifying_totp_code": "Fehler bei der Überprüfung des TOTP-Codes",
    "totp_setup": "TOTP-Einrichtung",
    "scan_qr_code": "Scannen Sie diesen QR-Code mit Ihrer Authenticator-App.",
    "enter_totp_confirmation": "Geben Sie den 6-stelligen Code aus Ihrer App zur Bestätigung ein:",
    "confirm": "Bestätigen",
    "please_enter_valid_code": "Bitte geben Sie einen gültigen 6-stelligen Code ein.",
    "totp_enabled_successfully": "TOTP wurde erfolgreich aktiviert.",
    "error_generating_recovery_code": "Fehler beim Generieren des Wiederherstellungscodes",
    "error_loading_qr_code": "Fehler beim Laden des QR-Codes.",
    "error_disabling_totp_setting": "Fehler beim Deaktivieren der TOTP-Einstellungen",
    "user_management": "Benutzerverwaltung",
    "add_user": "Benutzer hinzufügen",
    "remove_user": "Benutzer entfernen",
    "user_permissions": "Benutzerberechtigungen",
    "oidc_configuration": "OIDC-Konfiguration",
    "oidc_provider_url": "OIDC-Anbieter-URL",
    "oidc_client_id": "OIDC-Client-ID",
    "oidc_client_secret": "OIDC-Client-Geheimnis",
    "oidc_redirect_uri": "OIDC-Umleitungs-URI",
    "global_totp_settings": "Globale TOTP-Einstellungen",
    "global_otpauth_url": "Globale OTPAuth-URL",
    "login_options": "Anmeldeoptionen",
    "disable_login_form": "Anmeldeformular deaktivieren",
    "disable_basic_http_auth": "HTTP-Basisauthentifizierung deaktivieren",
    "disable_oidc_login": "OIDC-Anmeldung deaktivieren",
    "save_settings": "Einstellungen speichern",
    "at_least_one_login_method": "Mindestens eine Anmeldemethode muss aktiviert bleiben.",
    "settings_updated_successfully": "Einstellungen wurden erfolgreich aktualisiert.",
    "error_updating_settings": "Fehler beim Aktualisieren der Einstellungen",
    "user_permissions_updated_successfully": "Benutzerberechtigungen wurden erfolgreich aktualisiert.",
    "error_updating_permissions": "Fehler beim Aktualisieren der Berechtigungen",
    "no_users_found": "Keine Benutzer gefunden.",
    "user_folder_only": "Nur Benutzerordner",
    "read_only": "Nur Lesen",
    "disable_upload": "Upload deaktivieren",
    "error_loading_users": "Fehler beim Laden der Benutzer",
    "save_permissions": "Berechtigungen speichern",
    "your_recovery_code": "Ihr Wiederherstellungscode",
    "please_save_recovery_code": "Bitte speichern Sie diesen Code sicher. Er wird nicht erneut angezeigt und kann nur einmal verwendet werden.",
    "ok": "OK",
    "show": "Zeige",
    "items_per_page": "elemente pro seite",
    "columns": "Spalten"
  },
  "zh-CN": {
    "please_log_in_to_continue": "请登录以继续。",
    "no_files_selected": "未选择文件。",
    "confirm_delete_files": "确定要删除所选的 {count} 个文件吗？",
    "element_not_found": "未找到 ID 为 \"{id}\" 的元素。",
    "search_placeholder": "搜索文件、标签和上传者…",
    "search_placeholder_advanced": "高级搜索：文件、标签、上传者和内容…",
    "basic_search_tooltip": "基础搜索：按文件名、标签和上传者搜索。",
    "advanced_search_tooltip": "高级搜索：包括文件内容、文件名、标签和上传者。",
    "file_name": "文件名",
    "date_modified": "修改日期",
    "upload_date": "上传日期",
    "file_size": "文件大小",
    "uploader": "上传者",
    "enter_totp_code": "输入 TOTP 验证码",
    "use_recovery_code_instead": "改用恢复代码",
    "enter_recovery_code": "输入恢复代码",
    "editing": "正在编辑",
    "decrease_font": "A-",
    "increase_font": "A+",
    "save": "保存",
    "close": "关闭",
    "no_files_found": "未找到文件。",
    "switch_to_table_view": "切换到表格视图",
    "switch_to_gallery_view": "切换到图库视图",
    "share_file": "分享文件",
    "set_expiration": "设置到期时间：",
    "password_optional": "密码（可选）：",
    "generate_share_link": "生成分享链接",
    "shareable_link": "可分享链接：",
    "copy_link": "复制链接",
    "tag_file": "标记文件",
    "tag_name": "标签名称：",
    "tag_color": "标签颜色：",
    "save_tag": "保存标签",
    "light_mode": "浅色模式",
    "dark_mode": "深色模式",
    "upload_instruction": "将文件/文件夹拖到此处，或点击“选择文件”",
    "no_files_selected_default": "未选择文件",
    "choose_files": "选择文件",
    "delete_selected": "删除所选",
    "copy_selected": "复制所选",
    "move_selected": "移动所选",
    "tag_selected": "标记所选",
    "download_zip": "下载 ZIP",
    "extract_zip": "解压 ZIP",
    "preview": "预览",
    "edit": "编辑",
    "rename": "重命名",
    "trash_empty": "回收站为空。",
    "no_trash_selected": "未选择要还原的回收站项目。",

    "title": "FileRise",
    "header_title": "FileRise",
    "header_title_text": "标题文本",
    "logout": "退出登录",
    "change_password": "更改密码",
    "restore_text": "还原或",
    "delete_text": "删除回收站项目",
    "restore_selected": "还原所选",
    "restore_all": "全部还原",
    "delete_selected_trash": "删除所选",
    "delete_all": "全部删除",
    "upload_header": "上传文件/文件夹",

    "folder_navigation": "文件夹导航与管理",
    "create_folder": "创建文件夹",
    "create_folder_title": "创建文件夹",
    "enter_folder_name": "输入文件夹名称",
    "cancel": "取消",
    "create": "创建",
    "rename_folder": "重命名文件夹",
    "rename_folder_title": "重命名文件夹",
    "rename_folder_placeholder": "输入新的文件夹名称",
    "delete_folder": "删除文件夹",
    "delete_folder_title": "删除文件夹",
    "delete_folder_message": "确定要删除此文件夹吗？",
    "folder_help": "文件夹帮助",
    "folder_help_item_1": "点击文件夹以查看其中的文件。",
    "folder_help_item_2": "使用 [-] 折叠，使用 [+] 展开文件夹。",
    "folder_help_item_3": "选择一个文件夹并点击“创建文件夹”以添加子文件夹。",
    "folder_help_item_4": "要重命名或删除文件夹，请选择后点击相应按钮。",

    "actions": "操作",
    "file_list_title": "文件列表（根目录）",
    "files_in": "文件位于",
    "delete_files": "删除文件",
    "delete_selected_files_title": "删除所选文件",
    "delete_files_message": "确定要删除所选文件吗？",
    "copy_files": "复制文件",
    "copy_files_title": "复制所选文件",
    "copy_files_message": "选择目标文件夹以复制所选文件：",
    "move_files": "移动文件",
    "move_files_title": "移动所选文件",
    "move_files_message": "选择目标文件夹以移动所选文件：",
    "move": "移动",
    "extract_zip_button": "解压 ZIP",
    "download_zip_title": "将所选文件打包为 ZIP 下载",
    "download_zip_prompt": "输入 ZIP 文件名：",
    "zip_placeholder": "files.zip",
    "share": "分享",
    "total_files": "文件总数",
    "total_size": "总大小",
    "prev": "上一页",
    "next": "下一页",
    "page": "第",
    "of": "页，共",

    "login": "登录",
    "remember_me": "记住我",
    "login_oidc": "使用 OIDC 登录",
    "basic_http_login": "使用基本 HTTP 登录",

    "change_password_title": "更改密码",
    "old_password": "旧密码",
    "new_password": "新密码",
    "confirm_new_password": "确认新密码",

    "create_new_user_title": "创建新用户",
    "username": "用户名：",
    "password": "密码：",
    "enter_password": "密码",
    "preparing_download": "正在准备下载…",
    "download_file": "下载文件",
    "confirm_or_change_filename": "确认或修改下载文件名：",
    "filename": "文件名",
    "download": "下载",
    "grant_admin": "授予管理员权限",
    "save_user": "保存用户",

    "remove_user_title": "删除用户",
    "select_user_remove": "选择要删除的用户：",
    "delete_user": "删除用户",

    "rename_file_title": "重命名文件",
    "rename_file_placeholder": "输入新的文件名",

    "share_folder": "分享文件夹",
    "allow_uploads": "允许上传",
    "share_link_generated": "已生成分享链接",
    "error_generating_share_link": "生成分享链接时出错",
    "custom": "自定义",
    "duration": "持续时间",
    "seconds": "秒",
    "minutes": "分钟",
    "hours": "小时",
    "days": "天",
    "custom_duration_warning": "⚠️ 使用较长的到期时间可能存在安全风险，请谨慎使用。",

    "folder_share": "分享文件夹",

    "yes": "是",
    "no": "否",
    "unsaved_changes_confirm": "您有未保存的更改，确定要关闭而不保存吗？",
    "delete": "删除",
    "upload": "上传",
    "copy": "复制",
    "extract": "解压",
    "user": "用户：",
    "unknown_error": "未知错误",
    "link_copied": "链接已复制到剪贴板",
    "weeks": "周",
    "months": "月",

    "dark_mode_toggle": "深色模式",
    "light_mode_toggle": "浅色模式",
    "switch_to_light_mode": "切换到浅色模式",
    "switch_to_dark_mode": "切换到深色模式",

    "header_settings": "标题设置",
    "shared_max_upload_size_bytes_title": "共享最大上传大小",
    "shared_max_upload_size_bytes": "共享最大上传大小（字节）",
    "max_bytes_shared_uploads_note": "请输入共享文件夹上传的最大允许字节数",
    "manage_shared_links": "管理分享链接",
    "folder_shares": "文件夹分享",
    "file_shares": "文件分享",
    "loading": "正在加载…",
    "error_loading_share_links": "加载分享链接时出错",
    "share_deleted_successfully": "分享已成功删除",
    "error_deleting_share": "删除分享时出错",
    "password_protected": "受密码保护",
    "no_shared_links_available": "暂无可用的分享链接",

    "admin_panel": "管理员面板",
    "user_panel": "用户面板",
    "user_settings": "用户设置",
    "save_profile_picture": "保存头像",
    "please_select_picture": "请选择图片",
    "profile_picture_updated": "头像已更新",
    "error_updating_picture": "更新头像时出错",
    "trash_restore_delete": "回收站恢复/删除",
    "totp_settings": "TOTP 设置",
    "enable_totp": "启用 TOTP",
    "language": "语言",
    "select_language": "选择语言",
    "english": "英语",
    "spanish": "西班牙语",
    "french": "法语",
    "german": "德语",
    "chinese_simplified": "简体中文",
    "use_totp_code_instead": "改用 TOTP 验证码",
    "submit_recovery_code": "提交恢复代码",
    "please_enter_recovery_code": "请输入您的恢复代码。",
    "recovery_code_verification_failed": "恢复代码验证失败",
    "error_verifying_recovery_code": "验证恢复代码时出错",
    "totp_verification_failed": "TOTP 验证失败",
    "error_verifying_totp_code": "验证 TOTP 代码时出错",
    "totp_setup": "TOTP 设置",
    "scan_qr_code": "请使用验证器应用扫描此二维码。",
    "enter_totp_confirmation": "输入应用生成的 6 位验证码以确认设置：",
    "confirm": "确认",
    "please_enter_valid_code": "请输入有效的 6 位验证码。",
    "totp_enabled_successfully": "TOTP 启用成功。",
    "error_generating_recovery_code": "生成恢复代码时出错",
    "error_loading_qr_code": "加载二维码时出错。",
    "error_disabling_totp_setting": "禁用 TOTP 设置时出错",
    "user_management": "用户管理",
    "add_user": "添加用户",
    "remove_user": "删除用户",
    "user_permissions": "用户权限",
    "oidc_configuration": "OIDC 配置",
    "oidc_provider_url": "OIDC 提供者 URL",
    "oidc_client_id": "OIDC 客户端 ID",
    "oidc_client_secret": "OIDC 客户端密钥",
    "oidc_redirect_uri": "OIDC 重定向 URI",
    "global_totp_settings": "全局 TOTP 设置",
    "global_otpauth_url": "全局 OTPAuth URL",
    "login_options": "登录选项",
    "disable_login_form": "禁用登录表单",
    "disable_basic_http_auth": "禁用基本 HTTP 认证",
    "disable_oidc_login": "禁用 OIDC 登录",
    "save_settings": "保存设置",
    "at_least_one_login_method": "至少保留一种登录方式。",
    "settings_updated_successfully": "设置已成功更新。",
    "error_updating_settings": "更新设置时出错",
    "user_permissions_updated_successfully": "用户权限已成功更新。",
    "error_updating_permissions": "更新权限时出错",
    "no_users_found": "未找到用户。",
    "user_folder_only": "仅限用户文件夹",
    "read_only": "只读",
    "disable_upload": "禁用上传",
    "error_loading_users": "加载用户时出错",
    "save_permissions": "保存权限",
    "your_recovery_code": "您的恢复代码",
    "please_save_recovery_code": "请妥善保存此代码。此代码仅显示一次且只能使用一次。",
    "ok": "确定",
    "show": "显示",
    "items_per_page": "每页项目数",
    "columns": "列",
    "row_height": "行高",
    "api_docs": "API 文档",
    "show_folders_above_files": "在文件上方显示文件夹",
    "display": "显示",
    "create_file": "创建文件",
    "create_new_file": "创建新文件",
    "enter_file_name": "输入文件名",
    "newfile_placeholder": "新文件名",
    "file_created_successfully": "文件创建成功！",
    "error_creating_file": "创建文件时出错",
    "file_created": "文件创建成功！",
    "no_access_to_resource": "您无权访问此资源。",
    "can_share": "可分享",
    "bypass_ownership": "绕过所有权限制",
    "error_loading_user_grants": "加载用户授权时出错",
    "click_to_edit": "点击编辑",
    "folder_access": "文件夹访问"
  }

};

let currentLocale = 'en';

export function setLocale(locale) {
  currentLocale = locale;
}

export function t(key, placeholders) {
  const localeTranslations = translations[currentLocale] || {};
  let translation = localeTranslations[key] || key;
  if (placeholders) {
    Object.keys(placeholders).forEach(ph => {
      translation = translation.replace(`{${ph}}`, placeholders[ph]);
    });
  }
  return translation;
}

export function applyTranslations() {
  document.querySelectorAll('[data-i18n-key]').forEach(el => {
    el.innerText = t(el.getAttribute('data-i18n-key'));
  });
  document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
    el.setAttribute('placeholder', t(el.getAttribute('data-i18n-placeholder')));
  });
  document.querySelectorAll('[data-i18n-title]').forEach(el => {
    el.setAttribute('title', t(el.getAttribute('data-i18n-title')));
  });
}