[ 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.

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

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

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

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.

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

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

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

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

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

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

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

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

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



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref