You are here

protected function i18n_string_textgroup_default::save_translation in Internationalization 7

Save translation to the db

Parameters

$string: Full string object with translation data (language, translation)

1 call to i18n_string_textgroup_default::save_translation()
i18n_string_textgroup_default::update_translation in i18n_string/i18n_string.inc
Update string translation, only if source exists.

File

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

Class

i18n_string_textgroup_default
Textgroup handler for i18n_string API

Code

protected function save_translation($string, $langcode) {
  db_merge('locales_target')
    ->key(array(
    'lid' => $string->lid,
    'language' => $langcode,
  ))
    ->fields(array(
    'translation' => $string
      ->get_translation($langcode),
  ))
    ->execute();
}