Core Class
View Source on Trac ↗
Core Class
WP_Translation_File
class WP_Translation_File
// Constructor: function Object() { [native code] } Class WP_Translation_File.
Methods 14 methods
| Method / Return | Description |
|---|---|
| __construct() void | Constructor.
Parameters: $file: string |
| create() (false | Creates a new WP_Translation_File instance for a given file.
Parameters: $file: string, $filetype: ?string |
| transform() (string | Creates a new WP_Translation_File instance for a given file.
Parameters: $file: string, $filetype: string |
| headers() array<string, | Returns all headers. |
| entries() array<string, | Returns all entries. |
| error() (string | Returns the current error information. |
| get_file() string | Returns the file name. |
| translate() (false | Translates a given string.
Parameters: $text: string |
| get_plural_form() int | Returns the plural form for a given number.
Parameters: $number: int |
| get_plural_expression_from_header() string | Returns the plural forms expression as a tuple.
Parameters: $header: string |
| make_plural_form_function() callable(int | Makes a function, which will return the right translation index, according to the
Parameters: $expression: string |
| import() bool | Imports translations from another file.
Parameters: $source: WP_Translation_File |
| parse_file() void | Parses the file. |
| export() string | Exports translation contents as a string. |
Properties
| Property / Type | Description |
|---|---|
| $headers mixed public | No description available. |
| $parsed mixed public | No description available. |
| $error mixed public | No description available. |
| $file mixed public | No description available. |
| $entries mixed public | No description available. |
| $plural_forms mixed public | No description available. |
Class Information
Since Version
6.5.0
Source File
wp-includes/l10n/class-wp-translation-file.php
Advertisement