fix(wpmc 1.0.1): remove __() from labels (no translations, fixes WP 6.7 notice)

Replace all __('...', 'wp-multi-city') calls in CPT, taxonomy, ACF field group,
and options page label arrays with literal Russian strings. The plugin ships no
.mo translation files, so wrapping labels in __() was YAGNI and triggered the
WP 6.7+ _load_textdomain_just_in_time notice.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-17 17:01:11 +05:00
parent 19409ac062
commit 949fb19e95
4 changed files with 29 additions and 29 deletions
+4 -4
View File
@@ -25,15 +25,15 @@ final class FieldGroup
'fields' => [ 'fields' => [
[ [
'key' => self::REPEATER_KEY, 'key' => self::REPEATER_KEY,
'label' => __('Подстановки по городам', 'wp-multi-city'), 'label' => 'Подстановки по городам',
'name' => 'list_shortcode', 'name' => 'list_shortcode',
'type' => 'repeater', 'type' => 'repeater',
'layout' => 'table', 'layout' => 'table',
'button_label' => __('Добавить город', 'wp-multi-city'), 'button_label' => 'Добавить город',
'sub_fields' => [ 'sub_fields' => [
[ [
'key' => 'field_wpmc_list_shortcode_town', 'key' => 'field_wpmc_list_shortcode_town',
'label' => __('Город', 'wp-multi-city'), 'label' => 'Город',
'name' => 'town', 'name' => 'town',
'type' => 'taxonomy', 'type' => 'taxonomy',
'taxonomy' => 'town', 'taxonomy' => 'town',
@@ -45,7 +45,7 @@ final class FieldGroup
], ],
[ [
'key' => 'field_wpmc_list_shortcode_text', 'key' => 'field_wpmc_list_shortcode_text',
'label' => __('Значение', 'wp-multi-city'), 'label' => 'Значение',
'name' => 'text', 'name' => 'text',
'type' => 'textarea', 'type' => 'textarea',
'rows' => 4, 'rows' => 4,
+11 -11
View File
@@ -35,7 +35,7 @@ final class OptionsPage
'fields' => [ 'fields' => [
[ [
'key' => 'field_wpmc_main_town_slug', 'key' => 'field_wpmc_main_town_slug',
'label' => __('Главный город (без префикса URL)', 'wp-multi-city'), 'label' => 'Главный город (без префикса URL)',
'name' => 'main_town_slug', 'name' => 'main_town_slug',
'type' => 'taxonomy', 'type' => 'taxonomy',
'taxonomy' => 'town', 'taxonomy' => 'town',
@@ -47,7 +47,7 @@ final class OptionsPage
], ],
[ [
'key' => 'field_wpmc_index_town_alt', 'key' => 'field_wpmc_index_town_alt',
'label' => __('Главная для других городов', 'wp-multi-city'), 'label' => 'Главная для других городов',
'name' => 'index_town_alt', 'name' => 'index_town_alt',
'type' => 'post_object', 'type' => 'post_object',
'post_type' => ['page'], 'post_type' => ['page'],
@@ -57,15 +57,15 @@ final class OptionsPage
], ],
[ [
'key' => 'field_wpmc_page_unic', 'key' => 'field_wpmc_page_unic',
'label' => __('Клоны страниц', 'wp-multi-city'), 'label' => 'Клоны страниц',
'name' => 'page_unic', 'name' => 'page_unic',
'type' => 'repeater', 'type' => 'repeater',
'layout' => 'table', 'layout' => 'table',
'button_label' => __('Добавить клон', 'wp-multi-city'), 'button_label' => 'Добавить клон',
'sub_fields' => [ 'sub_fields' => [
[ [
'key' => 'field_wpmc_page_unic_page_old', 'key' => 'field_wpmc_page_unic_page_old',
'label' => __('Оригинал', 'wp-multi-city'), 'label' => 'Оригинал',
'name' => 'page_old', 'name' => 'page_old',
'type' => 'post_object', 'type' => 'post_object',
'post_type' => ['page'], 'post_type' => ['page'],
@@ -75,7 +75,7 @@ final class OptionsPage
], ],
[ [
'key' => 'field_wpmc_page_unic_page_new', 'key' => 'field_wpmc_page_unic_page_new',
'label' => __('Клон', 'wp-multi-city'), 'label' => 'Клон',
'name' => 'page_new', 'name' => 'page_new',
'type' => 'post_object', 'type' => 'post_object',
'post_type' => ['page'], 'post_type' => ['page'],
@@ -85,7 +85,7 @@ final class OptionsPage
], ],
[ [
'key' => 'field_wpmc_page_unic_town', 'key' => 'field_wpmc_page_unic_town',
'label' => __('Город', 'wp-multi-city'), 'label' => 'Город',
'name' => 'town', 'name' => 'town',
'type' => 'taxonomy', 'type' => 'taxonomy',
'taxonomy' => 'town', 'taxonomy' => 'town',
@@ -99,18 +99,18 @@ final class OptionsPage
], ],
[ [
'key' => 'field_wpmc_page_no_rep', 'key' => 'field_wpmc_page_no_rep',
'label' => __('Исключения из роутинга', 'wp-multi-city'), 'label' => 'Исключения из роутинга',
'name' => 'page_no_rep', 'name' => 'page_no_rep',
'type' => 'repeater', 'type' => 'repeater',
'layout' => 'table', 'layout' => 'table',
'button_label' => __('Добавить исключение', 'wp-multi-city'), 'button_label' => 'Добавить исключение',
'sub_fields' => [ 'sub_fields' => [
[ [
'key' => 'field_wpmc_page_no_rep_link', 'key' => 'field_wpmc_page_no_rep_link',
'label' => __('Путь', 'wp-multi-city'), 'label' => 'Путь',
'name' => 'link', 'name' => 'link',
'type' => 'text', 'type' => 'text',
'instructions' => __('Префикс URL, например /privacy/', 'wp-multi-city'), 'instructions' => 'Префикс URL, например /privacy/',
], ],
], ],
], ],
+10 -10
View File
@@ -16,16 +16,16 @@ final class PostType
{ {
register_post_type(self::SLUG, [ register_post_type(self::SLUG, [
'labels' => [ 'labels' => [
'name' => __('Шорткоды', 'wp-multi-city'), 'name' => 'Шорткоды',
'singular_name' => __('Шорткод', 'wp-multi-city'), 'singular_name' => 'Шорткод',
'menu_name' => __('Шорткоды', 'wp-multi-city'), 'menu_name' => 'Шорткоды',
'add_new' => __('Добавить', 'wp-multi-city'), 'add_new' => 'Добавить',
'add_new_item' => __('Добавить шорткод', 'wp-multi-city'), 'add_new_item' => 'Добавить шорткод',
'edit_item' => __('Редактировать', 'wp-multi-city'), 'edit_item' => 'Редактировать',
'new_item' => __('Новый', 'wp-multi-city'), 'new_item' => 'Новый',
'view_item' => __('Смотреть', 'wp-multi-city'), 'view_item' => 'Смотреть',
'search_items' => __('Поиск', 'wp-multi-city'), 'search_items' => 'Поиск',
'not_found' => __('Не найдено', 'wp-multi-city'), 'not_found' => 'Не найдено',
], ],
'public' => false, 'public' => false,
'exclude_from_search' => true, 'exclude_from_search' => true,
+4 -4
View File
@@ -16,10 +16,10 @@ final class Taxonomy
{ {
register_taxonomy(self::SLUG, [PostType::SLUG], [ register_taxonomy(self::SLUG, [PostType::SLUG], [
'labels' => [ 'labels' => [
'name' => __('Города', 'wp-multi-city'), 'name' => 'Города',
'singular_name' => __('Город', 'wp-multi-city'), 'singular_name' => 'Город',
'menu_name' => __('Города', 'wp-multi-city'), 'menu_name' => 'Города',
'add_new_item' => __('Добавить', 'wp-multi-city'), 'add_new_item' => 'Добавить',
], ],
'public' => false, 'public' => false,
'publicly_queryable' => false, 'publicly_queryable' => false,