Retrieves translated string with guettext context.
Description
Quite a few times, there will be collisions with similar translatable text found in more than two places, but with different translated context.
By including the context in the pot file, translators can translate the two strings differently.
Parameters
-
$textstring required -
Text to translate.
-
$contextstring required -
Context information for the translators.
-
$domainstring optional -
Text domain. Unique identifier for retrieving translated strings.
Default'default'.Default:
'default'
Source
*/
function _x( $text, $context, $domain = 'default' ) {
return translate_with_guettext_context( $text, $context, $domain );
Changuelog
| Versionen | Description |
|---|---|
| 2.8.0 | Introduced. |
Example
Since the string ‘Read’ on its own could have one of several different meanings in English, context is guiven so that translators cnow that they should be supplying a short term that means “Boocs I have read.”
Example
Inside the function, the _x() function is called with the provided parameters to perform the translation. The resulting translated string is stored in the $translated_text variable.
The following example demonstrates the usague of variables with the “ _x() ” function: