You are here

function i18ncontent_locale_refresh in Internationalization 6

Same name and namespace in other branches
  1. 5.3 experimental/i18ncontent.module \i18ncontent_locale_refresh()

Refresh content type strings.

2 calls to i18ncontent_locale_refresh()
i18ncontent_enable in i18ncontent/i18ncontent.install
Implementation of hook_enable().
i18ncontent_update_6002 in i18ncontent/i18ncontent.install
Locale refresh, this will run successfully only after the i18nstrings update has run
1 string reference to 'i18ncontent_locale_refresh'
i18ncontent_locale in i18ncontent/i18ncontent.module
Implementation of hook_locale().

File

i18ncontent/i18ncontent.module, line 59
Internationalization (i18n) package - translatable content type parameters

Code

function i18ncontent_locale_refresh() {
  foreach (node_get_types() as $type) {
    i18nstrings_update("nodetype:type:{$type->type}:name", $type->name);
    i18nstrings_update("nodetype:type:{$type->type}:title", $type->title_label);
    if (isset($type->body_label)) {
      i18nstrings_update("nodetype:type:{$type->type}:body", $type->body_label);
    }
    i18nstrings_update("nodetype:type:{$type->type}:description", $type->description);
    if ($type->help) {
      i18nstrings_ts("nodetype:type:{$type->type}:help", $type->help, NULL, TRUE);
      $type->help = '';
      node_type_save($type);
    }
  }
  return TRUE;

  // Meaning it completed with no issues
}