function countries_i18n_translate in Countries 8
Same name and namespace in other branches
- 7.2 modules/countries_i18n/countries_i18n.module \countries_i18n_translate()
Helper function to help integrate with the i18n_strings module.
Parameters
string $iso2: The country iso2 code
string $property: The property to be translated
string $string: The raw db value for the given property
string $langcode: Optional language code to override the page requested one.
string $type: Base group, defaults to 'countries'.
3 calls to countries_i18n_translate()
- countries_i18n_country_entity_label in modules/
countries_i18n/ countries_i18n.module - Providing a hook_entity_info() 'label callback' to ensure modules that use entity_label() get the correct localized country name.
- countries_i18n_field_formatter_view in modules/
countries_i18n/ countries_i18n.module - Implements hook_field_formatter_view().
- countries_t in ./
countries.module - Wrapper function to hook into the countries_i18n module.
File
- modules/
countries_i18n/ countries_i18n.module, line 119 - Provides translation for countries module.
Code
function countries_i18n_translate($iso2, $property, $string, $langcode = NULL, $type = 'country') {
$key = 'countries:' . $type . ':' . $iso2 . ':' . $property;
return i18n_string($key, $string, array(
'langcode' => $langcode,
));
}