You are here

public function i18n_string_textgroup_default::build_string in Internationalization 7

Build string object

Parameters

$context: Context array or string

$string string: Current value for string source

6 calls to i18n_string_textgroup_default::build_string()
i18n_string_textgroup_default::context_remove in i18n_string/i18n_string.inc
Remove source and translations for user defined string.
i18n_string_textgroup_default::context_translate in i18n_string/i18n_string.inc
Translate source string
i18n_string_textgroup_default::context_update in i18n_string/i18n_string.inc
Update / create translation source for user defined strings.
i18n_string_textgroup_default::multiple_translation_build in i18n_string/i18n_string.inc
Get multiple translations with search conditions.
i18n_string_textgroup_default::update_check in i18n_string/i18n_string.inc
Recheck strings after update

... See full list

File

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

Class

i18n_string_textgroup_default
Textgroup handler for i18n_string API

Code

public function build_string($context, $string = NULL) {

  // First try to locate string on cache
  $context = is_array($context) ? implode(':', $context) : $context;
  if ($cached = $this
    ->cache_get($context)) {
    $i18nstring = $cached;
  }
  else {
    $i18nstring = new i18n_string_object();
    $i18nstring->textgroup = $this->textgroup;
    $i18nstring
      ->set_context($context);
    $this
      ->cache_set($context, $i18nstring);
  }
  if (isset($string)) {
    $i18nstring
      ->set_string($string);
  }
  return $i18nstring;
}