Old functions tt()
and ts()
have been deprecated. Use i18nstrings()
and i18nstrings_update()
instead.
The Internationalization module provides translation services for user-defined strings. It also tracks source strings and keeps them up-to-date using a 'string key' that is a string with these elements "textgroup:object_type:object_key:property_name
".
Some examples of these 'string keys' are:
taxonomy:term:12:name
nodetype:type:story:name
For translating these strings, the module must call this function before displaying them:
/**
* Translate or update user defined string.
*
* @param $name
* Textgroup and location glued with ':'.
* @param $string
* String in default language. Default language may or may not be English.
* @param $langcode
* Optional language code if different from current request language.
*
* @return $string
* Translated string, $string if not found
*/
function i18nstrings($name, $string, $langcode = NULL) {
.....
}
For strings that have an input format, you must use the function i18nstrings_text()
that takes care of applying the correct filters if there is a translation.
/**
* Get filtered translation
*