name", $field, array('title', 'explanation', 'options')); if (!in_array($field->category, $categories)) { $categories[] = $field->category; i18nstrings_update("profile:category", $field->category); } } // Category translations from variables. foreach (array_keys(language_list()) as $lang) { if ($translation = variable_get('i18nprofile_'. $lang, FALSE)) { foreach ($translation as $category => $translation) { if (in_array($category, $categories) && $translation) { $context = i18nstrings_context('profile:category', $category); i18nstrings_update_translation($context, $lang, $translation); } } } } // Move current data into string translations. $result = db_query("SELECT * FROM {i18n_profile_fields}"); while ($field = db_fetch_object($result)) { foreach (array('title', 'explanation', 'options') as $property) { if (!empty($field->$property)) { i18nstrings_update_translation("profile:field:$field->name:$property", $field->language, $field->$property); } } } return $items; } // Clean up. Uncomment when it all works. /* function i18nprofile_update_3() { $items[] = update_sql("DROP TABLE {i18n_profile_fields};"); foreach (array_keys(language_list()) as $lang) { variable_del('i18nprofile_'.$lang); } return $items; }*/