Populates already loaded translations
163184
private function populateTranslations()
    {
        //translations
        $aRelated = $this->owner->getRelatedRecords();
        if (isset($aRelated[$this->relation]) && $aRelated[$this->relation] != null) {
            if (is_array($aRelated[$this->relation])) {
                foreach ($aRelated[$this->relation] as $model) {
                    $this->_models[$model->getAttribute($this->languageField)] = $model;
                }
            } else {
                $model = $aRelated[$this->relation];
                $this->_models[$model->getAttribute($this->languageField)] = $model;
            }
        }
    }
431498
protected static function loadAvailableLanguages()
    {
        $matches = array();
        foreach (glob(PHPCI_DIR . 'PHPCI/Languages/lang.*.php') as $file) {
            if (preg_match('/lang\.([a-z]{2}\-?[a-z]*)\.php/', $file, $matches)) {
                self::$languages[] = $matches[1];
            }
        }
    }
732009
def put!(translations)
      Scope.flatten(translations).each do |key, value|
        storage.write(key, value)
      end
    end
318311
public function load_translation()
    {
        $translator = new \Gettext\Translator();
        $i18n_path = realpath(__DIR__ . '/../../i18n/' . Config::$locale . '.po');

        if (file_exists($i18n_path)) {
            $translations = \Gettext\Translations::fromPoFile($i18n_path);
            $translator->loadTranslations($translations);
        }

        Translator::initGettextFunctions($translator);
    }
541362
def addTranslation(self,translation):
        '''
        '''
        if isinstance(translation, Translation):
            self.translations.append(translation)
        else:
            raise(TranslationError,
                   'translation Type should be Translation, not %s' % type(
                    translation)
                   )
87960
def translations_lists(self):
        ''''''
        return (getattr(self.generator, name) for name in
                self.info.get('translations_lists', []))
1215912
private function load()
    {
        // Get English version
        $english = $this->getTranslations(__DIR__, 'en');
        $languages = $this->getLanguages();

        $this->compareTranslations($english, $languages);
    }
1204026
def append_translated(model, fields):
    ""
    fields = set(fields)
    from modeltranslation.translator import translator
    opts = translator.get_options_for_model(model)
    for key, translated in opts.fields.items():
        if key in fields:
            fields = fields.union(f.name for f in translated)
    return fields
631977
def save_translations(self, instance, translated_data):
        
        for meta in self.Meta.model._parler_meta:
            translations = translated_data.get(meta.rel_name, {})
            for lang_code, model_fields in translations.items():
                translation = instance._get_translated_model(lang_code, auto_create=True, meta=meta)
                for field, value in model_fields.items():
                    setattr(translation, field, value)

        # Go through the same hooks as the regular model,
        # instead of calling translation.save() directly.
        instance.save_translations()
1179183
private function loadTranslations()
    {
        if ($related = $this->owner->{$this->relation}) {
            if (is_array($related)) {
                foreach ($related as $model) {
                    $this->_models[$model->getAttribute($this->languageAttribute)] = $model;
                }
            } else {
                $model = $related;
                $this->_models[$model->getAttribute($this->languageAttribute)] = $model;
            }
            return true;
        }
        return false;
    }
313193
public function registerTranslations()
    {
        $langPath = resource_path('lang/modules/translate');

        if (is_dir($langPath)) {
            $this->loadTranslationsFrom($langPath, 'translate');
        } else {
            $this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'translate');
        }
    }
519915
private function gatherTranslatableStrings()
    {
        $this->translatables = [];

        $this->scanTwigFiles();
        $this->scanPhpFiles();

        ksort($this->translatables);
    }
672244
def get_translations(self, status=None):
        '''
            
        '''
        if status is not None:
            result = self.api_call('translation/?status=%s' % status)
        else:
            result = self.api_call('translation/')
        if result.status_code == 200:
            translations_json = json.loads(result.content)["objects"]
            translations = [Translation(**tj) for tj in translations_json]
        else:
            log.critical(
                'Error status when fetching translation from server: {'
                '}!'.format(
                    result.status_code))
            translations = []
        return translations
1025578
def with_translations(self, **kwargs):
        

        force = kwargs.pop("force", False)

        if self._prefetch_translations_done and force is False:
            return self

        self._prefetched_translations_cache = utils.get_grouped_translations(
            self, **kwargs
        )
        self._prefetch_translations_done = True

        return self._clone()
922957
protected function load_translations() {

		$domain = 'wp-requirements';
		$locale = get_locale();
		$mofile = $domain . '-' . $locale . '.mo';

		// Try to load from the languages directory first.
		if ( ! load_textdomain( $domain, WP_LANG_DIR . '/' . $mofile ) ) {
			// Then try to load from our languages folder.
			load_textdomain( $domain, dirname( __FILE__ ) . '/../languages/' . $mofile );
		}

	}
951371
def add_translation(sender):
	
	# 1. Execute _save_translations when saving an object
	signals.post_save.connect(_save_translations, sender=sender)
	# 2. Adds get_fieldtranslations to class. Remember that this method get all the translations.
	sender.add_to_class("get_fieldtranslations", _get_fieldtranslations)
	# 3. Adss load_translations. Remember that this method included all the translations as dynamic attributes.
	sender.add_to_class("load_translations", _load_translations)
	# 4. Adds _set_dict_translations. This methods allows us setting all the translated fields form a dict.
	# Very useful when dealing with ModelForms.
	sender.add_to_class("set_translation_fields", _set_dict_translations)
	# 5. This methods returns one translated attribute in Django.
	# Avoid using _ and use get_trans_attr because Django maketranslations parser is fooled believing that everything
	# inside _ methods is translatable.
	sender.add_to_class("_", _get_translated_field)
	sender.add_to_class("get_trans_attr", _get_translated_field)
	sender.add_to_class("_t", _get_translated_field)
181304
private function load()
    {
        // reset phrases
        $this->phrases = array();
        $this->loaded = true;

        // set file path
        $langDataPath = FS2LANG . '/' . $this->local . '/' . $this->type . '.txt';

        // include language data file
        if (file_exists($langDataPath)) {
            // load file
            $langData = file_get_contents($langDataPath);
            $langData = str_replace(array("\r\n", "\r"), "\n", $langData); // unify linebreaks
            $this->import($langData);

            // get lines
            $langData = preg_replace("/#.*?\n/is", '', $langData);
            $langData = explode("\n", $langData);

            // Run through lines
            foreach ($langData as $line) {
                preg_match("#([a-z0-9_-]+?)\s*?:\s*(.*)#is", $line, $match);
                if (count($match) >= 2) {
                    $this->add($match[1], $match[2]);
                }
                unset($match);
            }
        } else {
            Throw new \Exception('Language File not found: ' . $langDataPath);
        }
    }