diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index a3ae8f83d3..b6fb04707a 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -90,6 +90,8 @@
(such as calling the low-level translate() function). -->
/src/wp-includes/l10n\.php
+ /tests/phpunit/tests/l10n\.php
+ /tests/phpunit/tests/l10n/loadTextdomainJustInTime\.php
diff --git a/src/wp-admin/credits.php b/src/wp-admin/credits.php
index be36bdb368..92073d9776 100644
--- a/src/wp-admin/credits.php
+++ b/src/wp-admin/credits.php
@@ -65,8 +65,10 @@ foreach ( $credits['groups'] as $group_slug => $group_data ) {
// Considered a special slug in the API response. (Also, will never be returned for en_US.)
$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
} elseif ( isset( $group_data['placeholders'] ) ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
} else {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$title = translate( $group_data['name'] );
}
@@ -100,6 +102,7 @@ foreach ( $credits['groups'] as $group_slug => $group_data ) {
echo '' . "\n";
echo esc_html( $person_data[0] ) . "\n\t";
if ( ! $compact ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
echo '' . translate( $person_data[3] ) . "\n";
}
echo "\n";
diff --git a/src/wp-admin/includes/import.php b/src/wp-admin/includes/import.php
index e050a43fe3..e1aac052fa 100644
--- a/src/wp-admin/includes/import.php
+++ b/src/wp-admin/includes/import.php
@@ -167,8 +167,10 @@ function wp_get_popular_importers() {
}
foreach ( $popular_importers['importers'] as &$importer ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$importer['description'] = translate( $importer['description'] );
if ( $importer['name'] != 'WordPress' ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$importer['name'] = translate( $importer['name'] );
}
}
diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
index 412c5330e4..6c7b62db93 100644
--- a/src/wp-admin/includes/plugin.php
+++ b/src/wp-admin/includes/plugin.php
@@ -137,6 +137,7 @@ function _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup
}
if ( $textdomain ) {
foreach ( array( 'Name', 'PluginURI', 'Description', 'Author', 'AuthorURI', 'Version' ) as $field ) {
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
$plugin_data[ $field ] = translate( $plugin_data[ $field ], $textdomain );
}
}
diff --git a/src/wp-content/themes/twentyeleven/comments.php b/src/wp-content/themes/twentyeleven/comments.php
index 68028598be..208806b67f 100644
--- a/src/wp-content/themes/twentyeleven/comments.php
+++ b/src/wp-content/themes/twentyeleven/comments.php
@@ -31,11 +31,20 @@
diff --git a/src/wp-content/themes/twentyten/comments.php b/src/wp-content/themes/twentyten/comments.php
index faabb40b5f..9006856323 100644
--- a/src/wp-content/themes/twentyten/comments.php
+++ b/src/wp-content/themes/twentyten/comments.php
@@ -34,11 +34,20 @@
diff --git a/src/wp-content/themes/twentythirteen/comments.php b/src/wp-content/themes/twentythirteen/comments.php
index 464235cc9e..6348145780 100644
--- a/src/wp-content/themes/twentythirteen/comments.php
+++ b/src/wp-content/themes/twentythirteen/comments.php
@@ -23,11 +23,20 @@ if ( post_password_required() ) {
diff --git a/src/wp-content/themes/twentytwelve/comments.php b/src/wp-content/themes/twentytwelve/comments.php
index 010c1aedf4..5537fc460c 100644
--- a/src/wp-content/themes/twentytwelve/comments.php
+++ b/src/wp-content/themes/twentytwelve/comments.php
@@ -29,11 +29,20 @@ if ( post_password_required() ) {
diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php
index dac1f5a55d..3881f0e033 100644
--- a/src/wp-includes/category-template.php
+++ b/src/wp-includes/category-template.php
@@ -836,12 +836,14 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
} elseif ( ! empty( $args['topic_count_text_callback'] ) ) {
// Look for the alternative callback style. Ignore the previous default.
if ( $args['topic_count_text_callback'] === 'default_topic_count_text' ) {
+ // wpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural
$translate_nooped_plural = _n_noop( '%s item', '%s items' );
} else {
$translate_nooped_plural = false;
}
} elseif ( isset( $args['single_text'] ) && isset( $args['multiple_text'] ) ) {
// If no callback exists, look for the old-style single_text and multiple_text arguments.
+ // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural
$translate_nooped_plural = _n_noop( $args['single_text'], $args['multiple_text'] );
} else {
// This is the default for when no callback, plural, or argument is passed in.
diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
index 8b9c2c8815..0bdd6a43e3 100644
--- a/src/wp-includes/class-wp-theme.php
+++ b/src/wp-includes/class-wp-theme.php
@@ -874,6 +874,7 @@ final class WP_Theme implements ArrayAccess {
if ( isset( $this->name_translated ) ) {
return $this->name_translated;
}
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
$this->name_translated = translate( $value, $this->get( 'TextDomain' ) );
return $this->name_translated;
case 'Tags':
@@ -925,6 +926,7 @@ final class WP_Theme implements ArrayAccess {
return $value;
default:
+ // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
$value = translate( $value, $this->get( 'TextDomain' ) );
}
return $value;
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index c790f3df39..66e1921ac7 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -5073,6 +5073,7 @@ function wp_timezone_choice( $selected_zone, $locale = null ) {
$exists[4] = ( $exists[1] && $exists[3] );
$exists[5] = ( $exists[2] && $exists[3] );
+ // phpcs:disable WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText
$zonen[] = array(
'continent' => ( $exists[0] ? $zone[0] : '' ),
'city' => ( $exists[1] ? $zone[1] : '' ),
@@ -5081,6 +5082,7 @@ function wp_timezone_choice( $selected_zone, $locale = null ) {
't_city' => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ),
't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ),
);
+ // phpcs:enable
}
usort( $zonen, '_wp_timezone_choice_usort_callback' );
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 565c243bbc..41fc4709a3 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -1037,6 +1037,7 @@ function register_post_status( $post_status, $args = array() ) {
}
if ( false === $args->label_count ) {
+ // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural
$args->label_count = _n_noop( $args->label, $args->label );
}