Removes a cached translation
505812
protected function refreshLanguage()
    {
        $this->controlToken('refresh');

        $code = $this->getQuery('refresh');
        if (!empty($code) && $this->access('language_edit') && $this->translation->refresh($code)) {
            $this->redirect('', $this->text('Language has been refreshed'), 'success');
        }
    }
707257
function () {
        var self = this;

        if (self.fileToDelete === null) {
            return;
        }

        fs.remove(self.fileToDelete, function (err) {
            if (err) {
                common.logging.error(new common.errors.GhostError({
                    err: err,
                    context: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.error'),
                    help: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.context')
                }));
            }

            self.fileToDelete = null;
        });
    }
413401
protected function removeTranslation($key)
    {
        if (true === isset(self::$translations[$key])) {
            unset(self::$translations[$key]);
        }
    }
619061
def clean_translated_locales(configuration, langs=None):
    
    if not langs:
        langs = configuration.translated_locales
    for locale in langs:
        clean_locale(configuration, locale)
329247
function REMOVE_LOCALE(state, payload) {
      // check if the given locale is present in the state
      if (state.translations.hasOwnProperty(payload.locale)) {
        // check if the current locale is the given locale to remvoe
        if (state.locale === payload.locale) {
          // reset the current locale
          state.locale = null;
        } // create a copy of the translations object


        var translationCopy = Object.assign({}, state.translations); // remove the given locale

        delete translationCopy[payload.locale]; // set the state to the new object

        state.translations = translationCopy;
      }
    }
45674
def clean_locale(configuration, locale):
    
    dirname = configuration.get_messages_dir(locale)
    if not dirname.exists():
        # Happens when we have a supported locale that doesn't exist in Transifex
        return
    for filename in dirname.files('*.po'):
        clean_file(configuration, dirname.joinpath(filename))
980604
function removeTranslation( $languageID )
    {
        $language = eZContentLanguage::fetch( $languageID );

        if ( !$language )
        {
            return false;
        }

        // check if it is not the initial language
        $classInitialLanguageID = $this->attribute( 'initial_language_id' );
        if ( $classInitialLanguageID == $languageID )
        {
            return false;
        }

        $db = eZDB::instance();
        $db->begin();

        $classID = $this->attribute( 'id' );
        $languageID = $language->attribute( 'id' );

        // change language_mask of the object
        $languageMask = (int) $this->attribute( 'language_mask' );
        $languageMask = (int) $languageMask & ~ (int) $languageID;
        $this->setAttribute( 'language_mask', $languageMask );

        // Remove all names in the language
        $db->query( "DELETE FROM ezcontentclass_name
                     WHERE contentclass_id='$classID'
                       AND language_id='$languageID'" );

        $languageLocale = $language->attribute( 'locale' );
        $this->NameList->removeName( $languageLocale );
        $this->DescriptionList->removeName( $languageLocale );

        $this->store();

        // Remove names for attributes in the language
        $attributes = $this->fetchAttributes();
        foreach ( $attributes as $attribute )
        {
            $attribute->removeTranslation( $languageLocale );
            $attribute->store();
        }

        $db->commit();

        return true;
    }
1296992
def clean_translation(self):
        
        translation = self.cleaned_data['translation']

        if self.instance and self.instance.content_object:
            # do not allow string longer than translatable field
            obj = self.instance.content_object
            field = obj._meta.get_field(self.instance.field)
            max_length = field.max_length

            if max_length and len(translation) > max_length:
                raise forms.ValidationError(
                    _('The entered translation is too long. You entered '
                      '%(entered)s chars, max length is %(maxlength)s') % {
                        'entered': len(translation),
                        'maxlength': max_length,
                    }
                )
        else:
            raise forms.ValidationError(
                _('Can not store translation. First create all translation'
                  ' for this object')
            )
        return translation
315519
private function _deleteCache()
    {
        if ($this->_cache instanceof \Zend_Cache_Core) {
            $this->_cache->remove($this->_cacheid);
            $this->_cache->remove($this->_cacheid . 'trans');
        }
    }
1051401
def _cache_translation_needs_fallback(instance, language_code, related_name, timeout=cache.default_timeout):
    
    if not appsettings.PARLER_ENABLE_CACHING or not instance.pk or instance._state.adding:
        return

    tr_model = instance._parler_meta.get_model_by_related_name(related_name)
    key = get_translation_cache_key(tr_model, instance.pk, language_code)
    cache.set(key, {'__FALLBACK__': True}, timeout=timeout)
594001
def set_cache(
        self,
        instance=None,
        translation=None,
        language=None,
        field_name=None,
        field_value=None,
    ):
        
        if instance is not None and translation is not None:
            cached_obj = CachedTranslation.from_object(translation)
            instance._linguist_translations[translation.field_name][
                translation.language
            ] = cached_obj
            return cached_obj

        if instance is None:
            instance = self.instance

        cached_obj = self.get_cache(
            instance,
            translation=translation,
            field_value=field_value,
            language=language,
            field_name=field_name,
        )

        if field_value is None and cached_obj.field_value:
            cached_obj.deleted = True

        if field_value != cached_obj.field_value:
            cached_obj.has_changed = True
            cached_obj.field_value = field_value

        return cached_obj
370204
def _del_cached_value(self, xblock):
        """"""
        # pylint: disable=protected-access
        if hasattr(xblock, '_field_data_cache') and self.name in xblock._field_data_cache:
            del xblock._field_data_cache[self.name]
1203949
def delete_translations(self, language=None):
        
        from .models import Translation

        return Translation.objects.delete_translations(obj=self, language=language)
1033603
public void removeLocale(final LocaleId locale) {
        LOG.info("Removing " + locale + " from further sync requests.");
        synchronized (locales) {
            if (locales.contains(locale))
                locales.remove(locale);
        }
    }
730319
def delete_translation_values
      field_key = FieldKey.find_by_global_key(params[:i18n_key])
      field_key.visible = false

      # not convinced it makes sense to delete the associated translations
      # phrases = I18n::Backend::ActiveRecord::Translation.where(:key => params[:i18n_key])
      # phrases.destroy_all

      field_key.save!
      render json: { success: true }
    end
1262520
public function cleanUpProcessAfterIndexing()
    {
        // enable keys (may have been disabled because it was the first indexing)
        Db::getDatabaseConnection('tx_kesearch_index')
            ->exec('ALTER TABLE tx_kesearch_index ENABLE KEYS');

        Db::getDatabaseConnection('tx_kesearch_index')
            ->exec('DEALLOCATE PREPARE searchStmt');

        Db::getDatabaseConnection('tx_kesearch_index')
            ->exec('DEALLOCATE PREPARE updateStmt');

        Db::getDatabaseConnection('tx_kesearch_index')
            ->exec('DEALLOCATE PREPARE insertStmt');

        // remove all entries from ke_search registry
        $this->registry->removeAllByNamespace('tx_kesearch');
    }
133809
public static function cacheFlush()
    {
        foreach ( self::getCategories() as $category ) {
            foreach ( Yii::$app->i18n->languages as $language ) {
                Yii::$app->cache->delete([
                    'yii\i18n\DbMessageSource',
                    $category,
                    $language,
                ]);
            }
        }

        return true;
    }