You are here

public function i18n_string_object_wrapper::strings_update in Internationalization 7

Update all strings for this object.

File

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

Class

i18n_string_object_wrapper
String object wrapper

Code

public function strings_update($options = array()) {
  $options += array(
    'empty' => TRUE,
    'update' => TRUE,
  );
  $result = array();
  $existing = $this
    ->load_strings();

  // Update object strings
  foreach ($this
    ->get_strings($options) as $key => $string) {
    $result[$key] = $string
      ->update($options);
    unset($existing[$key]);
  }

  // Delete old existing strings.
  foreach ($existing as $key => $string) {
    $result[$key] = $string
      ->remove($options);
  }
  return _i18n_string_result_count($result);
}