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
+
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) .
+ '