You are here

function i18nstrings_remove_string in Internationalization 6

Remove string for a given context.

8 calls to i18nstrings_remove_string()
i18nblocks_block_delete_submit in i18nblocks/i18nblocks.module
Remove strings for deleted custom blocks.
i18nprofile_field_delete_submit in i18nprofile/i18nprofile.module
Delte field profile related strings
i18nstrings_add_string in i18nstrings/i18nstrings.module
Add source string to the locale tables for translation.
i18nstrings_remove in i18nstrings/i18nstrings.module
Remove source and translations for user defined string.
i18nstrings_update in i18nstrings/i18nstrings.module
Update / create translation source for user defined strings.

... See full list

File

i18nstrings/i18nstrings.module, line 590
Internationalization (i18n) package - translatable strings.

Code

function i18nstrings_remove_string($context, $string = NULL) {
  $context = i18nstrings_context($context, $string);
  if ($source = i18nstrings_get_source($context, $string)) {
    db_query("DELETE FROM {locales_target} WHERE lid = %d", $source->lid);
    db_query("DELETE FROM {i18n_strings} WHERE lid = %d", $source->lid);
    db_query("DELETE FROM {locales_source} WHERE lid = %d", $source->lid);
    cache_clear_all('locale:' . $context->textgroup . ':', 'cache', TRUE);
    return SAVED_DELETED;
  }
}