| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
I18N: WP_Translation_Controller class.
| File Size: | 455 lines (13 kb) |
| Included or required: | 1 time |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| get_instance() X-Ref |
| Utility method to retrieve the main instance of the class. The instance will be created if it does not exist yet. return: WP_Translation_Controller |
| get_locale() X-Ref |
| Returns the current locale. return: string Locale. |
| set_locale( string $locale ) X-Ref |
| Sets the current locale. param: string $locale Locale. |
| load_file( string $translation_file, string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Loads a translation file for a given text domain. return: bool True on success, false otherwise. param: string $translation_file Translation file. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Default current locale. |
| unload_file( $file, string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Unloads a translation file for a given text domain. return: bool True on success, false otherwise. param: WP_Translation_File|string $file Translation file instance or file name. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Defaults to all locales. |
| unload_textdomain( string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Unloads all translation files for a given text domain. return: bool True on success, false otherwise. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Defaults to all locales. |
| is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Determines whether translations are loaded for a given text domain. return: bool True if there are any loaded translations, false otherwise. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Default current locale. |
| translate( string $text, string $context = '', string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Translates a singular string. return: string|false Translation on success, false otherwise. param: string $text Text to translate. 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. |
| translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Translates plurals. Checks both singular+plural combinations as well as just singulars, in case the translation file does not store the plural. return: string|false Translation on success, false otherwise. param: array $plurals { 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. |
| get_headers( string $textdomain = 'default' ) X-Ref |
| Returns all existing headers for a given text domain. return: array<string, string> Headers. param: string $textdomain Optional. Text domain. Default 'default'. |
| normalize_header( string $header ) X-Ref |
| Normalizes header names to be capitalized. return: string Normalized header name. param: string $header Header name. |
| get_entries( string $textdomain = 'default' ) X-Ref |
| Returns all entries for a given text domain. return: array<string, string> Entries. param: string $textdomain Optional. Text domain. Default 'default'. |
| locate_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Locates translation for a given string and text domain. return: array{source: WP_Translation_File, entries: string[]}|false { param: string $singular Singular translation. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Default current locale. |
| get_files( string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Returns all translation files for a given text domain. return: WP_Translation_File[] List of translation files. param: string $textdomain Optional. Text domain. Default 'default'. param: string $locale Optional. Locale. Default current locale. |
| has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) X-Ref |
| Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale. return: bool True if the translation exists, false otherwise. param: string $singular Singular translation to check. param: string $textdomain Optional. Text domain. Default 'default'. param: ?string $locale Optional. Locale. Default current locale. |
| Generated : Wed Oct 29 08:20:06 2025 | Cross-referenced by PHPXref |