Skip to content

Commit

Permalink
Fix i18n issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Jan 21, 2025
1 parent 2e9ddc7 commit 80b6c0c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
8 changes: 4 additions & 4 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@
"invalid_password": "Invalid password",
"invalid_regex": "Invalid regex:'{regex}'",
"invalid_shell": "Invalid shell: {shell}",
"nftables_unavailable": "You cannot play with nftables here. You are either in a container or your kernel does not support it",
"ldap_attribute_already_exists": "LDAP attribute '{attribute}' already exists with value '{value}'",
"ldap_server_down": "Unable to reach LDAP server",
"ldap_server_is_down_restart_it": "The LDAP service is down, attempt to restart it…",
Expand Down Expand Up @@ -663,6 +662,7 @@
"migrations_skip_migration": "Skipping migration {id}…",
"migrations_success_forward": "Migration {id} completed",
"migrations_to_be_ran_manually": "Migration {id} has to be run manually. Please go to Tools → Migrations on the webadmin page, or run `yunohost tools migrations run`.",
"nftables_unavailable": "You cannot play with nftables here. You are either in a container or your kernel does not support it",
"not_enough_disk_space": "Not enough free space on '{path}'",
"operation_interrupted": "The operation was manually interrupted?",
"other_available_options": "… and {n} other available options not shown",
Expand Down Expand Up @@ -767,6 +767,7 @@
"service_description_dovecot": "Allows e-mail clients to access/fetch email (via IMAP and POP3)",
"service_description_fail2ban": "Protects against brute-force and other kinds of attacks from the Internet",
"service_description_mysql": "Stores app data (SQL database)",
"service_description_nftables": "Manages open and close connection ports to services",
"service_description_nginx": "Serves or provides access to all the websites hosted on your server",
"service_description_opendkim": "Signs outgoing emails using DKIM such that they are less likely to be flagged as spam",
"service_description_postfix": "Used to send and receive e-mails",
Expand All @@ -775,7 +776,6 @@
"service_description_slapd": "Stores users, domains and related info",
"service_description_ssh": "Allows you to connect remotely to your server via a terminal (SSH protocol)",
"service_description_yunohost-api": "Manages interactions between the YunoHost web interface and the system",
"service_description_nftables": "Manages open and close connection ports to services",
"service_description_yunohost-portal-api": "Manages interactions between the different user portal web interfaces and the system",
"service_description_yunomdns": "Allows you to reach your server using 'yunohost.local' in your local network",
"service_disable_failed": "Could not make the service '{service}' not start at boot.\n\nRecent service logs:{logs}",
Expand Down Expand Up @@ -831,12 +831,12 @@
"user_home_creation_failed": "Could not create home folder '{home}' for user",
"user_import_bad_file": "Your CSV file is not correctly formatted it will be ignored to avoid potential data loss",
"user_import_bad_line": "Incorrect line {line}: {details}",
"user_import_cannot_edit_or_delete_admins": "Unable to edit or delete '{user}' because user is admin",
"user_import_failed": "The users import operation completely failed",
"user_import_missing_columns": "The following columns are missing: {columns}",
"user_import_nothing_to_do": "No user needs to be imported",
"user_import_partial_failed": "The users import operation partially failed",
"user_import_success": "Users successfully imported",
"user_import_cannot_edit_or_delete_admins": "Unable to edit or delete '{user}' because user is admin",
"user_unknown": "Unknown user: {user}",
"user_update_failed": "Could not update user {user}: {error}",
"user_updated": "User info changed",
Expand All @@ -846,4 +846,4 @@
"yunohost_installing": "Installing YunoHost…",
"yunohost_not_installed": "YunoHost is not correctly installed. Please run 'yunohost tools postinstall'",
"yunohost_postinstall_end_tip": "The post-install completed! To finalize your setup, please consider:\n - diagnose potential issues through the 'Diagnosis' section of the webadmin (or 'yunohost diagnosis run' in command-line);\n - reading the 'Finalizing your setup' and 'Getting to know YunoHost' parts in the admin documentation: https://yunohost.org/admindoc."
}
}
8 changes: 0 additions & 8 deletions locales/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,16 +762,8 @@
"global_settings_setting_tls_passthrough_enabled_help": "Funtzio aurreratua da reverse-proxy erabiliz domeinu oso bat beste makina batera desbideratzeko *trafikoa deszifratu gabe*. Erabilgarria da IP berarekin makina bat baino gehiago zerbitzatu nahi dituzunean, makina bakoitzak dagozkion SSL amaierak kudeatzeko aukera mantenduz.",
"global_settings_setting_tls_passthrough_list": "Birbidalketen zerrenda",
"global_settings_setting_tls_passthrough_list_help": "Zerrendak DOMEINUA;HELBURUA;ATAKA egitura izan behar du. Adibidez: domeinua.eus;192.168.1.42;443 edo domeinua.eus;zerbitzaria.local;8123",
<<<<<<< HEAD
"global_settings_setting_tls_passthrough_explain": "Ezaugarri hau AURRERATUA eta ESPERIMENTALA da, eta aldaketa handiak eragingo ditu zerbitzari honen nginx konfigurazioan. EZ erabili ez badakizu zertan ari zaren! Kontuan izan fail2ban ezin dela inplementatu proxy atzeko zerbitzarian (iptables-ek ezin dute trafiko maltzurra debekatu, IP pakete guztiak zerbitzari nagusitik datozelaren itxura dutelako). Horrez gain, oraingoz, proxy atzeko zerbitzariaren nginx konfigurazioa eskuz moldatu behar da `proxy_protocol` onartzeko.",
"confirm_tos_acknowledgement": "Zerbitzu-baldintzak irakurri eta ulertzen ditut [{answers}]",
||||||| parent of 0c756e32 (iptables to nftables: Update translations)
"global_settings_setting_tls_passthrough_explain": "Ezaugarri hau AURRERATUA eta ESPERIMENTALA da, eta aldaketa handiak eragingo ditu zerbitzari honen nginx konfigurazioan. EZ erabili ez badakizu zertan ari zaren! Kontuan izan fail2ban ezin dela inplementatu proxy atzeko zerbitzarian (iptables-ek ezin dute trafiko maltzurra debekatu, IP pakete guztiak zerbitzari nagusitik datozelaren itxura dutelako). Horrez gain, oraingoz, proxy atzeko zerbitzariaren nginx konfigurazioa eskuz moldatu behar da `proxy_protocol` onartzeko.",
"confirm_tos_acknowledgement": "Zerbitzuen Baldintzak irakurri eta ulertzen ditut [{answers}]",
=======
"global_settings_setting_tls_passthrough_explain": "Ezaugarri hau AURRERATUA eta ESPERIMENTALA da, eta aldaketa handiak eragingo ditu zerbitzari honen nginx konfigurazioan. EZ erabili ez badakizu zertan ari zaren! Kontuan izan fail2ban ezin dela inplementatu proxy atzeko zerbitzarian (nftables-ek ezin dute trafiko maltzurra debekatu, IP pakete guztiak zerbitzari nagusitik datozelaren itxura dutelako). Horrez gain, oraingoz, proxy atzeko zerbitzariaren nginx konfigurazioa eskuz moldatu behar da `proxy_protocol` onartzeko.",
"confirm_tos_acknowledgement": "Zerbitzuen Baldintzak irakurri eta ulertzen ditut [{answers}]",
>>>>>>> 0c756e32 (iptables to nftables: Update translations)
"domain_config_cert_name": "Ziurtagiria",
"domain_config_custom_css": "CSS estilo-orri pertsonalizatua",
"domain_config_dns_name": "DNSa",
Expand Down
2 changes: 1 addition & 1 deletion maintenance/missing_i18n_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def find_expected_string_keys():
# For all unit operations, expect to find "log_<name>"
# A unit operation is created either using the @is_unit_operation decorator
# or using OperationLogger(
cmd = f"grep -hr '@is_unit_operation' {ROOT}/src/ -A3 2>/dev/null | grep '^def' | sed -E 's@^def (\\w+)\\(.*@\\1@g'"
cmd = f"grep -hr '@is_unit_operation([^f]' {ROOT}/src/ -A3 2>/dev/null | grep '^def' | sed -E 's@^def (\\w+)\\(.*@\\1@g'"
for funcname in (
subprocess.check_output(cmd, shell=True).decode("utf-8").strip().split("\n")
):
Expand Down
35 changes: 18 additions & 17 deletions src/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,24 +891,25 @@ def close(self, error=None):
self.logger.removeHandler(self.sse_handler)
self.sse_handler.close()

is_api = Moulinette.interface.type == "api"
desc = _get_description_from_name(self.name)
if error is None:
if is_api:
msg = m18n.n("log_link_to_log", name=self.name, desc=desc)
else:
msg = m18n.n("log_help_to_get_log", name=self.name, desc=desc)
logger.debug(msg)
else:
if is_api:
msg = (
"<strong>"
+ m18n.n("log_link_to_failed_log", name=self.name, desc=desc)
+ "</strong>"
)
if not self.flash:
is_api = Moulinette.interface.type == "api"
desc = _get_description_from_name(self.name)
if error is None:
if is_api:
msg = m18n.n("log_link_to_log", name=self.name, desc=desc)
else:
msg = m18n.n("log_help_to_get_log", name=self.name, desc=desc)
logger.debug(msg)
else:
msg = m18n.n("log_help_to_get_failed_log", name=self.name, desc=desc)
logger.info(msg)
if is_api:
msg = (
"<strong>"
+ m18n.n("log_link_to_failed_log", name=self.name, desc=desc)
+ "</strong>"
)
else:
msg = m18n.n("log_help_to_get_failed_log", name=self.name, desc=desc)
logger.info(msg)
self.flush()
return msg

Expand Down

0 comments on commit 80b6c0c

Please sign in to comment.