summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Placella2011-03-06 11:50:11 (GMT)
committer Francesco Placella2011-03-06 11:50:11 (GMT)
commitfd7611dfc00cc799e198bca0504361342a064a91 (patch)
tree5585b3ff7d3a1eb4c2146b3166ebfb056049bc62
parente90aa59bac3bf8ca0492fc998a98a455c530e975 (diff)
Issue #967688 by plach, miro_dietiker, Jose Reyero: Introduced an API function for removing a string translation.6.x-1.9
-rw-r--r--i18nstrings/i18nstrings.module10
1 files changed, 10 insertions, 0 deletions
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