Add resources to the Translator from the cache
559018
public function addResourcesFromCacher()
    {
        $resources = $this->resourceCacher->getCachedResources(false);

        if ($resources !== false) {
            $this->addResources($resources);

            return true;
        }

        return false;
    }
328629
def get(self, lang, instance):
        
        instance_key = TransCache._create_key(lang, instance)
        return self.cache[instance_key]
1294935
public function registerCacheFlusher()
    {
        $command = new TranslationsCacheFlushCommand( $this->app['translation.cache.repository'], true );

        $this->app['command.translator:flush'] = $command;
        $this->commands( 'command.translator:flush' );
    }
244654
def addLocalCacheService(self):
        ""
        _cache = self.getCacheService()
        _cache.setName('cache_proxy')
        _cache.setServiceParent(self.hendrix)
1346468
def add_to_hash(all_translations, lang)
      levels = self.name.split('.')
      add_to_hash_rec(all_translations, levels, lang.to_s)
    end
1225454
@Override
    public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) {
        SourceTargetUtility cache;
        synchronized (SOURCE_CACHE) {
            //String id = getID();
            cache = SOURCE_CACHE.get(norm2);
            if (cache == null) {
                cache = new SourceTargetUtility(new NormalizingTransform(norm2), norm2);
                SOURCE_CACHE.put(norm2, cache);
            }
        }
        cache.addSourceTargetSet(this, inputFilter, sourceSet, targetSet);
    }
840205
public function addTranslation($translator)
	{
		if (!file_exists( $this->getPath().'/'.TRANSLATIONS )) return;
		$translator->addTranslation( $this->getPath().'/'.TRANSLATIONS );
	}
759676
def add(self, resource, replace=False):
        
        if isinstance(resource, collections.Iterable):
            for r in resource:
                self.resources.add(r, replace)
        else:
            self.resources.add(resource, replace)
636456
def lang_items(self, lang=None):
        """"""
        if lang is None:
            lang = self.language
        yield from self.cache.setdefault(lang, {}).items()
46662
def update_generators():
    '''
    '''
    for generator in _GENERATOR_DB.keys():
        install_templates_translations(generator)
        add_variables_to_context(generator)
        interlink_static_files(generator)
        interlink_removed_content(generator)
        interlink_translated_content(generator)
1074901
function (resources) {
		'use strict';
		this.i18n = require('i18next');
		var sprintf = require('i18next-sprintf-postprocessor');
		this.i18n.use(sprintf).init({
			overloadTranslationOptionHandler: sprintf.overloadTranslationOptionHandler,
			returnObjects: true,
			lng: this.locale,
			resources: resources
		});
	}
1366118
def set(self, lang, instance):
        
        if self._cache_is_too_big():
            self.cache = {}
        instance_key = TransCache._create_key(lang, instance)
        instance._translations_are_cached = True
        instance.load_translations(lang=lang)
        self.cache[instance_key] = instance
627933
private function cacheTranslations() {
        $this->log("Downloading translations...");
        $sources = Config::instance()->application->apiClient()->get("application/sources");
        foreach($this->languages as $language) {
            $this->log("--------------------------------------------------------------");
            $this->log($language["locale"]. " locale...");
            $this->log("--------------------------------------------------------------");
            foreach($sources as $source) {
                $this->log("Downloading ". $source["source"] . " in " . $language["locale"]. "...");
                $source = Config::instance()->application->apiClient()->get("source", array("source" => $source["source"], "locale" => $language["locale"], "translations" => "true"));
                $this->cache(Source::cacheKey($source["source"], $language["locale"]), json_encode($source));
            }
        }
    }
182829
def update_resources_from_datafile(self, srcpath, type_, names=None, 
                                       languages=None):
        
        UpdateResourcesFromDataFile(self.filename, srcpath, type_, names, 
                                    languages)
687995
public function addResourcesFromDatabaseAndCacheThem($cacheResources = true)
    {
        try {
            $resources = $this->translationRepository->getAllDomainsByLocale();
            $this->addResources($resources);

            if ($cacheResources === true) {
                $this->resourceCacher->cacheResources($resources);
            }
        } catch (\Exception $ex) {
            // don't load if the database doesn't work
        }
    }
809451
def resources(self, lang, slug):
        

        resource = resources.Resource.get(
            project_slug=self.get_project_slug(lang),
            slug=slug,
        )

        return resource
273372
def add_localedir_translations(self, localedir):
        """"""
        global _localedirs
        if localedir in self.localedirs:
            return
        self.localedirs.append(localedir)
        full_localedir = os.path.join(localedir, 'locale')
        if os.path.exists(full_localedir):
            translation = self._new_gnu_trans(full_localedir)
            self.merge(translation)