summaryrefslogtreecommitdiffstats
path: root/wp-includes/l10n
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/l10n')
-rw-r--r--wp-includes/l10n/class-wp-translation-controller.php26
-rw-r--r--wp-includes/l10n/class-wp-translation-file.php2
2 files changed, 14 insertions, 14 deletions
diff --git a/wp-includes/l10n/class-wp-translation-controller.php b/wp-includes/l10n/class-wp-translation-controller.php
index b44384c..295e3fc 100644
--- a/wp-includes/l10n/class-wp-translation-controller.php
+++ b/wp-includes/l10n/class-wp-translation-controller.php
@@ -98,7 +98,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Default current locale.
* @return bool True on success, false otherwise.
*/
- public function load_file( string $translation_file, string $textdomain = 'default', string $locale = null ): bool {
+ public function load_file( string $translation_file, string $textdomain = 'default', ?string $locale = null ): bool {
if ( null === $locale ) {
$locale = $this->current_locale;
}
@@ -153,7 +153,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Defaults to all locales.
* @return bool True on success, false otherwise.
*/
- public function unload_file( $file, string $textdomain = 'default', string $locale = null ): bool {
+ public function unload_file( $file, string $textdomain = 'default', ?string $locale = null ): bool {
if ( is_string( $file ) ) {
$file = realpath( $file );
}
@@ -198,7 +198,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Defaults to all locales.
* @return bool True on success, false otherwise.
*/
- public function unload_textdomain( string $textdomain = 'default', string $locale = null ): bool {
+ public function unload_textdomain( string $textdomain = 'default', ?string $locale = null ): bool {
$unloaded = false;
if ( null !== $locale ) {
@@ -240,7 +240,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Default current locale.
* @return bool True if there are any loaded translations, false otherwise.
*/
- public function is_textdomain_loaded( string $textdomain = 'default', string $locale = null ): bool {
+ public function is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ): bool {
if ( null === $locale ) {
$locale = $this->current_locale;
}
@@ -260,7 +260,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Default current locale.
* @return string|false Translation on success, false otherwise.
*/
- public function translate( string $text, string $context = '', string $textdomain = 'default', string $locale = null ) {
+ public function translate( string $text, string $context = '', string $textdomain = 'default', ?string $locale = null ) {
if ( '' !== $context ) {
$context .= "\4";
}
@@ -282,19 +282,19 @@ final class WP_Translation_Controller {
*
* @since 6.5.0
*
- * @param array{0: string, 1: string} $plurals {
+ * @param array $plurals {
* Pair of singular and plural translations.
*
* @type string $0 Singular translation.
* @type string $1 Plural translation.
* }
- * @param int $number Number of items.
- * @param string $context Optional. Context for the string. Default empty string.
- * @param string $textdomain Optional. Text domain. Default 'default'.
- * @param string $locale Optional. Locale. Default current locale.
+ * @param int $number Number of items.
+ * @param string $context Optional. Context for the string. Default empty string.
+ * @param string $textdomain Optional. Text domain. Default 'default'.
+ * @param string|null $locale Optional. Locale. Default current locale.
* @return string|false Translation on success, false otherwise.
*/
- public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', string $locale = null ) {
+ public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = null ) {
if ( '' !== $context ) {
$context .= "\4";
}
@@ -394,7 +394,7 @@ final class WP_Translation_Controller {
* @type string[] $entries Array of translation entries.
* }
*/
- protected function locate_translation( string $singular, string $textdomain = 'default', string $locale = null ) {
+ protected function locate_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) {
if ( array() === $this->loaded_translations ) {
return false;
}
@@ -427,7 +427,7 @@ final class WP_Translation_Controller {
* @param string $locale Optional. Locale. Default current locale.
* @return WP_Translation_File[] List of translation files.
*/
- protected function get_files( string $textdomain = 'default', string $locale = null ): array {
+ protected function get_files( string $textdomain = 'default', ?string $locale = null ): array {
if ( null === $locale ) {
$locale = $this->current_locale;
}
diff --git a/wp-includes/l10n/class-wp-translation-file.php b/wp-includes/l10n/class-wp-translation-file.php
index e550f9c..199fdca 100644
--- a/wp-includes/l10n/class-wp-translation-file.php
+++ b/wp-includes/l10n/class-wp-translation-file.php
@@ -81,7 +81,7 @@ abstract class WP_Translation_File {
* @param string|null $filetype Optional. File type. Default inferred from file name.
* @return false|WP_Translation_File
*/
- public static function create( string $file, string $filetype = null ) {
+ public static function create( string $file, ?string $filetype = null ) {
if ( ! is_readable( $file ) ) {
return false;
}