mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
WebClient WIP: add support for localizations
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
370
static/locales/en/translation.json
Normal file
370
static/locales/en/translation.json
Normal file
@@ -0,0 +1,370 @@
|
||||
{
|
||||
"title": {
|
||||
"login": "Login",
|
||||
"share_login": "Share Login",
|
||||
"profile": "Profile",
|
||||
"change_password": "Change password",
|
||||
"files": "Files",
|
||||
"shares": "Shares",
|
||||
"add_share": "Add share",
|
||||
"update_share": "Update share",
|
||||
"two_factor_auth": "Two-factor authentication",
|
||||
"two_factor_auth_short": "2FA",
|
||||
"edit_file": "Edit file",
|
||||
"view_file": "View file",
|
||||
"recovery_password": "Password recovery",
|
||||
"reset_password": "Password reset",
|
||||
"shared_files": "Shared files",
|
||||
"upload_to_share": "Upload to share",
|
||||
"download_shared_file": "Download shared file",
|
||||
"share_access_error": "Unable to access the share",
|
||||
"invalid_auth_request": "Invalid authentication request",
|
||||
"error429": "Too Many Requests",
|
||||
"error403": "Forbidden",
|
||||
"error400": "Bad Request",
|
||||
"error416": "Requested Range Not Satisfiable",
|
||||
"error500": "Internal Server Error",
|
||||
"errorPDF": "Unable to show PDF file",
|
||||
"error_editor": "Cannot open file editor"
|
||||
},
|
||||
"login": {
|
||||
"username": "Username",
|
||||
"password": "Password",
|
||||
"your_username": "Your username",
|
||||
"forgot_password": "Forgot Password?",
|
||||
"forgot_password_msg": "Enter your account username below, you will receive a password reset code by email.",
|
||||
"send_reset_code": "Send Reset Code",
|
||||
"signin": "Sign in",
|
||||
"signin_openid": "Sign in with OpenID",
|
||||
"signout": "Sign out",
|
||||
"auth_code": "Authentication code",
|
||||
"two_factor_help": "Open the two-factor authentication app on your device to view your authentication code and verify your identity.",
|
||||
"two_factor_msg": "Enter a two-factor recovery code",
|
||||
"recovery_code": "Recovery code",
|
||||
"recovery_code_msg": "You can enter one of your recovery codes in case you lost access to your mobile device.",
|
||||
"reset_password": "Reset Password",
|
||||
"reset_pwd_msg": "Check your email for the confirmation code",
|
||||
"reset_submit": "Update Password and Sign in",
|
||||
"confirm_code": "Confirmation code",
|
||||
"reset_pwd_forbidden": "You are not allowed to reset your password",
|
||||
"reset_pwd_no_email": "Your account does not have an email address, it is not possible to reset your password by sending an email verification code",
|
||||
"reset_pwd_send_email_err": "Unable to send confirmation code via email",
|
||||
"reset_pwd_err_generic": "Unexpected error while resetting password",
|
||||
"reset_ok_login_error": "The password reset completed successfully but an unexpected error occurred while signing in",
|
||||
"ip_not_allowed": "Login is not allowed from this IP address",
|
||||
"two_factor_required": "Two-factor authentication is required, set it up"
|
||||
},
|
||||
"theme": {
|
||||
"light": "Light",
|
||||
"dark": "Dark",
|
||||
"system": "Auto"
|
||||
},
|
||||
"general": {
|
||||
"invalid_auth_request": "The authentication request does not meet security requirements",
|
||||
"error400": "The received request is not valid",
|
||||
"error403": "You do not have the required permissions",
|
||||
"error404": "The requested resource does not exist",
|
||||
"error416": "The requested file fragment could not be returned",
|
||||
"error429": "Rate limit exceeded",
|
||||
"error500": "The server is unable to fulfill your request",
|
||||
"errorPDF": "This file does not look like a PDF",
|
||||
"error_edit_dir": "Cannot edit a directory",
|
||||
"error_edit_size": "The file size exceeds the maximum allowed size",
|
||||
"invalid_form": "Invalid form",
|
||||
"invalid_credentials": "Invalid credentials",
|
||||
"invalid_csrf": "The form token is not valid",
|
||||
"invalid_token": "Invalid permissions",
|
||||
"confirm_logout": "Are you sure you want to sign out?",
|
||||
"wait": "Please wait...",
|
||||
"or": "or",
|
||||
"ok": "OK",
|
||||
"none": "None",
|
||||
"cancel": "Cancel",
|
||||
"submit": "Save",
|
||||
"back": "Back",
|
||||
"add": "Add",
|
||||
"enable": "Enable",
|
||||
"disable": "Disable",
|
||||
"close": "Close",
|
||||
"search": "Search",
|
||||
"configuration": "Configuration",
|
||||
"config_saved": "Configuration saved",
|
||||
"rename": "Rename",
|
||||
"confirm": "Confirm",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"delete_confirm": "Do you want to delete \"{{- name}}\"? This action is irreversible",
|
||||
"delete_confirm_generic": "Do you want to delete the selected item? This action is irreversible",
|
||||
"delete_multi_confirm": "Do you want to delete the selected items? This action is irreversible",
|
||||
"delete_error_generic": "Unable to delete the selected item",
|
||||
"delete_error_403": "$t(general.delete_error_generic). $t(general.error403)",
|
||||
"delete_error_404": "$t(general.delete_error_generic). $t(general.error404)",
|
||||
"loading": "Loading...",
|
||||
"name": "Name",
|
||||
"size": "Size",
|
||||
"last_modified": "Last Modified",
|
||||
"info": "Info",
|
||||
"datetime": "{{- val, datetime}}",
|
||||
"selected_items_one": "{{count}} item selected",
|
||||
"selected_items_other": "{{count}} items selected",
|
||||
"name_required": "Name is required",
|
||||
"name_different": "The new name must be different from the current name",
|
||||
"html5_media_not_supported": "Your browser does not support HTML5 audio/video.",
|
||||
"choose_target_folder": "Choose target folder",
|
||||
"source_name": "Source name",
|
||||
"target_folder": "Target folder",
|
||||
"dest_name": "Destination name",
|
||||
"my_profile": "My profile",
|
||||
"description": "Description",
|
||||
"email": "Email",
|
||||
"api_key_auth": "API key authentication",
|
||||
"api_key_auth_help": "Allow to impersonate yourself, in REST API, using an API key",
|
||||
"pub_keys": "Public keys",
|
||||
"pub_key_placeholder": "Paste your public key here",
|
||||
"verify": "Verify",
|
||||
"problems": "Having problems?",
|
||||
"generate": "Generate",
|
||||
"view": "View",
|
||||
"allowed_ip_mask": "Allowed IP/Mask",
|
||||
"allowed_ip_mask_help": "Comma separated IP/Mask in CIDR format, for example \"192.168.1.0/24,10.8.0.100/32\"",
|
||||
"allowed_ip_mask_invalid": "Invalid allowed IP/Mask",
|
||||
"username_required": "The username is required",
|
||||
"foldername_required": "The folder name is required",
|
||||
"err_user": "Unable to validate your user",
|
||||
"err_protocol_forbidden": "HTTP protocol is not allowed for your user",
|
||||
"pwd_login_forbidden": "The password login method is not allowed for your user",
|
||||
"ip_forbidden": "Login not allowed from this IP address",
|
||||
"email_invalid": "The email address is invalid",
|
||||
"err_password_complexity": "The password provided does not meet the complexity requirements",
|
||||
"no_oidc_feature": "This feature is not available if you are logged in with OpenID",
|
||||
"connection_forbidden": "You are not allowed to connect",
|
||||
"no_permissions": "You are not allowed to change anything",
|
||||
"path_invalid": "Invalid path",
|
||||
"err_quota_read": "Read denied due to quota limit",
|
||||
"profile_updated": "Your profile has been successfully updated",
|
||||
"share_ok": "Share access successful, you can now use your link",
|
||||
"qr_code": "QR Code"
|
||||
},
|
||||
"fs": {
|
||||
"view_file": "View file \"{{- path}}\"",
|
||||
"edit_file": "Edit file \"{{- path}}\"",
|
||||
"new_folder": "New Folder",
|
||||
"select_across_pages": "Select across pages",
|
||||
"actions": "Actions",
|
||||
"download": "Download",
|
||||
"download_ready": "Your download is ready",
|
||||
"move_copy": "Move or copy",
|
||||
"share": "Share",
|
||||
"home": "Home",
|
||||
"create_folder_msg": "Folder name",
|
||||
"no_more_subfolders": "No more subfolders in here",
|
||||
"no_files_folders": "No files or folders",
|
||||
"invalid_name": "File or folder names cannot contain \"/\"",
|
||||
"folder_name_required": "Folder name is required",
|
||||
"deleting": "Delete {{idx}}/{{total}}: {{- name}}",
|
||||
"copying": "Copy {{idx}}/{{total}}: {{- name}}",
|
||||
"moving": "Move {{idx}}/{{total}}: {{- name}}",
|
||||
"uploading": "Upload {{idx}}/{{total}}: {{- name}}",
|
||||
"err_403": "Permission denied",
|
||||
"err_429": "Too many concurrent requests",
|
||||
"err_generic": "Unable to access the requested resource",
|
||||
"err_validation": "Invalid filesystem configuration",
|
||||
"dir_list": {
|
||||
"err_generic": "Failed to get directory listing",
|
||||
"err_403": "$t(fs.dir_list.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.dir_list.err_generic). $t(fs.err_429)",
|
||||
"err_user": "$t(fs.dir_list.err_generic). $t(general.err_user)"
|
||||
},
|
||||
"create_dir": {
|
||||
"err_generic": "Error creating new folder",
|
||||
"err_403": "$t(fs.create_dir.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.create_dir.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"save": {
|
||||
"err_generic": "Error saving file",
|
||||
"err_403": "$t(fs.create_dir.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.create_dir.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"delete": {
|
||||
"err_generic": "Unable to delete \"{{- name}}\"",
|
||||
"err_403": "$t(fs.delete.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.delete.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"delete_multi": {
|
||||
"err_generic_partial": "Not all the selected items have been deleted, please reload the page",
|
||||
"err_generic": "Unable to delete the selected items",
|
||||
"err_403_partial": "$t(fs.delete_multi.err_generic_partial). $t(fs.err_403)",
|
||||
"err_429_partial": "$t(fs.delete_multi.err_generic_partial). $t(fs.err_429)",
|
||||
"err_403": "$t(fs.delete_multi.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.delete_multi.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"copy": {
|
||||
"msg": "Copy",
|
||||
"err_generic": "Error copying files/directories",
|
||||
"err_403": "$t(fs.copy.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.copy.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"move": {
|
||||
"msg": "Move",
|
||||
"err_generic": "Error moving files/directories",
|
||||
"err_403": "$t(fs.move.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.move.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"rename": {
|
||||
"new_name": "New name",
|
||||
"err_generic": "Unable to rename \"{{- name}}\"",
|
||||
"err_403": "$t(fs.rename.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.rename.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"upload": {
|
||||
"text": "Upload Files",
|
||||
"success": "Files uploaded successfully",
|
||||
"message": "Drop files here or click to upload.",
|
||||
"err_generic": "Error uploading files",
|
||||
"err_403": "$t(fs.upload.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.upload.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"quota_usage": {
|
||||
"title": "Quota usage",
|
||||
"disk": "Disk quota",
|
||||
"size": "Size: {{- val}}",
|
||||
"size_percentage": "Size: {{- val}} ({{percentage}}%)",
|
||||
"files": "Files: {{- num}}",
|
||||
"files_percentage": "Files: {{- val}} ({{percentage}}%)",
|
||||
"transfer": "Transfer quota",
|
||||
"total": "Total: {{- val}}",
|
||||
"total_percentage": "Total: {{- val}} ({{percentage}}%)",
|
||||
"uploads": "Uploads: {{- val}}",
|
||||
"uploads_percentage": "Uploads: {{- val}} ({{percentage}}%)",
|
||||
"downloads": "Downloads: {{- val}}",
|
||||
"downloads_percentage": "Downloads: {{- val}} ({{percentage}}%)"
|
||||
}
|
||||
},
|
||||
"datatable": {
|
||||
"info": "Showing _START_ to _END_ of _TOTAL_ records",
|
||||
"info_empty": "Showing no record",
|
||||
"info_filtered": "(filtered from _MAX_ total records)",
|
||||
"processing": "Processing..."
|
||||
},
|
||||
"editor": {
|
||||
"keybinding": "Editor keybindings",
|
||||
"search": "Open search panel",
|
||||
"goto": "Jump to line",
|
||||
"indent_more": "Indent more",
|
||||
"indent_less": "Indent less"
|
||||
},
|
||||
"2fa": {
|
||||
"title": "Two-factor authentication using Authenticator apps",
|
||||
"msg_enabled": "Two-factor authentication is enabled",
|
||||
"msg_disabled": "Secure Your Account",
|
||||
"msg_info": "Two-factor authentication adds an extra layer of security to your account. To log in you'll need to provide an additional authentication code.",
|
||||
"require_for": "Require 2FA for",
|
||||
"generate": "Generate new secret",
|
||||
"recovery_codes": "Recovery codes",
|
||||
"new_recovery_codes": "New recovery codes",
|
||||
"recovery_codes_msg1": "Recovery codes are a set of one time use codes that can be used in place of the authentication code to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate two-factor auth configuration.",
|
||||
"recovery_codes_msg2": "To keep your account secure, don't share or distribute your recovery codes. We recommend saving them with a secure password manager.",
|
||||
"recovery_codes_msg3": "If you generate new recovery codes, you automatically invalidate old ones.",
|
||||
"info_title": "Learn about two-factor authentication",
|
||||
"info1": "SSH protocol (SFTP/SCP/SSH commands) will ask for the passcode if the client uses keyboard interactive authentication.",
|
||||
"info2": "HTTP protocol means Web UI and REST APIs. Web UI will ask for the passcode using a specific page. For REST API you have to add the passcode using an HTTP header.",
|
||||
"info3": "FTP has no standard way to support two-factor authentication, if you enable the FTP support, you have to add the TOTP passcode after the password. For example if your password is \"password\" and your one time passcode is \"123456\" you have to use \"password123456\" as password.",
|
||||
"info4": "WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused.",
|
||||
"setup_title": "Set up two-factor authentication",
|
||||
"setup_msg": "Use your preferred Authenticator App (e.g. Microsoft Authenticator, Google Authenticator, Authy, 1Password etc. ) to scan the QR code. It will generate an authentication code for you to enter below.",
|
||||
"setup_help": "If you have trouble using the QR code, select manual entry on your app, and enter the code:",
|
||||
"disable_question": "Do you want to disable two-factor authentication?",
|
||||
"generate_question": "Do you want to generate a new secret and invalidate the previous one? Any registered Authenticator App will stop working",
|
||||
"disabled": "Two-factor authentication is disabled",
|
||||
"recovery_codes_gen_err": "Failed to generate new recovery codes",
|
||||
"recovery_codes_get_err": "Unable to obtain recovery codes",
|
||||
"auth_code_invalid": "Failed to validate the provided authentication code",
|
||||
"auth_secret_gen_err": "Failed to generate authentication secret",
|
||||
"save_err": "Failed to save configuration",
|
||||
"save_err_proto": "$t(2fa.save_err). Make sure the protocols enabled comply with company policy",
|
||||
"auth_code_required": "The authentication code is required",
|
||||
"no_protocol": "Please select at least a protocol"
|
||||
},
|
||||
"share": {
|
||||
"scope": "Scope",
|
||||
"scope_read": "Read",
|
||||
"scope_write": "Write",
|
||||
"scope_read_write": "Read/Write",
|
||||
"scope_help": "For scope \"Write\" and \"Read/Write\" you have to define a single path and it must be a directory",
|
||||
"paths": "Paths",
|
||||
"path_help": "file or directory path, i.e. /dir or /dir/file.txt",
|
||||
"password_help": "If set the share will be password-protected",
|
||||
"expiration": "Expiration",
|
||||
"expiration_help": "Pick an expiration date",
|
||||
"max_tokens": "Max tokens",
|
||||
"max_tokens_help": "Maximum number of times this share can be accessed. 0 means no limit",
|
||||
"view_manage": "View and manage shares",
|
||||
"no_share": "No sharing",
|
||||
"password_protected": "Password protected.",
|
||||
"expiration_date": "Expiration: {{- val, datetime}}. ",
|
||||
"last_use": "Last use: {{- val, datetime}}. ",
|
||||
"usage": "Usage: {{used}}/{{total}}. ",
|
||||
"used_tokens": "Used token: {{used}}. ",
|
||||
"scope_invalid": "Invalid scope",
|
||||
"max_tokens_invalid": "Invalid max tokens",
|
||||
"expiration_invalid": "Invalid expiration",
|
||||
"err_no_password": "You are not allowed to share files/folders without password",
|
||||
"expiration_out_of_range": "Set an expiration date and ensure it complies with company policy, e.g. is not too far in the future",
|
||||
"generic": "Unexpected error saving share",
|
||||
"path_required": "At least a path is required",
|
||||
"path_write_scope": "The write scope requires exactly one path",
|
||||
"nested_paths": "Paths cannot be nested",
|
||||
"expiration_past": "The expiration date must be in the future",
|
||||
"usage_exceed": "Maximum sharing usage exceeded",
|
||||
"expired": "Sharing has expired",
|
||||
"browsable_multiple_paths": "A share with multiple paths is not browsable",
|
||||
"browsable_non_dir": "The share is not a directory so it is not browsable"
|
||||
},
|
||||
"select2": {
|
||||
"no_results": "No results found",
|
||||
"searching": "Searching...",
|
||||
"removeall": "Remove all items",
|
||||
"remove": "Remove item"
|
||||
},
|
||||
"change_pwd": {
|
||||
"info": "Enter your current password, for security reasons, and then your new password twice, to verify that you have written it correctly. You will be logged out after changing your password",
|
||||
"current": "Current password",
|
||||
"new": "New password",
|
||||
"confirm": "Confirm password",
|
||||
"save": "Change my password",
|
||||
"required_fields": "Please provide the current password and the new one two times",
|
||||
"no_match": "The two password fields do not match",
|
||||
"no_different": "The new password must be different from the current one",
|
||||
"current_no_match": "Current password does not match",
|
||||
"generic": "Unexpected error while changing password",
|
||||
"required": "Password change is required. Set a new password to continue using your account"
|
||||
},
|
||||
"user": {
|
||||
"username_reserved": "The specified username is reserved",
|
||||
"username_invalid": "The specified username is not valid, the following characters are allowed: a-zA-Z0-9-_.~",
|
||||
"home_required": "The home directory is mandatory",
|
||||
"home_invalid": "The home directory must be an absolute path",
|
||||
"pub_key_invalid": "Invalid public key",
|
||||
"err_primary_group": "Only one primary group is allowed",
|
||||
"err_duplicate_group": "Duplicate groups detected",
|
||||
"no_permissions": "Directories permissions are mandatory",
|
||||
"no_root_permissions": "Home directory permissions are required",
|
||||
"err_permissions_generic": "Invalid permissions: Make sure you use valid absolute paths",
|
||||
"2fa_invalid": "Invalid configuration for two-factor authentication",
|
||||
"recovery_codes_invalid": "Invalid recovery codes",
|
||||
"folder_path_required": "The virtual folder mount path is required",
|
||||
"folder_duplicated": "Duplicated virtual folders detected",
|
||||
"folder_overlapped": "Overlapping virtual folders detected",
|
||||
"folder_quota_size_invalid": "The quota as size of virtual folders must be greater than or equal to -1",
|
||||
"folder_quota_file_invalid": "The quota as files of virtual folders must be greater than or equal to -1",
|
||||
"folder_quota_invalid": "Quotas as size and as number of files of virtual folders must be both -1 or greater or equal than zero",
|
||||
"ip_filters_invalid": "Invalid IP filters, make sure they respect CIDR notation, for example 192.168.1.0/24",
|
||||
"src_bw_limits_invalid": "Invalid per-source bandwidth speed limits",
|
||||
"share_expiration_invalid": "The expiration for shares must be greater than or equal to the defined default value",
|
||||
"file_pattern_path_invalid": "File name pattern filter paths must be absolute",
|
||||
"file_pattern_duplicated": "Duplicated file name pattern filters detected",
|
||||
"file_pattern_invalid": "Invalid file name pattern filters",
|
||||
"disable_active_2fa": "Two-factor authentication cannot be disabled for a user with an active configuration",
|
||||
"pwd_change_conflict": "It is not possible to request a password change and at the same time prevent the password from being changed"
|
||||
}
|
||||
}
|
||||
370
static/locales/it/translation.json
Normal file
370
static/locales/it/translation.json
Normal file
@@ -0,0 +1,370 @@
|
||||
{
|
||||
"title": {
|
||||
"login": "Accedi",
|
||||
"share_login": "Accedi alla condivisione",
|
||||
"profile": "Profilo",
|
||||
"change_password": "Cambio password",
|
||||
"files": "File",
|
||||
"shares": "Condivisioni",
|
||||
"add_share": "Aggiungi condivisione",
|
||||
"update_share": "Modifica condivisione",
|
||||
"two_factor_auth": "Autenticazione a due fattori",
|
||||
"two_factor_auth_short": "2FA",
|
||||
"edit_file": "Modifica file",
|
||||
"view_file": "Visualizza file",
|
||||
"recovery_password": "Recupero password",
|
||||
"reset_password": "Reimpostazione password",
|
||||
"shared_files": "File condivisi",
|
||||
"upload_to_share": "Carica nella condivisione",
|
||||
"download_shared_file": "Scarica file condiviso",
|
||||
"share_access_error": "Impossibile accedere alla condivisione",
|
||||
"invalid_auth_request": "Richiesta di autenticazione non valida",
|
||||
"error429": "Troppe richieste",
|
||||
"error403": "Non permesso",
|
||||
"error400": "Richiesta non valida",
|
||||
"error416": "Impossibile tornare l'intervallo richiesto",
|
||||
"error500": "Errore interno del server",
|
||||
"errorPDF": "Impossibile mostrare il file PDF",
|
||||
"error_editor": "Impossibile aprire l'editor di file"
|
||||
},
|
||||
"login": {
|
||||
"username": "Nome utente",
|
||||
"your_username": "Il tuo nome utente",
|
||||
"password": "Password",
|
||||
"forgot_password": "Password dimenticata?",
|
||||
"forgot_password_msg": "Inserisci il nome utente del tuo account qui sotto, riceverai un codice di reimpostazione della password via e-mail.",
|
||||
"send_reset_code": "Invia codice di ripristino",
|
||||
"signin": "Accedi",
|
||||
"signin_openid": "Accedi con OpenID",
|
||||
"signout": "Esci",
|
||||
"auth_code": "Codice di autenticazione",
|
||||
"two_factor_help": "Apri l'app di autenticazione a due fattori sul tuo dispositivo per visualizzare il tuo codice di autenticazione e verificare la tua identità.",
|
||||
"two_factor_msg": "Inserisci un codice di ripristino per l'autenticazione a due fattori",
|
||||
"recovery_code": "Codice di ripristino",
|
||||
"recovery_code_msg": "Puoi inserire uno dei tuoi codici di ripristino nel caso in cui hai perso l'accesso al tuo dispositivo mobile.",
|
||||
"reset_password": "Reimposta password",
|
||||
"reset_pwd_msg": "Controlla la tua email per il codice di conferma",
|
||||
"reset_submit": "Aggiorna password e accedi",
|
||||
"confirm_code": "Codice di conferma",
|
||||
"reset_pwd_forbidden": "Non ti è consentito reimpostare la password",
|
||||
"reset_pwd_no_email": "Il tuo account non ha un indirizzo email, non è possibile reimpostare la password inviando un codice di verifica via email",
|
||||
"reset_pwd_send_email_err": "Errore nell'invio del codice di conferma via e-mail",
|
||||
"reset_pwd_err_generic": "Errore imprevisto durante la reimpostazione della password",
|
||||
"reset_ok_login_error": "La reimpostazione della password è stata completata correttamente ma si è verificato un errore imprevisto durante l'accesso",
|
||||
"ip_not_allowed": "L'accesso non è consentito da questo indirizzo IP",
|
||||
"two_factor_required": "È richiesta l'autenticazione a due fattori, configurala"
|
||||
},
|
||||
"theme": {
|
||||
"light": "Chiaro",
|
||||
"dark": "Scuro",
|
||||
"system": "Auto"
|
||||
},
|
||||
"general": {
|
||||
"invalid_auth_request": "La richiesta di autenticazione non soddisfa i requisiti di sicurezza",
|
||||
"error400": "La richiesta ricevuta non è valida",
|
||||
"error403": "Non si dispone delle autorizzazioni richieste",
|
||||
"error404": "La risorsa richiesta non esiste",
|
||||
"error416": "Il frammento di file richiesto non può essere restituito",
|
||||
"error429": "Limite di richieste per unità di tempo superato",
|
||||
"error500": "Il server non è in grado di soddisfare la tua richiesta",
|
||||
"errorPDF": "Questo file non sembra un PDF",
|
||||
"error_edit_dir": "Impossibile modificare una cartella",
|
||||
"error_edit_size": "La dimensione del file supera la dimensione massima consentita",
|
||||
"invalid_form": "Modulo non valido",
|
||||
"invalid_credentials": "Credenziali non valide",
|
||||
"invalid_csrf": "Il token del modulo non è valido",
|
||||
"invalid_token": "Permessi non validi",
|
||||
"confirm_logout": "Sei sicuro di volerti disconnettere?",
|
||||
"wait": "Attendere prego...",
|
||||
"or": "o",
|
||||
"ok": "OK",
|
||||
"none": "Nessuna",
|
||||
"cancel": "Annulla",
|
||||
"submit": "Salva",
|
||||
"back": "Indietro",
|
||||
"add": "Aggiungi",
|
||||
"enable": "Abilita",
|
||||
"disable": "Disabilita",
|
||||
"close": "Chiudi",
|
||||
"search": "Cerca",
|
||||
"configuration": "Configurazione",
|
||||
"config_saved": "Configurazione salvata",
|
||||
"rename": "Rinomina",
|
||||
"confirm": "Conferma",
|
||||
"edit": "Modifica",
|
||||
"delete": "Elimina",
|
||||
"delete_confirm": "Vuoi eliminare \"{{- name}}\"? Questa azione è irreversibile",
|
||||
"delete_confirm_generic": "Vuoi eliminare l'elemento selezionato? Questa azione è irreversibile",
|
||||
"delete_multi_confirm": "Vuoi eliminare gli elementi selezionati? Questa azione è irreversibile",
|
||||
"delete_error_generic": "Impossibile eliminare l'elemento selezionato",
|
||||
"delete_error_403": "$t(general.delete_error_generic). $t(general.error403)",
|
||||
"delete_error_404": "$t(general.delete_error_generic). $t(general.error404)",
|
||||
"loading": "Caricamento...",
|
||||
"name": "Nome",
|
||||
"size": "Dimensione",
|
||||
"last_modified": "Ultima modifica",
|
||||
"info": "Info",
|
||||
"datetime": "{{- val, datetime}}",
|
||||
"selected_items_one": "{{count}} elemento selezionato",
|
||||
"selected_items_other": "{{count}} elementi selezionati",
|
||||
"name_required": "Il nome è obbligatorio",
|
||||
"name_different": "Il nuovo nome deve essere diverso dal nome attuale",
|
||||
"html5_media_not_supported": "Il tuo browser non supporta audio/video HTML5.",
|
||||
"choose_target_folder": "Scegli la cartella di destinazione",
|
||||
"source_name": "Nome di origine",
|
||||
"target_folder": "Cartella di destinazione",
|
||||
"dest_name": "Nome di destinazione",
|
||||
"my_profile": "Il mio profilo",
|
||||
"description": "Descrizione",
|
||||
"email": "Email",
|
||||
"api_key_auth": "Autenticazione mediante chiave API",
|
||||
"api_key_auth_help": "Permette di imperosare te stesso, nelle API REST, mediante una chiave API",
|
||||
"pub_keys": "Chiavi pubbliche",
|
||||
"pub_key_placeholder": "Incolla qui la tua chiave pubblica",
|
||||
"verify": "Verifica",
|
||||
"problems": "Hai problemi?",
|
||||
"generate": "Genera",
|
||||
"view": "Visualizza",
|
||||
"allowed_ip_mask": "IP/Reti permesse",
|
||||
"allowed_ip_mask_help": "IP/reti separate da virgola in formato CIDR, ad esempio \"192.168.1.0/24,10.8.0.100/32\"",
|
||||
"allowed_ip_mask_invalid": "IP/reti permesse non valide",
|
||||
"username_required": "Il nome utente è obbligatorio",
|
||||
"foldername_required": "Il nome della cartella è obbligatorio",
|
||||
"err_user": "Errore validazione utente",
|
||||
"err_protocol_forbidden": "Il protocollo HTTP non è consentito per il tuo utente",
|
||||
"pwd_login_forbidden": "Il metodo di accesso tramite password non è consentito per il tuo utente",
|
||||
"ip_forbidden": "Accesso non consentito da questo indirizzo IP",
|
||||
"email_invalid": "L'indirizzo e-mail non è valido",
|
||||
"err_password_complexity": "La password fornita non soddisfa i requisiti di complessità",
|
||||
"no_oidc_feature": "Questa funzionalità non è disponibile se hai effettuato l'accesso con OpenID",
|
||||
"connection_forbidden": "Non ti è consentito connetterti",
|
||||
"no_permissions": "Non ti è consentito cambiare nulla",
|
||||
"path_invalid": "Percorso non valido",
|
||||
"err_quota_read": "Lettura negata a causa del limite di quota",
|
||||
"profile_updated": "Il tuo profilo è stato aggiornato con successo",
|
||||
"share_ok": "Accesso alla condivisione riuscito, ora puoi utilizzare il tuo collegamento",
|
||||
"qr_code": "Codice QR"
|
||||
},
|
||||
"fs": {
|
||||
"view_file": "Visualizza file \"{{- path}}\"",
|
||||
"edit_file": "Modifica file \"{{- path}}\"",
|
||||
"new_folder": "Nuova cartella",
|
||||
"select_across_pages": "Seleziona tra le pagine",
|
||||
"actions": "Azioni",
|
||||
"download": "Scarica",
|
||||
"download_ready": "Il tuo download è pronto",
|
||||
"move_copy": "Sposta o copia",
|
||||
"share": "Condividi",
|
||||
"home": "Home",
|
||||
"create_folder_msg": "Nome cartella",
|
||||
"no_more_subfolders": "Non ci sono più sottocartelle qui",
|
||||
"no_files_folders": "Nessun file o cartella",
|
||||
"invalid_name": "I nomi di file o cartelle non possono contenere \"/\"",
|
||||
"folder_name_required": "Il nome della cartella è obbligatorio",
|
||||
"deleting": "Eliminazione {{idx}}/{{total}}: {{- name}}",
|
||||
"copying": "Copia {{idx}}/{{total}}: {{- name}}",
|
||||
"moving": "Spostamento {{idx}}/{{total}}: {{- name}}",
|
||||
"uploading": "Caricamento {{idx}}/{{total}}: {{- name}}",
|
||||
"err_403": "Non si dispone delle autorizzazioni richieste",
|
||||
"err_429": "Troppe richieste contemporanee",
|
||||
"err_generic": "Impossibile accedere alla risorsa richiesta",
|
||||
"err_validation": "Configurazione del filesystem non valida",
|
||||
"dir_list": {
|
||||
"err_generic": "Impossibile ottenere l'elenco della directory",
|
||||
"err_403": "$t(fs.dir_list.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.dir_list.err_generic). $t(fs.err_429)",
|
||||
"err_user": "$t(fs.dir_list.err_generic). $t(general.err_user)"
|
||||
},
|
||||
"create_dir": {
|
||||
"err_generic": "Errore durante la creazione delle nuova cartella",
|
||||
"err_403": "$t(fs.create_dir.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.create_dir.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"save": {
|
||||
"err_generic": "Errore durante il salvataggio del file",
|
||||
"err_403": "$t(fs.create_dir.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.create_dir.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"delete": {
|
||||
"err_generic": "Impossibile eliminare \"{{- name}}\"",
|
||||
"err_403": "$t(fs.delete.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.delete.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"delete_multi": {
|
||||
"err_generic_partial": "Non tutti gli elementi selezionati sono stati eliminati, ricarica la pagina",
|
||||
"err_generic": "Impossibile eliminare gli elementi selezionati",
|
||||
"err_403_partial": "$t(fs.delete_multi.err_generic_partial). $t(fs.err_403)",
|
||||
"err_429_partial": "$t(fs.delete_multi.err_generic_partial). $t(fs.err_429)",
|
||||
"err_403": "$t(fs.delete_multi.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.delete_multi.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"copy": {
|
||||
"msg": "Copia",
|
||||
"err_generic": "Errore copia file/cartelle",
|
||||
"err_403": "$t(fs.copy.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.copy.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"move": {
|
||||
"msg": "Sposta",
|
||||
"err_generic": "Errore nello spostamento di file/directory",
|
||||
"err_403": "$t(fs.move.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.move.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"rename": {
|
||||
"new_name": "Nuovo nome",
|
||||
"err_generic": "Impossibile rinominare \"{{- name}}\"",
|
||||
"err_403": "$t(fs.rename.err_generic): $t(fs.err_403)",
|
||||
"err_429": "$t(fs.rename.err_generic): $t(fs.err_429)"
|
||||
},
|
||||
"upload": {
|
||||
"text": "Carica file",
|
||||
"success": "File caricati correttamente",
|
||||
"message": "Rilascia i file qui o fai clic per caricarli.",
|
||||
"err_generic": "Errore caricamento file",
|
||||
"err_403": "$t(fs.upload.err_generic). $t(fs.err_403)",
|
||||
"err_429": "$t(fs.upload.err_generic). $t(fs.err_429)"
|
||||
},
|
||||
"quota_usage": {
|
||||
"title": "Utilizzo quota",
|
||||
"disk": "Quota disco",
|
||||
"size": "Dimensione: {{- val}}",
|
||||
"size_percentage": "Dimensione: {{- val}} ({{percentage}}%)",
|
||||
"files": "File: {{- val}}",
|
||||
"files_percentage": "File: {{- val}} ({{percentage}}%)",
|
||||
"transfer": "Quota trasferimenti",
|
||||
"total": "Totale: {{- val}}",
|
||||
"total_percentage": "Totale: {{- val}} ({{percentage}}%)",
|
||||
"uploads": "Caricamenti: {{- val}}",
|
||||
"uploads_percentage": "Caricamenti: {{- val}} ({{percentage}}%)",
|
||||
"downloads": "Download: {{- val}}",
|
||||
"downloads_percentage": "Download: {{- val}} ({{percentage}}%)"
|
||||
}
|
||||
},
|
||||
"datatable": {
|
||||
"info": "Risultati da _START_ a _END_ di _TOTAL_ elementi",
|
||||
"info_empty": "Nessun risultato",
|
||||
"info_filtered": "(filtrati da _MAX_ elementi totali)",
|
||||
"processing": "Elaborazione..."
|
||||
},
|
||||
"editor": {
|
||||
"keybinding": "Combinazioni di tasti dell'editor",
|
||||
"search": "Apre pannello di ricerca",
|
||||
"goto": "Vai a linea",
|
||||
"indent_more": "Aumenta indentazione",
|
||||
"indent_less": "Diminuisci indentazione"
|
||||
},
|
||||
"2fa": {
|
||||
"title": "Autenticazione a due fattori utilizzando App di autenticazione",
|
||||
"msg_enabled": "L'autenticazione a due fattori è abilitata",
|
||||
"msg_disabled": "Metti il tuo account in sicurezza",
|
||||
"msg_info": "L'autenticazione a due fattori aggiunge un ulteriore livello di sicurezza al tuo account. Per accedere dovrai fornire un ulteriore codice di autenticazione.",
|
||||
"require_for": "Richiedi 2FA per",
|
||||
"generate": "Genera nuovo segreto",
|
||||
"recovery_codes": "Codici di ripristino",
|
||||
"new_recovery_codes": "Nuovi codici di ripristino",
|
||||
"recovery_codes_msg1": "I codici di ripristino sono un insieme di codici monouso che possono essere utilizzati al posto del codice di autenticazione per accedere all'interfaccia utente Web. Puoi utilizzarli se perdi l'accesso al tuo telefono per accedere al tuo account e disabilitare o rigenerare la configurazione dell'autenticazione a due fattori.",
|
||||
"recovery_codes_msg2": "Per mantenere sicuro il tuo account, non condividere o distribuire i tuoi codici di ripristino. Ti consigliamo di salvarli con un gestore di password sicuro.",
|
||||
"recovery_codes_msg3": "Se generi nuovi codici di ripristino, invalidi automaticamente quelli vecchi.",
|
||||
"info_title": "Ulteriori informazioni sull'autenticazione a due fattori",
|
||||
"info1": "Il protocollo SSH (comandi SFTP/SCP/SSH) richiederà il passcode se il client utilizza l'autenticazione interattiva da tastiera.",
|
||||
"info2": "Per protocollo HTTP si intende l'interfaccia utente Web e le API REST. L'interfaccia utente Web richiederà il passcode utilizzando una pagina specifica. Per l'API REST devi aggiungere il passcode utilizzando un'intestazione HTTP.",
|
||||
"info3": "FTP non ha un modo standard per supportare l'autenticazione a due fattori, se abiliti il supporto FTP, devi aggiungere il passcode TOTP dopo la password. Ad esempio, se la tua password è \"password\" e il tuo passcode monouso è \"123456\", devi utilizzare \"password123456\" come password.",
|
||||
"info4": "WebDAV non è supportato poiché ogni singola richiesta deve essere autenticata e un passcode non può essere riutilizzato.",
|
||||
"setup_title": "Configura l'autenticazione a due fattori",
|
||||
"setup_msg": "Utilizza la tua app di autenticazione preferita (ad esempio Microsoft Authenticator, Google Authenticator, Authy, 1Password ecc.) per scansionare il codice QR. Verrà generato un codice di autenticazione da inserire di seguito.",
|
||||
"setup_help": "Se hai problemi con l'utilizzo del codice QR, seleziona l'inserimento manuale sulla tua app e inserisci il codice:",
|
||||
"disable_question": "Vuoi disattivare l'autenticazione a due fattori?",
|
||||
"generate_question": "Vuoi generare un nuovo segreto e invalidare quello precedente? Qualsiasi app di autenticazione registrata smetterà di funzionare",
|
||||
"disabled": "L'autenticazione a due fattori è disabilitata",
|
||||
"recovery_codes_gen_err": "Impossibile generare nuovi codici di ripristino",
|
||||
"recovery_codes_get_err": "Impossibile ottenere i codici di ripristino",
|
||||
"auth_code_invalid": "Impossibile convalidare il codice di autenticazione fornito",
|
||||
"auth_secret_gen_err": "Impossibile generare il segreto di autenticazione",
|
||||
"save_err": "Impossibile salvare la configurazione",
|
||||
"save_err_proto": "$t(2fa.save_err). Assicurati che i protocolli abilitati siano conformi alla politica aziendale",
|
||||
"auth_code_required": "Il codice di autenticazione è obbligatorio",
|
||||
"no_protocol": "Seleziona almeno un protocollo"
|
||||
},
|
||||
"share": {
|
||||
"scope": "Ambito",
|
||||
"scope_read": "Lettura",
|
||||
"scope_write": "Scrittura",
|
||||
"scope_read_write": "Lettura/Scrittura",
|
||||
"scope_help": "Per gli ambiti \"Scrittura\" e \"Lettura/Scrittura\" devi definire un singolo percorso e deve essere una cartella",
|
||||
"paths": "Percorsi",
|
||||
"path_help": "percorso di un file o di una directory, ad esempio /dir o /dir/file.txt",
|
||||
"password_help": "Se impostata, la condivisione sarà protetta da password",
|
||||
"expiration": "Scadenza",
|
||||
"expiration_help": "Scegli una data di scadenza",
|
||||
"max_tokens": "Token massimi",
|
||||
"max_tokens_help": "Numero massimo di volte in cui è possibile accedere a questa condivisione. 0 significa nessun limite",
|
||||
"view_manage": "Visualizza e gestisci condivisioni",
|
||||
"no_share": "Nessuna condivisione",
|
||||
"password_protected": "Protetto da password.",
|
||||
"expiration_date": "Scadenza: {{- val, datetime}}. ",
|
||||
"last_use": "Ultimo utilizzo: {{- val, datetime}}. ",
|
||||
"usage": "Utilizzo: {{used}}/{{total}}. ",
|
||||
"used_tokens": "Token usati: {{used}}. ",
|
||||
"scope_invalid": "Ambito non valido",
|
||||
"max_tokens_invalid": "Token massimi non validi",
|
||||
"expiration_invalid": "Scadenza non valida",
|
||||
"err_no_password": "Non sei autorizzato a condividere file/cartelle senza password",
|
||||
"expiration_out_of_range": "Imposta una data di scadenza e assicurati che sia conforme alla politica aziendale, ad es. non è troppo lontan nel futuro",
|
||||
"generic": "Errore imprevisto durante il salvataggio della condivisione",
|
||||
"path_required": "È necessario almeno un percorso",
|
||||
"path_write_scope": "L'ambito di scrittura richiede esattamente un percorso",
|
||||
"nested_paths": "I percorsi non possono essere contenuti l'uno dentro l'altro",
|
||||
"expiration_past": "La data di scadenza deve essere futura",
|
||||
"usage_exceed": "Utilizzo massimo della condivisione superato",
|
||||
"expired": "La condivisione è scaduta",
|
||||
"browsable_multiple_paths": "Una condivisione con più percorsi non è navigabile",
|
||||
"browsable_non_dir": "La condivisione non è una directory quindi non è navigabile"
|
||||
},
|
||||
"select2": {
|
||||
"no_results": "Nessun risultato trovato",
|
||||
"searching": "Ricerca...",
|
||||
"removeall": "Rimuovi tutti gli elementi",
|
||||
"remove": "Rimuovi elemento"
|
||||
},
|
||||
"change_pwd": {
|
||||
"info": "Inserisci la password attuale, per ragioni di sicurezza, e poi la nuova password due volte, per verificare di averla scritta correttamente. Verrai disconnesso dopo aver modificato la tua password",
|
||||
"current": "Password attuale",
|
||||
"new": "Nuova password",
|
||||
"confirm": "Conferma nuova password",
|
||||
"save": "Modifica la mia password",
|
||||
"required_fields": "Si prega di fornire la password attuale e quella nuova due volte",
|
||||
"no_match": "I due campi della password non corrispondono",
|
||||
"no_different": "La nuova password deve essere diversa da quella attuale",
|
||||
"current_no_match": "La password attuale non corrisponde",
|
||||
"generic": "Errore imprevisto durante la modifica della password",
|
||||
"required": "È richiesta la modifica della password. Imposta una nuova password per continuare a utilizzare il tuo account"
|
||||
},
|
||||
"user": {
|
||||
"username_reserved": "Il nome utente specificato è riservato",
|
||||
"username_invalid": "Il nome utente specificato non è valido, sono consentiti i seguenti caratteri: a-zA-Z0-9-_.~",
|
||||
"home_required": "La directory principale è obbligatoria",
|
||||
"home_invalid": "La directory principale deve essere un path assoluto",
|
||||
"pub_key_invalid": "Chiave pubblica non valida",
|
||||
"err_primary_group": "È consentito un solo gruppo primario",
|
||||
"err_duplicate_group": "Rilevati gruppi duplicati",
|
||||
"no_permissions": "I permessi per le directory sono obbligatori",
|
||||
"no_root_permissions": "I permessi per la directory principale sono obbligatori",
|
||||
"err_permissions_generic": "Permessi non validi: assicurati di utilizzare percorsi assoluti validi",
|
||||
"2fa_invalid": "Configurazione non valida per l'autenticazione a due fattori",
|
||||
"recovery_codes_invalid": "Codici di ripristino non validi",
|
||||
"folde_path_required": "Il percorso di montaggio delle cartelle virtuali è obbligatorio",
|
||||
"folder_duplicated": "Rilevate cartelle virtuali duplicate",
|
||||
"folder_overlapped": "Rilevate cartelle virtuali sovrapposte",
|
||||
"folder_quota_size_invalid": "La quota come dimensione delle cartelle virtuali deve essere maggiore o uguale a -1",
|
||||
"folder_quota_file_invalid": "La quota come numero di file delle cartelle virtuali deve essere maggiore o uguale a -1",
|
||||
"folder_quota_invalid": "Le quote come dimensione e numero di file delle cartelle virtuali devono essere entrambe -1 o maggiore o uguale di zero",
|
||||
"ip_filters_invalid": "Filtri IP non validi, assicurati che rispettino la notazione CIDR, ad esempio 192.168.1.0/24",
|
||||
"src_bw_limits_invalid": "Limiti di velocità della larghezza di banda per origine non validi",
|
||||
"share_expiration_invalid": "La scadenza per le condivisioni deve essere maggiore o uguale al valore di default definito",
|
||||
"file_pattern_path_invalid": "I percorsi dei filtri sui modelli di nome file devono essere assoluti",
|
||||
"file_pattern_duplicated": "Rilevati filtri su modelli di nome file duplicati",
|
||||
"file_pattern_invalid": "Filtri su modelli di nome file non validi",
|
||||
"disable_active_2fa": "L'autenticazione a due fattori non può essere disabilitata per un utente con una configurazione attiva",
|
||||
"pwd_change_conflict": "Non è possibile richiedere la modifica della password e allo stesso tempo impedire la modifica della password"
|
||||
}
|
||||
}
|
||||
2297
static/vendor/i18next/i18next.js
vendored
Normal file
2297
static/vendor/i18next/i18next.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
420
static/vendor/i18next/i18nextBrowserLanguageDetector.js
vendored
Normal file
420
static/vendor/i18next/i18nextBrowserLanguageDetector.js
vendored
Normal file
@@ -0,0 +1,420 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.i18nextBrowserLanguageDetector = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
function _toPrimitive(input, hint) {
|
||||
if (_typeof(input) !== "object" || input === null) return input;
|
||||
var prim = input[Symbol.toPrimitive];
|
||||
if (prim !== undefined) {
|
||||
var res = prim.call(input, hint || "default");
|
||||
if (_typeof(res) !== "object") return res;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (hint === "string" ? String : Number)(input);
|
||||
}
|
||||
|
||||
function _toPropertyKey(arg) {
|
||||
var key = _toPrimitive(arg, "string");
|
||||
return _typeof(key) === "symbol" ? key : String(key);
|
||||
}
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
||||
}
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
var arr = [];
|
||||
var each = arr.forEach;
|
||||
var slice = arr.slice;
|
||||
function defaults(obj) {
|
||||
each.call(slice.call(arguments, 1), function (source) {
|
||||
if (source) {
|
||||
for (var prop in source) {
|
||||
if (obj[prop] === undefined) obj[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-control-regex
|
||||
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
||||
var serializeCookie = function serializeCookie(name, val, options) {
|
||||
var opt = options || {};
|
||||
opt.path = opt.path || '/';
|
||||
var value = encodeURIComponent(val);
|
||||
var str = "".concat(name, "=").concat(value);
|
||||
if (opt.maxAge > 0) {
|
||||
var maxAge = opt.maxAge - 0;
|
||||
if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
||||
str += "; Max-Age=".concat(Math.floor(maxAge));
|
||||
}
|
||||
if (opt.domain) {
|
||||
if (!fieldContentRegExp.test(opt.domain)) {
|
||||
throw new TypeError('option domain is invalid');
|
||||
}
|
||||
str += "; Domain=".concat(opt.domain);
|
||||
}
|
||||
if (opt.path) {
|
||||
if (!fieldContentRegExp.test(opt.path)) {
|
||||
throw new TypeError('option path is invalid');
|
||||
}
|
||||
str += "; Path=".concat(opt.path);
|
||||
}
|
||||
if (opt.expires) {
|
||||
if (typeof opt.expires.toUTCString !== 'function') {
|
||||
throw new TypeError('option expires is invalid');
|
||||
}
|
||||
str += "; Expires=".concat(opt.expires.toUTCString());
|
||||
}
|
||||
if (opt.httpOnly) str += '; HttpOnly';
|
||||
if (opt.secure) str += '; Secure';
|
||||
if (opt.sameSite) {
|
||||
var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
|
||||
switch (sameSite) {
|
||||
case true:
|
||||
str += '; SameSite=Strict';
|
||||
break;
|
||||
case 'lax':
|
||||
str += '; SameSite=Lax';
|
||||
break;
|
||||
case 'strict':
|
||||
str += '; SameSite=Strict';
|
||||
break;
|
||||
case 'none':
|
||||
str += '; SameSite=None';
|
||||
break;
|
||||
default:
|
||||
throw new TypeError('option sameSite is invalid');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
var cookie = {
|
||||
create: function create(name, value, minutes, domain) {
|
||||
var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
||||
path: '/',
|
||||
sameSite: 'strict'
|
||||
};
|
||||
if (minutes) {
|
||||
cookieOptions.expires = new Date();
|
||||
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
|
||||
}
|
||||
if (domain) cookieOptions.domain = domain;
|
||||
document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
|
||||
},
|
||||
read: function read(name) {
|
||||
var nameEQ = "".concat(name, "=");
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
remove: function remove(name) {
|
||||
this.create(name, '', -1);
|
||||
}
|
||||
};
|
||||
var cookie$1 = {
|
||||
name: 'cookie',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
if (options.lookupCookie && typeof document !== 'undefined') {
|
||||
var c = cookie.read(options.lookupCookie);
|
||||
if (c) found = c;
|
||||
}
|
||||
return found;
|
||||
},
|
||||
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
||||
if (options.lookupCookie && typeof document !== 'undefined') {
|
||||
cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain, options.cookieOptions);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var querystring = {
|
||||
name: 'querystring',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
if (typeof window !== 'undefined') {
|
||||
var search = window.location.search;
|
||||
if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {
|
||||
search = window.location.hash.substring(window.location.hash.indexOf('?'));
|
||||
}
|
||||
var query = search.substring(1);
|
||||
var params = query.split('&');
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var pos = params[i].indexOf('=');
|
||||
if (pos > 0) {
|
||||
var key = params[i].substring(0, pos);
|
||||
if (key === options.lookupQuerystring) {
|
||||
found = params[i].substring(pos + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
};
|
||||
|
||||
var hasLocalStorageSupport = null;
|
||||
var localStorageAvailable = function localStorageAvailable() {
|
||||
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
||||
try {
|
||||
hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
|
||||
var testKey = 'i18next.translate.boo';
|
||||
window.localStorage.setItem(testKey, 'foo');
|
||||
window.localStorage.removeItem(testKey);
|
||||
} catch (e) {
|
||||
hasLocalStorageSupport = false;
|
||||
}
|
||||
return hasLocalStorageSupport;
|
||||
};
|
||||
var localStorage = {
|
||||
name: 'localStorage',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
if (options.lookupLocalStorage && localStorageAvailable()) {
|
||||
var lng = window.localStorage.getItem(options.lookupLocalStorage);
|
||||
if (lng) found = lng;
|
||||
}
|
||||
return found;
|
||||
},
|
||||
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
||||
if (options.lookupLocalStorage && localStorageAvailable()) {
|
||||
window.localStorage.setItem(options.lookupLocalStorage, lng);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var hasSessionStorageSupport = null;
|
||||
var sessionStorageAvailable = function sessionStorageAvailable() {
|
||||
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
||||
try {
|
||||
hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;
|
||||
var testKey = 'i18next.translate.boo';
|
||||
window.sessionStorage.setItem(testKey, 'foo');
|
||||
window.sessionStorage.removeItem(testKey);
|
||||
} catch (e) {
|
||||
hasSessionStorageSupport = false;
|
||||
}
|
||||
return hasSessionStorageSupport;
|
||||
};
|
||||
var sessionStorage = {
|
||||
name: 'sessionStorage',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
||||
var lng = window.sessionStorage.getItem(options.lookupSessionStorage);
|
||||
if (lng) found = lng;
|
||||
}
|
||||
return found;
|
||||
},
|
||||
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
||||
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
||||
window.sessionStorage.setItem(options.lookupSessionStorage, lng);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var navigator$1 = {
|
||||
name: 'navigator',
|
||||
lookup: function lookup(options) {
|
||||
var found = [];
|
||||
if (typeof navigator !== 'undefined') {
|
||||
if (navigator.languages) {
|
||||
// chrome only; not an array, so can't use .push.apply instead of iterating
|
||||
for (var i = 0; i < navigator.languages.length; i++) {
|
||||
found.push(navigator.languages[i]);
|
||||
}
|
||||
}
|
||||
if (navigator.userLanguage) {
|
||||
found.push(navigator.userLanguage);
|
||||
}
|
||||
if (navigator.language) {
|
||||
found.push(navigator.language);
|
||||
}
|
||||
}
|
||||
return found.length > 0 ? found : undefined;
|
||||
}
|
||||
};
|
||||
|
||||
var htmlTag = {
|
||||
name: 'htmlTag',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
|
||||
if (htmlTag && typeof htmlTag.getAttribute === 'function') {
|
||||
found = htmlTag.getAttribute('lang');
|
||||
}
|
||||
return found;
|
||||
}
|
||||
};
|
||||
|
||||
var path = {
|
||||
name: 'path',
|
||||
lookup: function lookup(options) {
|
||||
var found;
|
||||
if (typeof window !== 'undefined') {
|
||||
var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
||||
if (language instanceof Array) {
|
||||
if (typeof options.lookupFromPathIndex === 'number') {
|
||||
if (typeof language[options.lookupFromPathIndex] !== 'string') {
|
||||
return undefined;
|
||||
}
|
||||
found = language[options.lookupFromPathIndex].replace('/', '');
|
||||
} else {
|
||||
found = language[0].replace('/', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
};
|
||||
|
||||
var subdomain = {
|
||||
name: 'subdomain',
|
||||
lookup: function lookup(options) {
|
||||
// If given get the subdomain index else 1
|
||||
var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
|
||||
// get all matches if window.location. is existing
|
||||
// first item of match is the match itself and the second is the first group macht which sould be the first subdomain match
|
||||
// is the hostname no public domain get the or option of localhost
|
||||
var language = typeof window !== 'undefined' && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
||||
|
||||
// if there is no match (null) return undefined
|
||||
if (!language) return undefined;
|
||||
// return the given group match
|
||||
return language[lookupFromSubdomainIndex];
|
||||
}
|
||||
};
|
||||
|
||||
function getDefaults() {
|
||||
return {
|
||||
order: ['querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'],
|
||||
lookupQuerystring: 'lng',
|
||||
lookupCookie: 'i18next',
|
||||
lookupLocalStorage: 'i18nextLng',
|
||||
lookupSessionStorage: 'i18nextLng',
|
||||
// cache user language
|
||||
caches: ['localStorage'],
|
||||
excludeCacheFor: ['cimode'],
|
||||
// cookieMinutes: 10,
|
||||
// cookieDomain: 'myDomain'
|
||||
|
||||
convertDetectedLanguage: function convertDetectedLanguage(l) {
|
||||
return l;
|
||||
}
|
||||
};
|
||||
}
|
||||
var Browser = /*#__PURE__*/function () {
|
||||
function Browser(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
_classCallCheck(this, Browser);
|
||||
this.type = 'languageDetector';
|
||||
this.detectors = {};
|
||||
this.init(services, options);
|
||||
}
|
||||
_createClass(Browser, [{
|
||||
key: "init",
|
||||
value: function init(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
this.services = services || {
|
||||
languageUtils: {}
|
||||
}; // this way the language detector can be used without i18next
|
||||
this.options = defaults(options, this.options || {}, getDefaults());
|
||||
if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
|
||||
this.options.convertDetectedLanguage = function (l) {
|
||||
return l.replace('-', '_');
|
||||
};
|
||||
}
|
||||
|
||||
// backwards compatibility
|
||||
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
||||
this.i18nOptions = i18nOptions;
|
||||
this.addDetector(cookie$1);
|
||||
this.addDetector(querystring);
|
||||
this.addDetector(localStorage);
|
||||
this.addDetector(sessionStorage);
|
||||
this.addDetector(navigator$1);
|
||||
this.addDetector(htmlTag);
|
||||
this.addDetector(path);
|
||||
this.addDetector(subdomain);
|
||||
}
|
||||
}, {
|
||||
key: "addDetector",
|
||||
value: function addDetector(detector) {
|
||||
this.detectors[detector.name] = detector;
|
||||
}
|
||||
}, {
|
||||
key: "detect",
|
||||
value: function detect(detectionOrder) {
|
||||
var _this = this;
|
||||
if (!detectionOrder) detectionOrder = this.options.order;
|
||||
var detected = [];
|
||||
detectionOrder.forEach(function (detectorName) {
|
||||
if (_this.detectors[detectorName]) {
|
||||
var lookup = _this.detectors[detectorName].lookup(_this.options);
|
||||
if (lookup && typeof lookup === 'string') lookup = [lookup];
|
||||
if (lookup) detected = detected.concat(lookup);
|
||||
}
|
||||
});
|
||||
detected = detected.map(function (d) {
|
||||
return _this.options.convertDetectedLanguage(d);
|
||||
});
|
||||
if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
|
||||
return detected.length > 0 ? detected[0] : null; // a little backward compatibility
|
||||
}
|
||||
}, {
|
||||
key: "cacheUserLanguage",
|
||||
value: function cacheUserLanguage(lng, caches) {
|
||||
var _this2 = this;
|
||||
if (!caches) caches = this.options.caches;
|
||||
if (!caches) return;
|
||||
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
||||
caches.forEach(function (cacheName) {
|
||||
if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
return Browser;
|
||||
}();
|
||||
Browser.type = 'languageDetector';
|
||||
|
||||
return Browser;
|
||||
|
||||
}));
|
||||
266
static/vendor/i18next/i18nextChainedBackend.js
vendored
Normal file
266
static/vendor/i18next/i18nextChainedBackend.js
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.i18nextChainedBackend = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
function _toPrimitive(input, hint) {
|
||||
if (_typeof(input) !== "object" || input === null) return input;
|
||||
var prim = input[Symbol.toPrimitive];
|
||||
if (prim !== undefined) {
|
||||
var res = prim.call(input, hint || "default");
|
||||
if (_typeof(res) !== "object") return res;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (hint === "string" ? String : Number)(input);
|
||||
}
|
||||
|
||||
function _toPropertyKey(arg) {
|
||||
var key = _toPrimitive(arg, "string");
|
||||
return _typeof(key) === "symbol" ? key : String(key);
|
||||
}
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
||||
}
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
var arr = [];
|
||||
var each = arr.forEach;
|
||||
var slice = arr.slice;
|
||||
function defaults(obj) {
|
||||
each.call(slice.call(arguments, 1), function (source) {
|
||||
if (source) {
|
||||
for (var prop in source) {
|
||||
if (obj[prop] === undefined) obj[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
function createClassOnDemand(ClassOrObject) {
|
||||
if (!ClassOrObject) return null;
|
||||
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
||||
return ClassOrObject;
|
||||
}
|
||||
|
||||
function getDefaults() {
|
||||
return {
|
||||
handleEmptyResourcesAsFailed: true,
|
||||
cacheHitMode: 'none'
|
||||
// reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
|
||||
// refreshExpirationTime: 60 * 60 * 1000
|
||||
};
|
||||
}
|
||||
|
||||
function handleCorrectReadFunction(backend, language, namespace, resolver) {
|
||||
var fc = backend.read.bind(backend);
|
||||
if (fc.length === 2) {
|
||||
// no callback
|
||||
try {
|
||||
var r = fc(language, namespace);
|
||||
if (r && typeof r.then === 'function') {
|
||||
// promise
|
||||
r.then(function (data) {
|
||||
return resolver(null, data);
|
||||
})["catch"](resolver);
|
||||
} else {
|
||||
// sync
|
||||
resolver(null, r);
|
||||
}
|
||||
} catch (err) {
|
||||
resolver(err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// normal with callback
|
||||
fc(language, namespace, resolver);
|
||||
}
|
||||
var Backend = /*#__PURE__*/function () {
|
||||
function Backend(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var i18nextOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
_classCallCheck(this, Backend);
|
||||
this.backends = [];
|
||||
this.type = 'backend';
|
||||
this.allOptions = i18nextOptions;
|
||||
this.init(services, options);
|
||||
}
|
||||
_createClass(Backend, [{
|
||||
key: "init",
|
||||
value: function init(services) {
|
||||
var _this = this;
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var i18nextOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
this.services = services;
|
||||
this.options = defaults(options, this.options || {}, getDefaults());
|
||||
this.allOptions = i18nextOptions;
|
||||
this.options.backends && this.options.backends.forEach(function (b, i) {
|
||||
_this.backends[i] = _this.backends[i] || createClassOnDemand(b);
|
||||
_this.backends[i].init(services, _this.options.backendOptions && _this.options.backendOptions[i] || {}, i18nextOptions);
|
||||
});
|
||||
if (this.services && this.options.reloadInterval) {
|
||||
setInterval(function () {
|
||||
return _this.reload();
|
||||
}, this.options.reloadInterval);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "read",
|
||||
value: function read(language, namespace, callback) {
|
||||
var _this2 = this;
|
||||
var bLen = this.backends.length;
|
||||
var loadPosition = function loadPosition(pos) {
|
||||
if (pos >= bLen) return callback(new Error('non of the backend loaded data', true)); // failed pass retry flag
|
||||
var isLastBackend = pos === bLen - 1;
|
||||
var lengthCheckAmount = _this2.options.handleEmptyResourcesAsFailed && !isLastBackend ? 0 : -1;
|
||||
var backend = _this2.backends[pos];
|
||||
if (backend.read) {
|
||||
handleCorrectReadFunction(backend, language, namespace, function (err, data, savedAt) {
|
||||
if (!err && data && Object.keys(data).length > lengthCheckAmount) {
|
||||
callback(null, data, pos);
|
||||
savePosition(pos - 1, data); // save one in front
|
||||
if (backend.save && _this2.options.cacheHitMode && ['refresh', 'refreshAndUpdateStore'].indexOf(_this2.options.cacheHitMode) > -1) {
|
||||
if (savedAt && _this2.options.refreshExpirationTime && savedAt + _this2.options.refreshExpirationTime > Date.now()) return;
|
||||
var nextBackend = _this2.backends[pos + 1];
|
||||
if (nextBackend && nextBackend.read) {
|
||||
handleCorrectReadFunction(nextBackend, language, namespace, function (err, data) {
|
||||
if (err) return;
|
||||
if (!data) return;
|
||||
if (Object.keys(data).length <= lengthCheckAmount) return;
|
||||
savePosition(pos, data);
|
||||
if (_this2.options.cacheHitMode !== 'refreshAndUpdateStore') return;
|
||||
if (_this2.services && _this2.services.resourceStore) {
|
||||
_this2.services.resourceStore.addResourceBundle(language, namespace, data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
loadPosition(pos + 1); // try load from next
|
||||
}
|
||||
});
|
||||
} else {
|
||||
loadPosition(pos + 1); // try load from next
|
||||
}
|
||||
};
|
||||
|
||||
var savePosition = function savePosition(pos, data) {
|
||||
if (pos < 0) return;
|
||||
var backend = _this2.backends[pos];
|
||||
if (backend.save) {
|
||||
backend.save(language, namespace, data);
|
||||
savePosition(pos - 1, data);
|
||||
} else {
|
||||
savePosition(pos - 1, data);
|
||||
}
|
||||
};
|
||||
loadPosition(0);
|
||||
}
|
||||
}, {
|
||||
key: "create",
|
||||
value: function create(languages, namespace, key, fallbackValue) {
|
||||
var clb = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
|
||||
var opts = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
||||
this.backends.forEach(function (b) {
|
||||
if (!b.create) return;
|
||||
var fc = b.create.bind(b);
|
||||
if (fc.length < 6) {
|
||||
// no callback
|
||||
try {
|
||||
var r;
|
||||
if (fc.length === 5) {
|
||||
// future callback-less api for i18next-locize-backend
|
||||
r = fc(languages, namespace, key, fallbackValue, opts);
|
||||
} else {
|
||||
r = fc(languages, namespace, key, fallbackValue);
|
||||
}
|
||||
if (r && typeof r.then === 'function') {
|
||||
// promise
|
||||
r.then(function (data) {
|
||||
return clb(null, data);
|
||||
})["catch"](clb);
|
||||
} else {
|
||||
// sync
|
||||
clb(null, r);
|
||||
}
|
||||
} catch (err) {
|
||||
clb(err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// normal with callback
|
||||
fc(languages, namespace, key, fallbackValue, clb /* unused callback */, opts);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "reload",
|
||||
value: function reload() {
|
||||
var _this3 = this;
|
||||
var _this$services = this.services,
|
||||
backendConnector = _this$services.backendConnector,
|
||||
languageUtils = _this$services.languageUtils,
|
||||
logger = _this$services.logger;
|
||||
var currentLanguage = backendConnector.language;
|
||||
if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return; // avoid loading resources for cimode
|
||||
|
||||
var toLoad = [];
|
||||
var append = function append(lng) {
|
||||
var lngs = languageUtils.toResolveHierarchy(lng);
|
||||
lngs.forEach(function (l) {
|
||||
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
||||
});
|
||||
};
|
||||
append(currentLanguage);
|
||||
if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
|
||||
return append(l);
|
||||
});
|
||||
toLoad.forEach(function (lng) {
|
||||
_this3.allOptions.ns.forEach(function (ns) {
|
||||
backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
|
||||
if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
|
||||
if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
|
||||
backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
return Backend;
|
||||
}();
|
||||
Backend.type = 'backend';
|
||||
|
||||
return Backend;
|
||||
|
||||
}));
|
||||
414
static/vendor/i18next/i18nextHttpBackend.js
vendored
Normal file
414
static/vendor/i18next/i18nextHttpBackend.js
vendored
Normal file
@@ -0,0 +1,414 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.i18nextHttpBackend = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
(function (global){(function (){
|
||||
var fetchApi
|
||||
if (typeof fetch === 'function') {
|
||||
if (typeof global !== 'undefined' && global.fetch) {
|
||||
fetchApi = global.fetch
|
||||
} else if (typeof window !== 'undefined' && window.fetch) {
|
||||
fetchApi = window.fetch
|
||||
} else {
|
||||
fetchApi = fetch
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof require !== 'undefined' && (typeof window === 'undefined' || typeof window.document === 'undefined')) {
|
||||
var f = fetchApi || require('cross-fetch')
|
||||
if (f.default) f = f.default
|
||||
exports.default = f
|
||||
module.exports = exports.default
|
||||
}
|
||||
|
||||
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"cross-fetch":5}],2:[function(require,module,exports){
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _utils = require("./utils.js");
|
||||
var _request = _interopRequireDefault(require("./request.js"));
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
||||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
||||
var getDefaults = function getDefaults() {
|
||||
return {
|
||||
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
||||
addPath: '/locales/add/{{lng}}/{{ns}}',
|
||||
parse: function parse(data) {
|
||||
return JSON.parse(data);
|
||||
},
|
||||
stringify: JSON.stringify,
|
||||
parsePayload: function parsePayload(namespace, key, fallbackValue) {
|
||||
return _defineProperty({}, key, fallbackValue || '');
|
||||
},
|
||||
parseLoadPayload: function parseLoadPayload(languages, namespaces) {
|
||||
return undefined;
|
||||
},
|
||||
request: _request.default,
|
||||
reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
|
||||
customHeaders: {},
|
||||
queryStringParams: {},
|
||||
crossDomain: false,
|
||||
withCredentials: false,
|
||||
overrideMimeType: false,
|
||||
requestOptions: {
|
||||
mode: 'cors',
|
||||
credentials: 'same-origin',
|
||||
cache: 'default'
|
||||
}
|
||||
};
|
||||
};
|
||||
var Backend = function () {
|
||||
function Backend(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
_classCallCheck(this, Backend);
|
||||
this.services = services;
|
||||
this.options = options;
|
||||
this.allOptions = allOptions;
|
||||
this.type = 'backend';
|
||||
this.init(services, options, allOptions);
|
||||
}
|
||||
_createClass(Backend, [{
|
||||
key: "init",
|
||||
value: function init(services) {
|
||||
var _this = this;
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
this.services = services;
|
||||
this.options = (0, _utils.defaults)(options, this.options || {}, getDefaults());
|
||||
this.allOptions = allOptions;
|
||||
if (this.services && this.options.reloadInterval) {
|
||||
setInterval(function () {
|
||||
return _this.reload();
|
||||
}, this.options.reloadInterval);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "readMulti",
|
||||
value: function readMulti(languages, namespaces, callback) {
|
||||
this._readAny(languages, languages, namespaces, namespaces, callback);
|
||||
}
|
||||
}, {
|
||||
key: "read",
|
||||
value: function read(language, namespace, callback) {
|
||||
this._readAny([language], language, [namespace], namespace, callback);
|
||||
}
|
||||
}, {
|
||||
key: "_readAny",
|
||||
value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
|
||||
var _this2 = this;
|
||||
var loadPath = this.options.loadPath;
|
||||
if (typeof this.options.loadPath === 'function') {
|
||||
loadPath = this.options.loadPath(languages, namespaces);
|
||||
}
|
||||
loadPath = (0, _utils.makePromise)(loadPath);
|
||||
loadPath.then(function (resolvedLoadPath) {
|
||||
if (!resolvedLoadPath) return callback(null, {});
|
||||
var url = _this2.services.interpolator.interpolate(resolvedLoadPath, {
|
||||
lng: languages.join('+'),
|
||||
ns: namespaces.join('+')
|
||||
});
|
||||
_this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "loadUrl",
|
||||
value: function loadUrl(url, callback, languages, namespaces) {
|
||||
var _this3 = this;
|
||||
var lng = typeof languages === 'string' ? [languages] : languages;
|
||||
var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
|
||||
var payload = this.options.parseLoadPayload(lng, ns);
|
||||
this.options.request(this.options, url, payload, function (err, res) {
|
||||
if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true);
|
||||
if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false);
|
||||
if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true);
|
||||
if (err) return callback(err, false);
|
||||
var ret, parseErr;
|
||||
try {
|
||||
if (typeof res.data === 'string') {
|
||||
ret = _this3.options.parse(res.data, languages, namespaces);
|
||||
} else {
|
||||
ret = res.data;
|
||||
}
|
||||
} catch (e) {
|
||||
parseErr = 'failed parsing ' + url + ' to json';
|
||||
}
|
||||
if (parseErr) return callback(parseErr, false);
|
||||
callback(null, ret);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "create",
|
||||
value: function create(languages, namespace, key, fallbackValue, callback) {
|
||||
var _this4 = this;
|
||||
if (!this.options.addPath) return;
|
||||
if (typeof languages === 'string') languages = [languages];
|
||||
var payload = this.options.parsePayload(namespace, key, fallbackValue);
|
||||
var finished = 0;
|
||||
var dataArray = [];
|
||||
var resArray = [];
|
||||
languages.forEach(function (lng) {
|
||||
var addPath = _this4.options.addPath;
|
||||
if (typeof _this4.options.addPath === 'function') {
|
||||
addPath = _this4.options.addPath(lng, namespace);
|
||||
}
|
||||
var url = _this4.services.interpolator.interpolate(addPath, {
|
||||
lng: lng,
|
||||
ns: namespace
|
||||
});
|
||||
_this4.options.request(_this4.options, url, payload, function (data, res) {
|
||||
finished += 1;
|
||||
dataArray.push(data);
|
||||
resArray.push(res);
|
||||
if (finished === languages.length) {
|
||||
if (typeof callback === 'function') callback(dataArray, resArray);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "reload",
|
||||
value: function reload() {
|
||||
var _this5 = this;
|
||||
var _this$services = this.services,
|
||||
backendConnector = _this$services.backendConnector,
|
||||
languageUtils = _this$services.languageUtils,
|
||||
logger = _this$services.logger;
|
||||
var currentLanguage = backendConnector.language;
|
||||
if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
|
||||
var toLoad = [];
|
||||
var append = function append(lng) {
|
||||
var lngs = languageUtils.toResolveHierarchy(lng);
|
||||
lngs.forEach(function (l) {
|
||||
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
||||
});
|
||||
};
|
||||
append(currentLanguage);
|
||||
if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
|
||||
return append(l);
|
||||
});
|
||||
toLoad.forEach(function (lng) {
|
||||
_this5.allOptions.ns.forEach(function (ns) {
|
||||
backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
|
||||
if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
|
||||
if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
|
||||
backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
return Backend;
|
||||
}();
|
||||
Backend.type = 'backend';
|
||||
var _default = exports.default = Backend;
|
||||
module.exports = exports.default;
|
||||
},{"./request.js":3,"./utils.js":4}],3:[function(require,module,exports){
|
||||
(function (global){(function (){
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _utils = require("./utils.js");
|
||||
var fetchNode = _interopRequireWildcard(require("./getFetch.js"));
|
||||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
||||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
var fetchApi;
|
||||
if (typeof fetch === 'function') {
|
||||
if (typeof global !== 'undefined' && global.fetch) {
|
||||
fetchApi = global.fetch;
|
||||
} else if (typeof window !== 'undefined' && window.fetch) {
|
||||
fetchApi = window.fetch;
|
||||
} else {
|
||||
fetchApi = fetch;
|
||||
}
|
||||
}
|
||||
var XmlHttpRequestApi;
|
||||
if ((0, _utils.hasXMLHttpRequest)()) {
|
||||
if (typeof global !== 'undefined' && global.XMLHttpRequest) {
|
||||
XmlHttpRequestApi = global.XMLHttpRequest;
|
||||
} else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
|
||||
XmlHttpRequestApi = window.XMLHttpRequest;
|
||||
}
|
||||
}
|
||||
var ActiveXObjectApi;
|
||||
if (typeof ActiveXObject === 'function') {
|
||||
if (typeof global !== 'undefined' && global.ActiveXObject) {
|
||||
ActiveXObjectApi = global.ActiveXObject;
|
||||
} else if (typeof window !== 'undefined' && window.ActiveXObject) {
|
||||
ActiveXObjectApi = window.ActiveXObject;
|
||||
}
|
||||
}
|
||||
if (!fetchApi && fetchNode && !XmlHttpRequestApi && !ActiveXObjectApi) fetchApi = fetchNode.default || fetchNode;
|
||||
if (typeof fetchApi !== 'function') fetchApi = undefined;
|
||||
var addQueryString = function addQueryString(url, params) {
|
||||
if (params && _typeof(params) === 'object') {
|
||||
var queryString = '';
|
||||
for (var paramName in params) {
|
||||
queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
|
||||
}
|
||||
if (!queryString) return url;
|
||||
url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
|
||||
}
|
||||
return url;
|
||||
};
|
||||
var fetchIt = function fetchIt(url, fetchOptions, callback) {
|
||||
var resolver = function resolver(response) {
|
||||
if (!response.ok) return callback(response.statusText || 'Error', {
|
||||
status: response.status
|
||||
});
|
||||
response.text().then(function (data) {
|
||||
callback(null, {
|
||||
status: response.status,
|
||||
data: data
|
||||
});
|
||||
}).catch(callback);
|
||||
};
|
||||
if (typeof fetch === 'function') {
|
||||
fetch(url, fetchOptions).then(resolver).catch(callback);
|
||||
} else {
|
||||
fetchApi(url, fetchOptions).then(resolver).catch(callback);
|
||||
}
|
||||
};
|
||||
var omitFetchOptions = false;
|
||||
var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
|
||||
if (options.queryStringParams) {
|
||||
url = addQueryString(url, options.queryStringParams);
|
||||
}
|
||||
var headers = (0, _utils.defaults)({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
|
||||
if (typeof window === 'undefined' && typeof global !== 'undefined' && typeof global.process !== 'undefined' && global.process.versions && global.process.versions.node) {
|
||||
headers['User-Agent'] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")");
|
||||
}
|
||||
if (payload) headers['Content-Type'] = 'application/json';
|
||||
var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
|
||||
var fetchOptions = (0, _utils.defaults)({
|
||||
method: payload ? 'POST' : 'GET',
|
||||
body: payload ? options.stringify(payload) : undefined,
|
||||
headers: headers
|
||||
}, omitFetchOptions ? {} : reqOptions);
|
||||
try {
|
||||
fetchIt(url, fetchOptions, callback);
|
||||
} catch (e) {
|
||||
if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
|
||||
return callback(e);
|
||||
}
|
||||
try {
|
||||
Object.keys(reqOptions).forEach(function (opt) {
|
||||
delete fetchOptions[opt];
|
||||
});
|
||||
fetchIt(url, fetchOptions, callback);
|
||||
omitFetchOptions = true;
|
||||
} catch (err) {
|
||||
callback(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
|
||||
if (payload && _typeof(payload) === 'object') {
|
||||
payload = addQueryString('', payload).slice(1);
|
||||
}
|
||||
if (options.queryStringParams) {
|
||||
url = addQueryString(url, options.queryStringParams);
|
||||
}
|
||||
try {
|
||||
var x;
|
||||
if (XmlHttpRequestApi) {
|
||||
x = new XmlHttpRequestApi();
|
||||
} else {
|
||||
x = new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
|
||||
}
|
||||
x.open(payload ? 'POST' : 'GET', url, 1);
|
||||
if (!options.crossDomain) {
|
||||
x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
}
|
||||
x.withCredentials = !!options.withCredentials;
|
||||
if (payload) {
|
||||
x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
}
|
||||
if (x.overrideMimeType) {
|
||||
x.overrideMimeType('application/json');
|
||||
}
|
||||
var h = options.customHeaders;
|
||||
h = typeof h === 'function' ? h() : h;
|
||||
if (h) {
|
||||
for (var i in h) {
|
||||
x.setRequestHeader(i, h[i]);
|
||||
}
|
||||
}
|
||||
x.onreadystatechange = function () {
|
||||
x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
|
||||
status: x.status,
|
||||
data: x.responseText
|
||||
});
|
||||
};
|
||||
x.send(payload);
|
||||
} catch (e) {
|
||||
console && console.log(e);
|
||||
}
|
||||
};
|
||||
var request = function request(options, url, payload, callback) {
|
||||
if (typeof payload === 'function') {
|
||||
callback = payload;
|
||||
payload = undefined;
|
||||
}
|
||||
callback = callback || function () {};
|
||||
if (fetchApi && url.indexOf('file:') !== 0) {
|
||||
return requestWithFetch(options, url, payload, callback);
|
||||
}
|
||||
if ((0, _utils.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
|
||||
return requestWithXmlHttpRequest(options, url, payload, callback);
|
||||
}
|
||||
callback(new Error('No fetch and no xhr implementation found!'));
|
||||
};
|
||||
var _default = exports.default = request;
|
||||
module.exports = exports.default;
|
||||
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"./getFetch.js":1,"./utils.js":4}],4:[function(require,module,exports){
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.defaults = defaults;
|
||||
exports.hasXMLHttpRequest = hasXMLHttpRequest;
|
||||
exports.makePromise = makePromise;
|
||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
||||
var arr = [];
|
||||
var each = arr.forEach;
|
||||
var slice = arr.slice;
|
||||
function defaults(obj) {
|
||||
each.call(slice.call(arguments, 1), function (source) {
|
||||
if (source) {
|
||||
for (var prop in source) {
|
||||
if (obj[prop] === undefined) obj[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
function hasXMLHttpRequest() {
|
||||
return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
|
||||
}
|
||||
function isPromise(maybePromise) {
|
||||
return !!maybePromise && typeof maybePromise.then === 'function';
|
||||
}
|
||||
function makePromise(maybePromise) {
|
||||
if (isPromise(maybePromise)) {
|
||||
return maybePromise;
|
||||
}
|
||||
return Promise.resolve(maybePromise);
|
||||
}
|
||||
},{}],5:[function(require,module,exports){
|
||||
|
||||
},{}]},{},[2])(2)
|
||||
});
|
||||
190
static/vendor/i18next/i18nextLocalStorageBackend.js
vendored
Normal file
190
static/vendor/i18next/i18nextLocalStorageBackend.js
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.i18nextLocalStorageBackend = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
||||
return typeof o;
|
||||
} : function (o) {
|
||||
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
||||
}, _typeof(o);
|
||||
}
|
||||
|
||||
function _toPrimitive(input, hint) {
|
||||
if (_typeof(input) !== "object" || input === null) return input;
|
||||
var prim = input[Symbol.toPrimitive];
|
||||
if (prim !== undefined) {
|
||||
var res = prim.call(input, hint || "default");
|
||||
if (_typeof(res) !== "object") return res;
|
||||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||||
}
|
||||
return (hint === "string" ? String : Number)(input);
|
||||
}
|
||||
|
||||
function _toPropertyKey(arg) {
|
||||
var key = _toPrimitive(arg, "string");
|
||||
return _typeof(key) === "symbol" ? key : String(key);
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
key = _toPropertyKey(key);
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
}
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
||||
}
|
||||
}
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
Object.defineProperty(Constructor, "prototype", {
|
||||
writable: false
|
||||
});
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
||||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
||||
/* eslint-disable max-classes-per-file */
|
||||
var Storage = /*#__PURE__*/function () {
|
||||
function Storage(options) {
|
||||
_classCallCheck(this, Storage);
|
||||
this.store = options.store;
|
||||
}
|
||||
_createClass(Storage, [{
|
||||
key: "setItem",
|
||||
value: function setItem(key, value) {
|
||||
if (this.store) {
|
||||
try {
|
||||
this.store.setItem(key, value);
|
||||
} catch (e) {
|
||||
// f.log('failed to set value for key "' + key + '" to localStorage.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getItem",
|
||||
value: function getItem(key, value) {
|
||||
if (this.store) {
|
||||
try {
|
||||
return this.store.getItem(key, value);
|
||||
} catch (e) {
|
||||
// f.log('failed to get value for key "' + key + '" from localStorage.');
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}]);
|
||||
return Storage;
|
||||
}();
|
||||
function getDefaults() {
|
||||
var store = null;
|
||||
try {
|
||||
store = window.localStorage;
|
||||
} catch (e) {
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('Failed to load local storage.', e);
|
||||
}
|
||||
}
|
||||
return {
|
||||
prefix: 'i18next_res_',
|
||||
expirationTime: 7 * 24 * 60 * 60 * 1000,
|
||||
defaultVersion: undefined,
|
||||
versions: {},
|
||||
store: store
|
||||
};
|
||||
}
|
||||
var Cache = /*#__PURE__*/function () {
|
||||
function Cache(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
_classCallCheck(this, Cache);
|
||||
this.init(services, options);
|
||||
this.type = 'backend';
|
||||
}
|
||||
_createClass(Cache, [{
|
||||
key: "init",
|
||||
value: function init(services) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
this.services = services;
|
||||
this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options), options);
|
||||
this.storage = new Storage(this.options);
|
||||
}
|
||||
}, {
|
||||
key: "read",
|
||||
value: function read(language, namespace, callback) {
|
||||
var nowMS = Date.now();
|
||||
if (!this.storage.store) {
|
||||
return callback(null, null);
|
||||
}
|
||||
var local = this.storage.getItem("".concat(this.options.prefix).concat(language, "-").concat(namespace));
|
||||
if (local) {
|
||||
local = JSON.parse(local);
|
||||
var version = this.getVersion(language);
|
||||
if (
|
||||
// expiration field is mandatory, and should not be expired
|
||||
local.i18nStamp && local.i18nStamp + this.options.expirationTime > nowMS &&
|
||||
// there should be no language version set, or if it is, it should match the one in translation
|
||||
version === local.i18nVersion) {
|
||||
var i18nStamp = local.i18nStamp;
|
||||
delete local.i18nVersion;
|
||||
delete local.i18nStamp;
|
||||
return callback(null, local, i18nStamp);
|
||||
}
|
||||
}
|
||||
return callback(null, null);
|
||||
}
|
||||
}, {
|
||||
key: "save",
|
||||
value: function save(language, namespace, data) {
|
||||
if (this.storage.store) {
|
||||
data.i18nStamp = Date.now();
|
||||
|
||||
// language version (if set)
|
||||
var version = this.getVersion(language);
|
||||
if (version) {
|
||||
data.i18nVersion = version;
|
||||
}
|
||||
|
||||
// save
|
||||
this.storage.setItem("".concat(this.options.prefix).concat(language, "-").concat(namespace), JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "getVersion",
|
||||
value: function getVersion(language) {
|
||||
return this.options.versions[language] || this.options.defaultVersion;
|
||||
}
|
||||
}]);
|
||||
return Cache;
|
||||
}();
|
||||
Cache.type = 'backend';
|
||||
|
||||
return Cache;
|
||||
|
||||
}));
|
||||
128
static/vendor/i18next/jquery-i18next.js
vendored
Normal file
128
static/vendor/i18next/jquery-i18next.js
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global.jqueryI18next = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
||||
|
||||
var defaults = {
|
||||
tName: 't',
|
||||
i18nName: 'i18n',
|
||||
handleName: 'localize',
|
||||
selectorAttr: 'data-i18n',
|
||||
targetAttr: 'i18n-target',
|
||||
optionsAttr: 'i18n-options',
|
||||
useOptionsAttr: false,
|
||||
parseDefaultValueFromContent: true
|
||||
};
|
||||
|
||||
function init(i18next, $) {
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
|
||||
|
||||
options = _extends({}, defaults, options);
|
||||
|
||||
function parse(ele, key, opts) {
|
||||
if (key.length === 0) return;
|
||||
|
||||
var attr = 'text';
|
||||
|
||||
if (key.indexOf('[') === 0) {
|
||||
var parts = key.split(']');
|
||||
key = parts[1];
|
||||
attr = parts[0].substr(1, parts[0].length - 1);
|
||||
}
|
||||
|
||||
if (key.indexOf(';') === key.length - 1) {
|
||||
key = key.substr(0, key.length - 2);
|
||||
}
|
||||
|
||||
function extendDefault(o, val) {
|
||||
if (!options.parseDefaultValueFromContent) return o;
|
||||
return _extends({}, o, { defaultValue: val });
|
||||
}
|
||||
|
||||
if (attr === 'html') {
|
||||
ele.html(i18next.t(key, extendDefault(opts, ele.html())));
|
||||
} else if (attr === 'text') {
|
||||
ele.text(i18next.t(key, extendDefault(opts, ele.text())));
|
||||
} else if (attr === 'prepend') {
|
||||
ele.prepend(i18next.t(key, extendDefault(opts, ele.html())));
|
||||
} else if (attr === 'append') {
|
||||
ele.append(i18next.t(key, extendDefault(opts, ele.html())));
|
||||
} else if (attr.indexOf('data-') === 0) {
|
||||
var dataAttr = attr.substr('data-'.length);
|
||||
var translated = i18next.t(key, extendDefault(opts, ele.data(dataAttr)));
|
||||
|
||||
// we change into the data cache
|
||||
ele.data(dataAttr, translated);
|
||||
// we change into the dom
|
||||
ele.attr(attr, translated);
|
||||
} else {
|
||||
ele.attr(attr, i18next.t(key, extendDefault(opts, ele.attr(attr))));
|
||||
}
|
||||
}
|
||||
|
||||
function localize(ele, opts) {
|
||||
var key = ele.attr(options.selectorAttr);
|
||||
if (!key && typeof key !== 'undefined' && key !== false) key = ele.text() || ele.val();
|
||||
if (!key) return;
|
||||
|
||||
var target = ele,
|
||||
targetSelector = ele.data(options.targetAttr);
|
||||
|
||||
if (targetSelector) target = ele.find(targetSelector) || ele;
|
||||
|
||||
if (!opts && options.useOptionsAttr === true) opts = ele.data(options.optionsAttr);
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
if (key.indexOf(';') >= 0) {
|
||||
var keys = key.split(';');
|
||||
|
||||
$.each(keys, function (m, k) {
|
||||
// .trim(): Trim the comma-separated parameters on the data-i18n attribute.
|
||||
if (k !== '') parse(target, k.trim(), opts);
|
||||
});
|
||||
} else {
|
||||
parse(target, key, opts);
|
||||
}
|
||||
|
||||
if (options.useOptionsAttr === true) {
|
||||
var clone = {};
|
||||
clone = _extends({ clone: clone }, opts);
|
||||
|
||||
delete clone.lng;
|
||||
ele.data(options.optionsAttr, clone);
|
||||
}
|
||||
}
|
||||
|
||||
function handle(opts) {
|
||||
return this.each(function () {
|
||||
// localize element itself
|
||||
localize($(this), opts);
|
||||
|
||||
// localize children
|
||||
var elements = $(this).find('[' + options.selectorAttr + ']');
|
||||
elements.each(function () {
|
||||
localize($(this), opts);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// $.t $.i18n shortcut
|
||||
$[options.tName] = i18next.t.bind(i18next);
|
||||
$[options.i18nName] = i18next;
|
||||
|
||||
// selector function $(mySelector).localize(opts);
|
||||
$.fn[options.handleName] = handle;
|
||||
}
|
||||
|
||||
var index = {
|
||||
init: init
|
||||
};
|
||||
|
||||
return index;
|
||||
|
||||
})));
|
||||
Reference in New Issue
Block a user