Dodano obsługę tłumaczeń i ustawienia regionalne dla języka polskiego

This commit is contained in:
2026-01-15 23:13:51 +01:00
parent e13efb0fef
commit 17fb83bb32
6 changed files with 405 additions and 41 deletions

View File

@@ -7,7 +7,7 @@ namespace inContact;
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @package inContact
* @version 0.2
*/
class AdminMenu
@@ -27,8 +27,8 @@ class AdminMenu
public function InContactAdminMenu($id)
{
add_menu_page(
"ustawienia inContact",
"inContact",
__("InContact settings", "in-contact"),
__("InContact", "in-contact"),
"manage_options",
"wp-in-contact",
[$this, "InContactSettings"],
@@ -85,33 +85,48 @@ class AdminMenu
?>
<div class="updated">
<p>Ustawienia zostały zapisane!</p>
<p><?php echo esc_html__(
"Settings saved!",
"in-contact",
); ?></p>
</div> <?php
}
?>
<div class="wrap">
<h2><span class="dashicons dashicons-email"></span> InContact - Ustawienia</h2>
<h2><span class="dashicons dashicons-email"></span> <?php echo esc_html__(
"InContact - Settings",
"in-contact",
); ?></h2>
<form method="POST">
<input type="hidden" name="updated" value="true"/>
<?php wp_nonce_field("incontact-update", "incontact-config"); ?>
<table class="form-table">
<tbody>
<tr>
<th><label for="incontact-site-key">Klucz witryny</label></th>
<th><label for="incontact-site-key"><?php echo esc_html__(
"Site key",
"in-contact",
); ?></label></th>
<td><input name="incontact-site-key" id="incontact-site-key" type="text"
value="<?php echo get_option(
"incontact-site-key",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-secret-key">Tajny klucz</label></th>
<th><label for="incontact-secret-key"><?php echo esc_html__(
"Secret key",
"in-contact",
); ?></label></th>
<td><input name="incontact-secret-key" id="incontact-secret-key" type="text"
value="<?php echo get_option(
"incontact-secret-key",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-target-mail">Adresat (email)</label></th>
<th><label for="incontact-target-mail"><?php echo esc_html__(
"Recipient (email)",
"in-contact",
); ?></label></th>
<td><input name="incontact-target-mail" id="incontact-target-mail" type="text"
value="<?php echo get_option(
"incontact-target-mail",
@@ -119,21 +134,30 @@ class AdminMenu
</tr>
<tr>
<th><label for="incontact-form-ph-name">Formularz - placeholder nazwa</label></th>
<th><label for="incontact-form-ph-name"><?php echo esc_html__(
"Form - placeholder name",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-ph-name" id="incontact-form-ph-name" type="text"
value="<?php echo get_option(
"incontact-form-ph-name",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-form-ph-email">Formularz - placeholder email</label></th>
<th><label for="incontact-form-ph-email"><?php echo esc_html__(
"Form - placeholder email",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-ph-email" id="incontact-form-ph-email" type="text"
value="<?php echo get_option(
"incontact-form-ph-email",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-form-ph-message">Formularz - placeholder wiadomość</label></th>
<th><label for="incontact-form-ph-message"><?php echo esc_html__(
"Form - placeholder message",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-ph-message" id="incontact-form-ph-message" type="text"
value="<?php echo get_option(
"incontact-form-ph-message",
@@ -141,21 +165,30 @@ class AdminMenu
</tr>
<tr>
<th><label for="incontact-form-name">Formularz - nazwa nazwa</label></th>
<th><label for="incontact-form-name"><?php echo esc_html__(
"Form - label name",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-name" id="incontact-form-name" type="text"
value="<?php echo get_option(
"incontact-form-name",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-form-email">Formularz - nazwa email</label></th>
<th><label for="incontact-form-email"><?php echo esc_html__(
"Form - label email",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-email" id="incontact-form-email" type="text"
value="<?php echo get_option(
"incontact-form-email",
); ?>" class="regular-text"/></td>
</tr>
<tr>
<th><label for="incontact-form-message">Formularz - nazwa wiadomość</label></th>
<th><label for="incontact-form-message"><?php echo esc_html__(
"Form - label message",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-message" id="incontact-form-message" type="text"
value="<?php echo get_option(
"incontact-form-message",
@@ -163,7 +196,10 @@ class AdminMenu
</tr>
<tr>
<th><label for="incontact-form-snd-ok">Formularz - wiadomość wysłana popprawnie</label></th>
<th><label for="incontact-form-snd-ok"><?php echo esc_html__(
"Form - message sent successfully",
"in-contact",
); ?></label></th>
<td><input name="incontact-form-snd-ok" id="incontact-form-snd-ok" type="text"
value="<?php echo get_option(
"incontact-form-snd-ok",
@@ -172,7 +208,11 @@ class AdminMenu
</tbody>
</table>
<p class="submit">
<input type="submit" name="submit" id="submit" class="button button-primary" value="Zapisz">
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo esc_attr__(
"Save",
"in-contact",
); ?>">
</p>
</form>
</div> <?php