From 17fb83bb32c88149c2c8883f56c006cafeb62f83 Mon Sep 17 00:00:00 2001 From: Krzysztof Turek Date: Thu, 15 Jan 2026 23:13:51 +0100 Subject: [PATCH] =?UTF-8?q?Dodano=20obs=C5=82ug=C4=99=20t=C5=82umacze?= =?UTF-8?q?=C5=84=20i=20ustawienia=20regionalne=20dla=20j=C4=99zyka=20pols?= =?UTF-8?q?kiego?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- in-contact.php | 16 ++-- inc/classes/inContact/AdminMenu.php | 72 +++++++++++---- inc/classes/inContact/Init.php | 13 ++- inc/classes/inContact/Shortcode.php | 80 +++++++++++++---- languages/in-contact-pl_PL.po | 133 ++++++++++++++++++++++++++++ languages/in-contact.pot | 132 +++++++++++++++++++++++++++ 6 files changed, 405 insertions(+), 41 deletions(-) create mode 100644 languages/in-contact-pl_PL.po create mode 100644 languages/in-contact.pot diff --git a/in-contact.php b/in-contact.php index 9bed8bb..51341a4 100644 --- a/in-contact.php +++ b/in-contact.php @@ -1,26 +1,28 @@
-

Ustawienia zostały zapisane!

+

-

InContact - Ustawienia

+

- + - + - + - + - + - + - + - + - + - +
" class="regular-text"/>
" class="regular-text"/>
" class="regular-text"/>
" class="regular-text"/>
" class="regular-text"/>
" class="regular-text"/>

- + "> +

loadTextDomain(); Enqueue::getInstance(); AdminMenu::getInstance(); Shortcode::getInstance(); } -} \ No newline at end of file + private function loadTextDomain(): void + { + add_action("plugins_loaded", function (): void { + load_plugin_textdomain( + "in-contact", + false, + dirname(plugin_basename(INCONTACT_PLUGIN_FILE)) . "/languages", + ); + }); + } +} diff --git a/inc/classes/inContact/Shortcode.php b/inc/classes/inContact/Shortcode.php index 6e25da6..204810a 100644 --- a/inc/classes/inContact/Shortcode.php +++ b/inc/classes/inContact/Shortcode.php @@ -46,17 +46,25 @@ class Shortcode if (!empty($_POST["em_name"])) { $em_name = $_POST["em_name"]; } else { - $error .= "Please enter your name
"; + $error .= + esc_html__("Please enter your name", "in-contact") . + "
"; } if (!empty($_POST["em_mail"])) { $em_mail = $_POST["em_mail"]; } else { - $error .= "Please enter your email address
"; + $error .= + esc_html__( + "Please enter your email address", + "in-contact", + ) . "
"; } if (!empty($_POST["em_message"])) { $em_message = $_POST["em_message"]; } else { - $error .= "Please enter your message
"; + $error .= + esc_html__("Please enter your message", "in-contact") . + "
"; } $targetEmail = @@ -76,11 +84,25 @@ class Shortcode "From: " . $em_name . " <" . $em_mail . ">", "Reply-To: " . $em_name . " <" . $em_mail . ">", ]; - $body = ' + $emailTitle = __("New message from contact form", "in-contact"); + $emailHeading = __("Contact details", "in-contact"); + $emailNameLabel = __("Name and surname", "in-contact"); + $emailEmailLabel = __("Email", "in-contact"); + $emailMessageHeading = __("Message content", "in-contact"); + $emailReplyLabel = __("Reply to message", "in-contact"); + $emailFooter = __( + "This email was generated automatically by the website contact form.", + "in-contact", + ); + $emailRights = __("All rights reserved.", "in-contact"); + $body = + ' - Nowa wiadomość z formularza kontaktowego + ' . + esc_html($emailTitle) . + '