[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/l10n/ -> class-wp-translation-file.php (summary)

I18N: WP_Translation_File class.

File Size: 312 lines (6 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 12 functions

  __construct()
  create()
  transform()
  headers()
  entries()
  error()
  get_file()
  translate()
  get_plural_form()
  get_plural_expression_from_header()
  make_plural_form_function()
  import()

Functions
Functions that are not part of a class:

__construct( string $file )   X-Ref
Constructor.

param: string $file File to load.

create( string $file, ?string $filetype = null )   X-Ref
Creates a new WP_Translation_File instance for a given file.

return: false|WP_Translation_File
param: string      $file     File name.
param: string|null $filetype Optional. File type. Default inferred from file name.

transform( string $file, string $filetype )   X-Ref
Creates a new WP_Translation_File instance for a given file.

return: string|false Transformed translation file contents on success, false otherwise.
param: string $file     Source file name.
param: string $filetype Desired target file type.

headers()   X-Ref
Returns all headers.

return: array<string, string> Headers.

entries()   X-Ref
Returns all entries.

return: array<string, string[]> Entries.

error()   X-Ref
Returns the current error information.

return: string|null Error message or null if no error.

get_file()   X-Ref
Returns the file name.

return: string File name.

translate( string $text )   X-Ref
Translates a given string.

return: false|string Translation(s) on success, false otherwise.
param: string $text String to translate.

get_plural_form( int $number )   X-Ref
Returns the plural form for a given number.

return: int Plural form.
param: int $number Count.

get_plural_expression_from_header( string $header )   X-Ref
Returns the plural forms expression as a tuple.

return: string Plural forms expression.
param: string $header Plural-Forms header string.

make_plural_form_function( string $expression )   X-Ref
Makes a function, which will return the right translation index, according to the
plural forms header.

return: callable(int $num): int Plural forms function.
param: string $expression Plural form expression.

import( WP_Translation_File $source )   X-Ref
Imports translations from another file.

return: bool True on success, false otherwise.
param: WP_Translation_File $source Source file.



Generated : Sun Apr 28 08:20:02 2024 Cross-referenced by PHPXref