You are here

function finder_i18nstrings_save_strings in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_i18nstrings/finder_i18nstrings.module \finder_i18nstrings_save_strings()

Recursively save strings using the map.

1 call to finder_i18nstrings_save_strings()
finder_i18nstrings_finderapi in modules/finder_i18nstrings/finder_i18nstrings.module
Implements hook_finderapi().

File

modules/finder_i18nstrings/finder_i18nstrings.module, line 199
The finder string translation module.

Code

function finder_i18nstrings_save_strings($object, $map) {
  $language = language_default('language');
  $object = (array) $object;
  if (!empty($map)) {
    foreach ($map as $key => $value) {
      if (isset($object[$key]) && !is_numeric($object[$key]) && $value['#i18nstrings']) {
        i18n_string_update($value['#i18nstrings'], $object[$key], $language);
      }
      if (is_array($map[$key])) {
        finder_i18nstrings_save_strings($object[$key], $map[$key]);
      }
    }
  }
}