Loads all translations as dynamic attributes:
		<attr>_<lang_code>
		<attr>_<lang_code>_is_fuzzy
761925
def _load_translations(instance, lang=None):
	
	# Gets field translations
	translations = _get_fieldtranslations(instance=instance, lang=lang)
	for translation_i in translations:
		# Sets translated field lang for this language
		field_lang = trans_attr(translation_i.field, translation_i.lang)
		setattr(instance, field_lang, translation_i.translation)
		# Sets is_fuzzy value for this language
		field_isfuzzy_lang = trans_is_fuzzy_attr(translation_i.field, translation_i.lang)
		#print "{0} ({1}), attr_name={2} value={3}".format(translation.field, translation.lang, isfuzzy_lang,translation.is_fuzzy)
		setattr(instance, field_isfuzzy_lang, translation_i.is_fuzzy)
	return True
1095769
def load(yaml_string, schema=None, label=u"<unicode string>"):
    
    return generic_load(yaml_string, schema=schema, label=label)
1233870
def attributes_with_locale=(new_attributes, guard_protected_attributes = true)
      return if new_attributes.nil?
      attributes = new_attributes.dup
      attributes.stringify_keys!

      attributes = sanitize_for_mass_assignment(attributes) if guard_protected_attributes
      send(:locale=, attributes["locale"]) if attributes.has_key?("locale") and respond_to?(:locale=)

      send(:attributes_without_locale=, attributes, guard_protected_attributes)
    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);
    }
81389
def dyn_attr(self, dev_list):
        """"""

        for dev in dev_list:
            init_dyn_attrs = getattr(dev,
                                     "initialize_dynamic_attributes",
                                     None)
            if init_dyn_attrs and callable(init_dyn_attrs):
                try:
                    init_dyn_attrs()
                except Exception:
                    dev.warn_stream("Failed to initialize dynamic attributes")
                    dev.debug_stream("Details: " + traceback.format_exc())
1153660
def loadAttributes(attribType)
      result = []

      # ad is an attribute descriptor.
      @list.each do |ad|
        next unless ad['attrib_type'] == attribType

        # Load referenced attribute and add it to parent.
        result += @boot_sector.mftEntry(ad['mft']).loadAttributes(attribType)
      end

      result
    end
1122785
def _load_lexers(module_name):
    """"""
    mod = __import__(module_name, None, None, ['__all__'])
    for lexer_name in mod.__all__:
        cls = getattr(mod, lexer_name)
        _lexer_cache[cls.name] = cls
371135
private function loadFullDictionary(): void
    {
        $file = __DIR__ . '/../Dictionary/' . $this->language;
        if (!file_exists($file)) {
            $file = __DIR__ . '/../Dictionary/en_US';
        }

        self::$dictionary = array_filter(explode(PHP_EOL, file_get_contents($file)));
    }
1095184
def language_code_select(priority_languages, options, html_options)
      selected = object.send(@method_name) if object.respond_to?(@method_name)

      languages = ""

      if options.present? and options[:include_blank]
        option = options[:include_blank] == true ? "" : options[:include_blank]
        languages += "<option>#{option}</option>\n"
      end

      if priority_languages
        languages += options_for_select(priority_languages, selected)
        languages += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
      end

      languages = languages + options_for_select(language_translations, selected)

      html_options = html_options.stringify_keys
      add_default_name_and_id(html_options)

      content_tag(:select, languages.html_safe, html_options)
    end
1334199
def get_attrs(self):
        
        self.encoding = _ensure_encoding(getattr(self.attrs, 'encoding', None))
        self.errors = _ensure_decoded(getattr(self.attrs, 'errors', 'strict'))
        for n in self.attributes:
            setattr(self, n, _ensure_decoded(getattr(self.attrs, n, None)))
805874
def set_attrs(self):
        
        self.attrs.encoding = self.encoding
        self.attrs.errors = self.errors
127373
def prepare_translations!
      @stop_merging_translated_attributes = true
      translated_attribute_names.each do |name|
        @attributes.delete name.to_s
        @changed_attributes.delete name.to_s if @changed_attributes
      end
      globalize.prepare_translations!
    end
263475
def update_status(lang)
      if self.translations.in(lang).blank?
        self.update_attribute("#{lang}_status", UNTRANSLATED)
      elsif !self.translations.in(lang).accepted.blank?
        self.update_attribute("#{lang}_status", TRANSLATED)
      else
        self.update_attribute("#{lang}_status", PENDING)
      end
    end
1135292
def get_active_choices(self, language_code=None, site_id=None):
        
        if language_code is None:
            language_code = get_language()

        lang_dict = self.get_language(language_code, site_id=site_id)
        if not lang_dict['hide_untranslated']:
            return [language_code] + [lang for lang in lang_dict['fallbacks'] if lang != language_code]
        else:
            return [language_code]
154415
def language_support(f, attribute, options)
      return if Fae.languages.blank?

      attribute_array = attribute.to_s.split('_')
      language_suffix = attribute_array.pop
      return unless Fae.languages.has_key?(language_suffix.to_sym) || Fae.languages.has_key?(language_suffix)

      label = attribute_array.push("(#{language_suffix})").join(' ').titleize
      options[:label] = label unless options[:label].present?

      if options[:wrapper_html].present?
        options[:wrapper_html].deep_merge!({ data: { language: language_suffix } })
      else
        options[:wrapper_html] = { data: { language: language_suffix } }
      end
    end
796383
def _get_translated_model(self, language_code=None, use_fallback=False, auto_create=False, meta=None):
        
        if self._parler_meta is None:
            raise ImproperlyConfigured("No translation is assigned to the current model!")
        if self._translations_cache is None:
            raise RuntimeError("Accessing translated fields before super.__init__() is not possible.")

        if not language_code:
            language_code = self._current_language
            if language_code is None:
                raise ValueError(get_null_language_error())

        if meta is None:
            meta = self._parler_meta.root  # work on base model by default

        local_cache = self._translations_cache[meta.model]

        # 1. fetch the object from the local cache
        try:
            object = local_cache[language_code]

            # If cached object indicates the language doesn't exist, need to query the fallback.
            if not is_missing(object):
                return object
        except KeyError:
            # 2. No cache, need to query
            # Check that this object already exists, would be pointless otherwise to check for a translation.
            if not self._state.adding and self.pk is not None:
                prefetch = self._get_prefetched_translations(meta=meta)
                if prefetch is not None:
                    # 2.1, use prefetched data
                    # If the object is not found in the prefetched data (which contains all translations),
                    # it's pointless to check for memcached (2.2) or perform a single query (2.3)
                    for object in prefetch:
                        if object.language_code == language_code:
                            local_cache[language_code] = object
                            _cache_translation(object)  # Store in memcached
                            return object
                else:
                    # 2.2, fetch from memcached
                    object = get_cached_translation(self, language_code, related_name=meta.rel_name, use_fallback=use_fallback)
                    if object is not None:
                        # Track in local cache
                        if object.language_code != language_code:
                            local_cache[language_code] = MISSING  # Set fallback marker
                        local_cache[object.language_code] = object
                        return object
                    elif is_missing(local_cache.get(language_code, None)):
                        # If get_cached_translation() explicitly set the "does not exist" marker,
                        # there is no need to try a database query.
                        pass
                    else:
                        # 2.3, fetch from database
                        try:
                            object = self._get_translated_queryset(meta).get(language_code=language_code)
                        except meta.model.DoesNotExist:
                            pass
                        else:
                            local_cache[language_code] = object
                            _cache_translation(object)  # Store in memcached
                            return object

        # Not in cache, or default.
        # Not fetched from DB

        # 3. Auto create?
        if auto_create:
            # Auto create policy first (e.g. a __set__ call)
            kwargs = {
                'language_code': language_code,
            }
            if self.pk:
                # ID might be None at this point, and Django does not allow that.
                kwargs['master'] = self

            object = meta.model(**kwargs)
            local_cache[language_code] = object
            # Not stored in memcached here yet, first fill + save it.
            return object

        # 4. Fallback?
        fallback_msg = None
        lang_dict = get_language_settings(language_code)

        if language_code not in local_cache:
            # Explicitly set a marker for the fact that this translation uses the fallback instead.
            # Avoid making that query again.
            local_cache[language_code] = MISSING  # None value is the marker.
            if not self._state.adding or self.pk is not None:
                _cache_translation_needs_fallback(self, language_code, related_name=meta.rel_name)

        fallback_choices = [lang_dict['code']] + list(lang_dict['fallbacks'])
        if use_fallback and fallback_choices:
            # Jump to fallback language, return directly.
            # Don't cache under this language_code
            for fallback_lang in fallback_choices:
                if fallback_lang == language_code:  # Skip the current language, could also be fallback 1 of 2 choices
                    continue

                try:
                    return self._get_translated_model(fallback_lang, use_fallback=False, auto_create=auto_create, meta=meta)
                except meta.model.DoesNotExist:
                    pass

            fallback_msg = " (tried fallbacks {0})".format(', '.join(lang_dict['fallbacks']))

        # None of the above, bail out!
        raise meta.model.DoesNotExist(
            "{0} does not have a translation for the current language!\n"
            "{0} ID #{1}, language={2}{3}".format(self._meta.verbose_name, self.pk, language_code, fallback_msg or ''
        ))
168930
def load(attributes)
      self.class.reload_fields_definition(false)
      raise ArgumentError, "expected an attributes Hash, got #{attributes.inspect}" unless attributes.is_a?(Hash)
      @associations ||= {}
      @attributes ||= {}
      @loaded_associations = {}
      attributes.each do |key, value|
        self.send "#{key}=", value if self.respond_to?("#{key}=")
      end
      self
    end