You are here

public function i18n_string_object_wrapper::get_translate_path in Internationalization 7

Get translate path for object

Parameters

$langcode: Language code if we want ti for a specific language

2 methods override i18n_string_object_wrapper::get_translate_path()
i18n_field::get_translate_path in i18n_field/i18n_field.inc
Get translate path for object
i18n_field_instance::get_translate_path in i18n_field/i18n_field.inc
Get translate path for object

File

i18n_string/i18n_string.inc, line 1209
API for internationalization strings

Class

i18n_string_object_wrapper
String object wrapper

Code

public function get_translate_path($langcode = NULL) {
  $replacements = array(
    '%i18n_language' => $langcode ? $langcode : '',
  );
  if ($path = $this
    ->get_string_info('translate path')) {
    return $this
      ->path_replace($path, $replacements);
  }
  elseif ($path = $this
    ->get_info('translate tab')) {

    // If we've got a translate tab path, we just add language to it
    return $this
      ->path_replace($path . '/%i18n_language', $replacements);
  }
}