You are here

function i18nprofile_locale_refresh in Internationalization 6

Refresh strings.

1 call to i18nprofile_locale_refresh()
i18nprofile_enable in i18nprofile/i18nprofile.install
Refresh strings when enabled.
1 string reference to 'i18nprofile_locale_refresh'
i18nprofile_locale in i18nprofile/i18nprofile.module
Implementation of hook_locale().

File

i18nprofile/i18nprofile.module, line 45
Internationalization (i18n) submodule: Profile translation.

Code

function i18nprofile_locale_refresh() {
  $result = db_query('SELECT * FROM {profile_fields}');
  $categories = array();
  while ($field = db_fetch_object($result)) {

    // Store strings to translate: title, explanation, options.
    i18nstrings_update_object("profile:field:{$field->name}", $field, array(
      'title',
      'explanation',
      'options',
    ));

    // Store category if not there yet.
    if (!isset($categories[$field->category])) {
      i18nstrings_update("profile:category", $field->category);
      $categories[$field->category] = 1;
    }
  }
  return TRUE;

  // Meaning it completed with no issues
}