feat(09-01): wrap admin and infrastructure strings in gettext functions
- CPT labels: wrap all 13 labels in __() with English source strings - Admin menu: wrap menu titles (Moving List, Entries, Settings) in __() - Settings page: wrap all section titles, field labels, and descriptions with appropriate gettext functions - Date helpers: wrap Day, Month, Year labels in esc_html__() - All strings use English as source language per i18n strategy - Text domain 'siegel-umzugsliste' applied throughout - German translations will be provided in .po file (Plan 02)
This commit is contained in:
@@ -41,8 +41,8 @@ class Umzugsliste_Admin_Menu {
|
||||
public function register_menu() {
|
||||
// Add top-level menu
|
||||
add_menu_page(
|
||||
'Umzugsliste', // Page title
|
||||
'Umzugsliste', // Menu title
|
||||
__( 'Moving List', 'siegel-umzugsliste' ), // Page title
|
||||
__( 'Moving List', 'siegel-umzugsliste' ), // Menu title
|
||||
'edit_posts', // Capability
|
||||
'umzugsliste', // Menu slug
|
||||
array( $this, 'entries_page' ), // Callback
|
||||
@@ -53,8 +53,8 @@ class Umzugsliste_Admin_Menu {
|
||||
// Add Einträge submenu (CPT list)
|
||||
add_submenu_page(
|
||||
'umzugsliste', // Parent slug
|
||||
'Einträge', // Page title
|
||||
'Einträge', // Menu title
|
||||
__( 'Entries', 'siegel-umzugsliste' ), // Page title
|
||||
__( 'Entries', 'siegel-umzugsliste' ), // Menu title
|
||||
'edit_posts', // Capability
|
||||
'edit.php?post_type=umzugsliste_entry' // Menu slug (link to CPT)
|
||||
);
|
||||
@@ -62,8 +62,8 @@ class Umzugsliste_Admin_Menu {
|
||||
// Add Einstellungen submenu
|
||||
add_submenu_page(
|
||||
'umzugsliste', // Parent slug
|
||||
'Einstellungen', // Page title
|
||||
'Einstellungen', // Menu title
|
||||
__( 'Settings', 'siegel-umzugsliste' ), // Page title
|
||||
__( 'Settings', 'siegel-umzugsliste' ), // Menu title
|
||||
'edit_posts', // Capability
|
||||
'umzugsliste-settings', // Menu slug
|
||||
array( $this, 'settings_page' ) // Callback
|
||||
|
||||
@@ -40,19 +40,19 @@ class Umzugsliste_CPT {
|
||||
*/
|
||||
public function register_post_type() {
|
||||
$labels = array(
|
||||
'name' => 'Einträge',
|
||||
'singular_name' => 'Eintrag',
|
||||
'menu_name' => 'Einträge',
|
||||
'name_admin_bar' => 'Eintrag',
|
||||
'add_new' => 'Neu hinzufügen',
|
||||
'add_new_item' => 'Neuen Eintrag hinzufügen',
|
||||
'new_item' => 'Neuer Eintrag',
|
||||
'edit_item' => 'Eintrag bearbeiten',
|
||||
'view_item' => 'Eintrag ansehen',
|
||||
'all_items' => 'Alle Einträge',
|
||||
'search_items' => 'Einträge durchsuchen',
|
||||
'not_found' => 'Keine Einträge gefunden',
|
||||
'not_found_in_trash' => 'Keine Einträge im Papierkorb gefunden',
|
||||
'name' => __( 'Entries', 'siegel-umzugsliste' ),
|
||||
'singular_name' => __( 'Entry', 'siegel-umzugsliste' ),
|
||||
'menu_name' => __( 'Entries', 'siegel-umzugsliste' ),
|
||||
'name_admin_bar' => __( 'Entry', 'siegel-umzugsliste' ),
|
||||
'add_new' => __( 'Add New', 'siegel-umzugsliste' ),
|
||||
'add_new_item' => __( 'Add New Entry', 'siegel-umzugsliste' ),
|
||||
'new_item' => __( 'New Entry', 'siegel-umzugsliste' ),
|
||||
'edit_item' => __( 'Edit Entry', 'siegel-umzugsliste' ),
|
||||
'view_item' => __( 'View Entry', 'siegel-umzugsliste' ),
|
||||
'all_items' => __( 'All Entries', 'siegel-umzugsliste' ),
|
||||
'search_items' => __( 'Search Entries', 'siegel-umzugsliste' ),
|
||||
'not_found' => __( 'No entries found', 'siegel-umzugsliste' ),
|
||||
'not_found_in_trash' => __( 'No entries found in Trash', 'siegel-umzugsliste' ),
|
||||
);
|
||||
|
||||
$args = array(
|
||||
|
||||
@@ -27,7 +27,7 @@ class Umzugsliste_Date_Helpers {
|
||||
$selected = (int) current_time( 'j' );
|
||||
}
|
||||
|
||||
$html = '<div class="small-4 columns"><label>Tag</label><select name="day" class="Stil2">';
|
||||
$html = '<div class="small-4 columns"><label>' . esc_html__( 'Day', 'siegel-umzugsliste' ) . '</label><select name="day" class="Stil2">';
|
||||
|
||||
for ( $i = 1; $i <= 31; $i++ ) {
|
||||
$sel = ( $i === $selected ) ? ' selected' : '';
|
||||
@@ -50,7 +50,7 @@ class Umzugsliste_Date_Helpers {
|
||||
$selected = (int) current_time( 'n' );
|
||||
}
|
||||
|
||||
$html = '<div class="small-4 columns"><label>Monat</label><select name="month" class="Stil2">';
|
||||
$html = '<div class="small-4 columns"><label>' . esc_html__( 'Month', 'siegel-umzugsliste' ) . '</label><select name="month" class="Stil2">';
|
||||
|
||||
for ( $i = 1; $i <= 12; $i++ ) {
|
||||
$sel = ( $i === $selected ) ? ' selected' : '';
|
||||
@@ -73,7 +73,7 @@ class Umzugsliste_Date_Helpers {
|
||||
$selected = (int) current_time( 'Y' );
|
||||
}
|
||||
|
||||
$html = '<div class="small-4 columns"><label>Jahr</label><select name="year" class="Stil2">';
|
||||
$html = '<div class="small-4 columns"><label>' . esc_html__( 'Year', 'siegel-umzugsliste' ) . '</label><select name="year" class="Stil2">';
|
||||
|
||||
// Show current year plus 15 years (matching legacy)
|
||||
$current_year = (int) current_time( 'Y' );
|
||||
|
||||
@@ -97,7 +97,7 @@ class Umzugsliste_Settings {
|
||||
// Add Email Settings section
|
||||
add_settings_section(
|
||||
'umzugsliste_email_section',
|
||||
'Email-Einstellungen',
|
||||
__( 'Email Settings', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_email_section_description' ),
|
||||
'umzugsliste_settings'
|
||||
);
|
||||
@@ -105,7 +105,7 @@ class Umzugsliste_Settings {
|
||||
// Add receiver email field
|
||||
add_settings_field(
|
||||
'umzugsliste_receiver_email',
|
||||
'Empfänger-E-Mail',
|
||||
__( 'Receiver Email', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_receiver_email_field' ),
|
||||
'umzugsliste_settings',
|
||||
'umzugsliste_email_section'
|
||||
@@ -114,7 +114,7 @@ class Umzugsliste_Settings {
|
||||
// Add Captcha Settings section
|
||||
add_settings_section(
|
||||
'umzugsliste_captcha_section',
|
||||
'Captcha-Einstellungen',
|
||||
__( 'Captcha Settings', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_captcha_section_description' ),
|
||||
'umzugsliste_settings'
|
||||
);
|
||||
@@ -122,7 +122,7 @@ class Umzugsliste_Settings {
|
||||
// Add captcha provider field
|
||||
add_settings_field(
|
||||
'umzugsliste_captcha_provider',
|
||||
'Captcha-Anbieter',
|
||||
__( 'Captcha Provider', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_captcha_provider_field' ),
|
||||
'umzugsliste_settings',
|
||||
'umzugsliste_captcha_section'
|
||||
@@ -149,7 +149,7 @@ class Umzugsliste_Settings {
|
||||
// Add Form Settings section
|
||||
add_settings_section(
|
||||
'umzugsliste_form_section',
|
||||
'Formular-Einstellungen',
|
||||
__( 'Form Settings', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_form_section_description' ),
|
||||
'umzugsliste_settings'
|
||||
);
|
||||
@@ -157,7 +157,7 @@ class Umzugsliste_Settings {
|
||||
// Add thank you URL field
|
||||
add_settings_field(
|
||||
'umzugsliste_thankyou_url',
|
||||
'Danke-Seite URL',
|
||||
__( 'Thank You Page URL', 'siegel-umzugsliste' ),
|
||||
array( $this, 'render_thankyou_url_field' ),
|
||||
'umzugsliste_settings',
|
||||
'umzugsliste_form_section'
|
||||
@@ -175,21 +175,21 @@ class Umzugsliste_Settings {
|
||||
* Email section description
|
||||
*/
|
||||
public function render_email_section_description() {
|
||||
echo '<p>Konfigurieren Sie die E-Mail-Adresse für Formularanfragen.</p>';
|
||||
echo '<p>' . esc_html__( 'Configure the email address for form inquiries.', 'siegel-umzugsliste' ) . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Captcha section description
|
||||
*/
|
||||
public function render_captcha_section_description() {
|
||||
echo '<p>Wählen Sie einen Captcha-Anbieter zum Schutz vor Spam.</p>';
|
||||
echo '<p>' . esc_html__( 'Choose a captcha provider to protect against spam.', 'siegel-umzugsliste' ) . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Form section description
|
||||
*/
|
||||
public function render_form_section_description() {
|
||||
echo '<p>Konfigurieren Sie das Verhalten des Formulars.</p>';
|
||||
echo '<p>' . esc_html__( 'Configure the form behavior.', 'siegel-umzugsliste' ) . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +199,7 @@ class Umzugsliste_Settings {
|
||||
$value = get_option( 'umzugsliste_receiver_email', '' );
|
||||
?>
|
||||
<input type="email" name="umzugsliste_receiver_email" value="<?php echo esc_attr( $value ); ?>" class="regular-text" required />
|
||||
<p class="description">Die E-Mail-Adresse, an die Formularanfragen gesendet werden.</p>
|
||||
<p class="description"><?php echo esc_html__( 'The email address where form inquiries will be sent.', 'siegel-umzugsliste' ); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -210,12 +210,12 @@ class Umzugsliste_Settings {
|
||||
$value = get_option( 'umzugsliste_captcha_provider', 'none' );
|
||||
?>
|
||||
<select name="umzugsliste_captcha_provider" id="umzugsliste_captcha_provider">
|
||||
<option value="none" <?php selected( $value, 'none' ); ?>>Kein Captcha</option>
|
||||
<option value="none" <?php selected( $value, 'none' ); ?>><?php echo esc_html__( 'No Captcha', 'siegel-umzugsliste' ); ?></option>
|
||||
<option value="recaptcha_v2" <?php selected( $value, 'recaptcha_v2' ); ?>>reCAPTCHA v2</option>
|
||||
<option value="recaptcha_v3" <?php selected( $value, 'recaptcha_v3' ); ?>>reCAPTCHA v3</option>
|
||||
<option value="hcaptcha" <?php selected( $value, 'hcaptcha' ); ?>>hCaptcha</option>
|
||||
</select>
|
||||
<p class="description">Wählen Sie einen Captcha-Dienst oder deaktivieren Sie Captcha.</p>
|
||||
<p class="description"><?php echo esc_html__( 'Choose a captcha service or disable captcha.', 'siegel-umzugsliste' ); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class Umzugsliste_Settings {
|
||||
?>
|
||||
<div id="captcha_site_key_wrapper" style="display: <?php echo esc_attr( $display ); ?>;">
|
||||
<input type="text" name="umzugsliste_captcha_site_key" value="<?php echo esc_attr( $value ); ?>" class="regular-text" />
|
||||
<p class="description">Der Site Key von Ihrem Captcha-Anbieter.</p>
|
||||
<p class="description"><?php echo esc_html__( 'The site key from your captcha provider.', 'siegel-umzugsliste' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -244,7 +244,7 @@ class Umzugsliste_Settings {
|
||||
?>
|
||||
<div id="captcha_secret_key_wrapper" style="display: <?php echo esc_attr( $display ); ?>;">
|
||||
<input type="text" name="umzugsliste_captcha_secret_key" value="<?php echo esc_attr( $value ); ?>" class="regular-text" />
|
||||
<p class="description">Der Secret Key von Ihrem Captcha-Anbieter.</p>
|
||||
<p class="description"><?php echo esc_html__( 'The secret key from your captcha provider.', 'siegel-umzugsliste' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -256,7 +256,7 @@ class Umzugsliste_Settings {
|
||||
$value = get_option( 'umzugsliste_thankyou_url', home_url() );
|
||||
?>
|
||||
<input type="url" name="umzugsliste_thankyou_url" value="<?php echo esc_attr( $value ); ?>" class="regular-text" />
|
||||
<p class="description">Die URL, zu der nach erfolgreicher Formularübermittlung weitergeleitet wird.</p>
|
||||
<p class="description"><?php echo esc_html__( 'The URL to redirect to after successful form submission.', 'siegel-umzugsliste' ); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ class Umzugsliste_Settings {
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1>Umzugsliste Einstellungen</h1>
|
||||
<h1><?php echo esc_html__( 'Moving List Settings', 'siegel-umzugsliste' ); ?></h1>
|
||||
<?php settings_errors(); ?>
|
||||
<form method="post" action="options.php">
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user