From: Francesco Placella Date: Sun, 6 Mar 2011 11:50:11 +0000 (+0100) Subject: Issue #967688 by plach, miro_dietiker, Jose Reyero: Introduced an API function for... X-Git-Tag: 6.x-1.9 X-Git-Url: http://drupalcode.org/project/i18n.git/commitdiff_plain/fd7611dfc00cc799e198bca0504361342a064a91?hp=e90aa59bac3bf8ca0492fc998a98a455c530e975 Issue #967688 by plach, miro_dietiker, Jose Reyero: Introduced an API function for removing a string translation. --- diff --git a/i18nstrings/i18nstrings.module b/i18nstrings/i18nstrings.module index f276c4a..9f759fc 100644 --- a/i18nstrings/i18nstrings.module +++ b/i18nstrings/i18nstrings.module @@ -599,6 +599,16 @@ function i18nstrings_remove_string($context, $string = NULL) { } /** + * Remove a string translation for a given context and language. + */ +function i18nstrings_remove_translation($context, $langcode) { + $context = i18nstrings_context($context); + if ($source = i18nstrings_get_source($context)) { + db_query("DELETE FROM {locales_target} WHERE lid = %d AND language = '%s'", $source->lid, $langcode); + } +} + +/** * Update context for strings. * * As some string locations depend on configurable values, the field needs sometimes to be updated