From 05e51d48b6e07fcdc6b169ce557e175365e5383d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20ATABER?= <67821076+OmerAti@users.noreply.github.com> Date: Sat, 14 Jun 2025 16:44:05 +0300 Subject: [PATCH 01/13] Add languages.php for multi-language support This commit adds a new `languages.php` file to support internationalization (i18n). It will be used to store and manage language-specific strings for the UI. --- inc/languages.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 inc/languages.php diff --git a/inc/languages.php b/inc/languages.php new file mode 100644 index 0000000..eb9ac02 --- /dev/null +++ b/inc/languages.php @@ -0,0 +1,42 @@ + Date: Sat, 14 Jun 2025 16:46:50 +0300 Subject: [PATCH 02/13] Create en-US.php --- lang/en-US.php | 162 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 lang/en-US.php diff --git a/lang/en-US.php b/lang/en-US.php new file mode 100644 index 0000000..088d1e0 --- /dev/null +++ b/lang/en-US.php @@ -0,0 +1,162 @@ + 'English', + // Login Page + 'login_title' => 'Log in to use Admin Panel', + 'username_empty' => 'Username cannot be empty', + 'password_empty' => 'Password cannot be empty', + 'user_login_fail' => 'Incorrect login', + 'user_login_timeout' => 'Your session has timed out. Please login again to continue', + 'user_login_no_id' => 'Nothing to logout from', + 'user_login_missing' => 'Couldn\'t log you in: Missing credentials', + 'user_login_logged' => 'You have been logged out', + 'login_button' => 'Log-In', + + // Menu + 'menu_overview' => 'Overview', + 'menu_users' => 'Users', + 'menu_channels' => 'Channels', + 'menu_servers' => 'Servers', + 'a_menu_servers_bans' => 'Server Bans', + 'menu_server_ban' => 'Server Bans', + 'menu_name_bans' => 'Name Bans', + 'menu_ban_exceptions' => 'Ban Exceptions', + 'menu_spamfilter' => 'Spamfilter', + 'menu_logs' => 'Logs', + 'a_menu_tools' => 'Tools', + 'menu_ip_whois' => 'Ip Whois', + 'a_menu_settings' => 'Settings', + 'menu_general_settings' => 'General Settings', + 'menu_rpc_servers' => 'RPC Servers', + + // Requirements + 'requirements_php_version' => 'This webserver is using PHP version %s, but we require at least PHP 8.0.0.
' . + 'If you already installed PHP 8 but are still seeing this error, then it means ' . + 'apache/nginx/... is loading an older PHP version. Eg. on Debian/Ubuntu you need ' . + 'apt-get install libapache2-mod-php8.2 (or a similar version) and ' . + 'apt-get remove libapache2-mod-php7.4 (or a similar version). ' . + 'You may also need to choose again the PHP module to load in apache via a2enmod php8.2', + 'requirements_extensions_missing_title' => 'The following PHP module(s) need to be loaded:', + 'requirements_extensions_missing_cmd' => 'You need to install/enable these PHP packages and restart the webserver.
' . + 'If you are on Debian/Ubuntu then run %s and restart your webserver (eg: systemctl restart apache2 for apache).', + 'requirements_config_file_notice_1' => 'This config file is written automatically by the UnrealIRCd webpanel.', + 'requirements_config_file_notice_2' => 'You are not really supposed to edit it manually.', + 'requirements_write_config_rename_error' => 'Could not write (rename) to file %s.
', + 'requirements_config_write_error' => 'Could not write to temporary config file %s.
We need write permissions on the config/ directory!
', + 'requirements_write_config_weird' => 'Error while running write_config_file() -- weird!', + 'requirements_write_config_fwrite' => 'Error writing to config file %s (on fwrite).
', + 'requirements_write_config_fclose' => 'Error writing to config file %s (on close).
', + + // RPC Servers + 'rpc_servers_title' => 'RPC Servers', + 'rpc_servers_description_1' => 'You can configure which JSON-RPC server(s) the panel can connect to.', + 'rpc_servers_description_2' => 'You normally only need one server, but it can be useful to have multiple servers, so you can switch to a secondary server in case the primary server goes down.', + 'rpc_servers_link_panel_info' => "Let's get your panel linked to UnrealIRCd. Read the UnrealIRCd instructions and then click Add Server below.", + 'rpc_servers_delete_failed' => 'Delete failed: could not find server', + 'rpc_servers_already_exists' => 'Server with that name already exists', + 'rpc_servers_not_exist' => 'Editing a server that does not exist!?', + 'rpc_servers_added' => 'RPC Server successfully added.', + 'rpc_servers_modified' => 'RPC Server successfully modified.', + 'rpc_add_server_title' => 'Add RPC Server', + 'rpc_add_display_name' => 'Display name', + 'rpc_add_display_name_help' => 'A short display name for in the RPC server list.', + 'rpc_add_default_server' => 'Default server', + 'rpc_add_default_server_help' => 'Make this the default (primary) server that will be used for connections.', + 'rpc_add_default_hostname' => 'Hostname or IP', + 'rpc_add_default_hostname_help' => "The hostname or IP address of your UnrealIRCd server. You should use 127.0.0.1 for the same machine.", + 'rpc_add_server_port' => "Server Port", + 'rpc_add_server_port_help' => "The port which you designated for RPC connections in your unrealircd.conf", + 'rpc_add_certificate' => "Verify SSL/TLS certificate", + 'rpc_tls_verify_cert_help' => "Can only be used with hostnames, don't enable this for 127.0.0.1.", + 'rpc_add_username' => "Username", + 'rpc_add_username_help' => "The name of your rpc-user block as defined in your unrealircd.conf", + 'rpc_add_password' => "Password", + 'rpc_add_cancel' => "Cancel", + 'rpc_add_servers' => 'Add Server', + 'rpc_add_server_add' => 'Add Server', + 'rpc_add_server_edit' => 'Edit', + 'rpc_add_error_notice_1' => 'RPC Server error', + 'rpc_add_error_notice_2' => 'The RPC Server failed to connect. Check your settings and try again.', + 'rpc_add_error_no' => 'No', + 'rpc_confirm_deletion' => 'Confirm deletion', + 'rpc_confirm_deletion_notice' => 'Are you sure you want to delete this server?', + 'rpc_confirm_deletion_cancel' => 'Cancel', + 'rpc_confirm_delete_server' => 'Delete Server', + 'rpc_display_name' => 'Display name', + 'rpc_display_hostname' => 'Hostname', + 'rpc_display_port' => 'Port', + 'rpc_display_rpcuser' => 'RPC User', + + //Overview + 'unrealircd_network_overview' => 'Network Overview', + 'unrealircd_network_overview_live' => 'Live', + 'unrealircd_password_breach_title' => '
Urgent
', + 'unrealircd_password_breach_message' => 'Your password was found in a data breach %s time(s).', + 'unrealircd_password_breach_action' => 'Please update your password immediately.', + 'unrealircd_network_users_online' => 'Users Online', + 'unrealircd_network_channels' => 'Channels', + 'unrealircd_network_operators' => 'Operators', + 'unrealircd_network_view_in_users' => 'View in Users >', + 'unrealircd_network_servers' => 'Servers', + 'unrealircd_network_servers_bans' => 'Server Bans', + 'unrealircd_network_spamfilter' => 'Spamfilter', + 'unrealircd_network_server_ban_exceptions' => 'Server Ban Exceptions', + 'unrealircd_network_services_online' => 'Services Online', + 'unrealircd_network_services_view' => 'View in Servers >', + 'unrealircd_network_panel_accounts' => 'Panel Accounts', + 'unrealircd_network_panel_plugins' => 'Plugins', + + + 'unrealircd_users_overview' => 'Users Overview', + 'unrealircd_users_overview_notice' => 'Click on a username to view more information.', + 'unrealircd_users_overview_nick' => 'Nick', + 'unrealircd_users_overview_country' => 'Country', + 'unrealircd_users_overview_host_ip' => 'Host / IP', + 'unrealircd_users_overview_account' => 'Account', + 'unrealircd_users_overview_account_title' => 'The services account name, if the user identified to services.', + 'unrealircd_users_overview_oper' => 'Oper', + 'unrealircd_users_overview_connected_to' => 'Connected to', + 'unrealircd_users_overview_rep' => 'Rep.', + 'unrealircd_users_overview_rep_title' => 'The reputation score gets higher when someone with this IP address has been connected in the past weeks. A low reputation score (like <10) is an indication of a new IP.', + 'unrealircd_user_actions_apply' => 'Apply action: ', + 'unrealircd_user_actions_duration' => 'Duration: ', + 'unrealircd_user_actions_reason' => 'Reason: ', + 'unrealircd_user_actions_reason_apply' => 'Apply', + 'unrealircd_user_actions_apply_ban' => 'Apply ban', + 'unrealircd_user_actions_apply_ban_notice' => 'Are you sure you want to do this?', + 'unrealircd_user_actions_cancel' => 'Cancel', + 'unrealircd_user_actions_apply' => 'Apply', + 'unrealircd_user_view_details' => 'View details', + 'unrealircd_user_view_kill' => 'Kill', + 'unrealircd_user_view_copy' => 'Copy', + 'unrealircd_user_userch' => 'An error occured', + 'unrealircd_user_banlen_h' => 'Could not find that user: User not online', + 'unrealircd_user_kill_failed' => '%s Could not kill: %s', + + //Users Details + 'unrealircd_user_details_title' => 'User Lookup', + 'unrealircd_user_details_nonick' => 'Could not find user: %s', + 'unrealircd_user_buttongo' => 'Go', + 'unrealircd_user_basic_information' => 'Basic Information', + 'unrealircd_user_settings' => 'User Settings', + 'unrealircd_user_channels' => 'Channels', + + + + // Other + 'other_base_url' => 'The base_url was not found in your config. Setup went wrong?', + 'other_auth_provided' => 'No authentication plugin loaded. You must load either sql_db, file_db, or a similar auth plugin!', +]; From b60f8a92cb4be452a36c320e8d637d9d772dc95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20ATABER?= <67821076+OmerAti@users.noreply.github.com> Date: Sat, 14 Jun 2025 16:50:03 +0300 Subject: [PATCH 03/13] language selection Update the files needed for language selection --- inc/common.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/common.php b/inc/common.php index 84ae248..110c927 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1,4 +1,5 @@ Date: Sat, 14 Jun 2025 17:01:14 +0300 Subject: [PATCH 04/13] language selection Update the files needed for language selection --- login/index.php | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/login/index.php b/login/index.php index 78a1175..3eec531 100644 --- a/login/index.php +++ b/login/index.php @@ -16,7 +16,7 @@ if (!empty($_GET['logout'])) { if (!isset($_SESSION['id'])) - $failmsg = "Nothing to logout from"; + $failmsg = __('user_login_no_id'); else { $_SESSION = NULL; session_destroy(); @@ -25,7 +25,7 @@ } if (!empty($_GET['timeout'])) { - $failmsg = "Your session has timed out. Please login again to continue"; + $failmsg = __('user_login_timeout'); $_SESSION = NULL; session_destroy(); } @@ -71,12 +71,12 @@ "IP" => $_SERVER['REMOTE_ADDR'] ]; Hook::run(HOOKTYPE_USER_LOGIN_FAIL, $fail); - $failmsg = "Incorrect login"; + $failmsg = __('user_login_fail'); } } else - $failmsg = "Couldn't log you in: Missing credentials"; + $failmsg = __('user_login_missing'); } ?> @@ -168,12 +168,12 @@
- +
@@ -181,7 +181,7 @@
- Username cannot be empty. +
@@ -190,15 +190,39 @@
- Password cannot be empty. +
- + +
+ +
+ + + @@ -237,4 +261,3 @@ form.submit(); }); - From a859cc57215759bf3e04bfd5460fbb2c9a0bbe9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20ATABER?= <67821076+OmerAti@users.noreply.github.com> Date: Sat, 14 Jun 2025 17:12:48 +0300 Subject: [PATCH 05/13] language selection the code of the language option --- index.php | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/index.php b/index.php index cf542f6..eadc995 100644 --- a/index.php +++ b/index.php @@ -12,8 +12,8 @@ ?>
-

Network Overview

- LIVE +

+
user_meta['hibp'])) { $num = $current_user->user_meta['hibp']; - Message::Fail("
Urgent
","Your password was found in a data breach $num time(s).", - "Please update your password immediately"); +Message::Fail( + __('unrealircd_password_breach_title'), + sprintf(__('unrealircd_password_breach_message'), $num), + sprintf(__('unrealircd_password_breach_action'), get_config("base_url")) +); + } ?>