You are here

function i18n_string_textgroup_default::update_translation in Internationalization 7

Update string translation, only if source exists.

Parameters

$context: String context as array

$langcode: Language code to create the translation for

$translation: String translation for this language

File

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

Class

i18n_string_textgroup_default
Textgroup handler for i18n_string API

Code

function update_translation($context, $langcode, $translation) {
  $i18nstring = $this
    ->build_string($context);
  if ($source = $i18nstring
    ->get_source()) {
    $source
      ->set_translation($translation, $langcode);
    $this
      ->save_translation($source, $langcode);
    return $source;
  }
}