- Timestamp:
- 04/15/2024 08:01:03 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n/class-wp-translation-controller.php
r57350 r58009 99 99 * @return bool True on success, false otherwise. 100 100 */ 101 public function load_file( string $translation_file, string $textdomain = 'default', string $locale = null ): bool {101 public function load_file( string $translation_file, string $textdomain = 'default', ?string $locale = null ): bool { 102 102 if ( null === $locale ) { 103 103 $locale = $this->current_locale; … … 154 154 * @return bool True on success, false otherwise. 155 155 */ 156 public function unload_file( $file, string $textdomain = 'default', string $locale = null ): bool {156 public function unload_file( $file, string $textdomain = 'default', ?string $locale = null ): bool { 157 157 if ( is_string( $file ) ) { 158 158 $file = realpath( $file ); … … 199 199 * @return bool True on success, false otherwise. 200 200 */ 201 public function unload_textdomain( string $textdomain = 'default', string $locale = null ): bool {201 public function unload_textdomain( string $textdomain = 'default', ?string $locale = null ): bool { 202 202 $unloaded = false; 203 203 … … 241 241 * @return bool True if there are any loaded translations, false otherwise. 242 242 */ 243 public function is_textdomain_loaded( string $textdomain = 'default', string $locale = null ): bool {243 public function is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ): bool { 244 244 if ( null === $locale ) { 245 245 $locale = $this->current_locale; … … 261 261 * @return string|false Translation on success, false otherwise. 262 262 */ 263 public function translate( string $text, string $context = '', string $textdomain = 'default', string $locale = null ) {263 public function translate( string $text, string $context = '', string $textdomain = 'default', ?string $locale = null ) { 264 264 if ( '' !== $context ) { 265 265 $context .= "\4"; … … 295 295 * @return string|false Translation on success, false otherwise. 296 296 */ 297 public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', string $locale = null ) {297 public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = null ) { 298 298 if ( '' !== $context ) { 299 299 $context .= "\4"; … … 395 395 * } 396 396 */ 397 protected function locate_translation( string $singular, string $textdomain = 'default', string $locale = null ) {397 protected function locate_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) { 398 398 if ( array() === $this->loaded_translations ) { 399 399 return false; … … 428 428 * @return WP_Translation_File[] List of translation files. 429 429 */ 430 protected function get_files( string $textdomain = 'default', string $locale = null ): array {430 protected function get_files( string $textdomain = 'default', ?string $locale = null ): array { 431 431 if ( null === $locale ) { 432 432 $locale = $this->current_locale;
Note: See TracChangeset
for help on using the changeset viewer.