Created
April 10, 2013 13:58
-
-
Save karelbemelmans/5354893 to your computer and use it in GitHub Desktop.
tc()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add context 'custom' to your translation strings. | |
* | |
* @param $string | |
* A string containing the English string to translate. | |
* @param $args | |
* An associative array of replacements to make after translation. Based | |
* on the first character of the key, the value is escaped and/or themed. | |
* See format_string() for details. | |
* @param $options | |
* An associative array of additional options, with the following elements: | |
* - 'langcode' (defaults to the current language): The language code to | |
* translate to a language other than what is used to display the page. | |
* - 'context' (defaults to the empty context): The context the source string | |
* belongs to. | |
* | |
* @return | |
* The translated string. | |
*/ | |
function tc($string, $args = array(), $options = array()) { | |
$options['context'] = 'custom'; | |
return t($string, $args, $options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment