Returns language flag
437059
def tml_language_flag_tag(lang = tml_current_language, opts = {})
      return '' unless tml_application.feature_enabled?(:language_flags)
      html = image_tag(lang.flag_url, :style => (opts[:style] || 'vertical-align:middle;'), :title => lang.native_name)
      html << '&nbsp;&nbsp;'.html_safe
      html.html_safe
    end
945227
public String getLanguageComponent(String language) {
        if (StringUtils.isNullOrEmpty(language)) {
            return "";
        }

        if (language.contains("-")) {
            return language.split("-")[0];
        } else if (language.contains("_")) {
            return language.split("_")[0];
        }

        return language;
    }
1071634
def lang(self):
        
        return str(self.graph.value(self.asNode(), DC.language))
436531
public function languageDetection() {
        $current_url = $this->getSession()->getCurrentUrl();
        $base_url = $this->getMinkParameter('base_url');
        // Checks whether the last symbol in the base_url is /, if not it adds it
        if (substr($base_url, -1) != "/") {
            $base_url = $base_url."/";
        }
        $base_url_length = strlen($base_url);
        //Get the 2 symbols in current URL after the base_url when Clean URLs is enabled
        $clean_url_language_code = substr($current_url,$base_url_length,2);
        $not_clean_url_language_code = substr($current_url,$base_url_length+3,2);
        if(in_array($clean_url_language_code,$this->languages_iso_codes) && substr($current_url,$base_url_length+2,1) == "/") {
            return $clean_url_language_code;
        }
        else if (in_array($not_clean_url_language_code,$this->languages_iso_codes) && substr($current_url,$base_url_length+5,1) == "/"){
            return $not_clean_url_language_code;
        }
        else return $this->multilingual_parameters['default_language'];
    }
1280034
def _get_flag(which, flags):
    
    res = [this for this in flags if this.is_equal(which)]
    if len(res) == 0:
        return None
    if len(res) == 1:
        return res[0]
    assert()
529993
function _getLangWithDesc( desc ) {
    const results = ( desc ) ? tags.search( desc ).filter( _languagesOnly ) : [];
    return results[ 0 ] || '';
}
464832
def get_language(self):
        
        return get_language_parameter(self.request, self.query_language_key, default=self.get_default_language(object=object))
516577
def get_access_flags_string(value):
    
    buff = ""
    for i in ACCESS_FLAGS:
        if (i[0] & value) == i[0]:
            buff += i[1] + " "

    if buff != "":
        return buff[:-1]
    return buff
531846
def _get_main_language():
        
        try:
            main_language = TransLanguage.objects.filter(main_language=True).get()
            return main_language.code
        except TransLanguage.DoesNotExist:
            return 'es'
438341
public static String getXAResourceRecoverFlagString(int flag) {
        switch (flag) {
            case XAResource.TMENDRSCAN:
                return "TMENDRSCAN (" + flag + ')'; 

            case XAResource.TMNOFLAGS:
                return "TMNOFLAGS (" + flag + ')'; 

            case XAResource.TMSTARTRSCAN:
                return "TMSTARTRSCAN (" + flag + ')'; 

            case XAResource.TMSTARTRSCAN + XAResource.TMENDRSCAN:
                return "TMSTARTRSCAN + TMENDRSCAN (" + flag + ')'; 

        }

        return "UNKNOWN XA RESOURCE RECOVER FLAG (" + flag + ')'; 
    }
860157
function _(message) {
        if (_i18n_locale.locale_name == 'en_DEBUG') return __debug_trans_str(message);
        var entry = _i18n_catalog['+-'+message];
        return entry == undefined ? message : entry;
    }
244120
def _to_flags(self, text):
        """"""

        flags = 0
        for x in text.split('|'):
            value = x.strip().upper()
            if value:
                flags |= self.GLOB_FLAG_MAP.get(value, 0)
        return flags
320623
private static Charset getCharset(final int flags) throws AuthenticationException
    {
        if ((flags & FLAG_REQUEST_UNICODE_ENCODING) == 0) {
            return DEFAULT_CHARSET;
        } else {
            if (UNICODE_LITTLE_UNMARKED == null) {
                throw new AuthenticationException( "Unicode not supported" );
            }
            return UNICODE_LITTLE_UNMARKED;
        }
    }
808638
def language(cls):
        
        lang = 'Unknown (%s)' % cls.lang
        if pycountry is None:
            if cls.lang in languages.Languages:
                lang = languages.Languages[cls.lang]
        else:
            try:
                lang = pycountry.languages.get(alpha2 = cls.lang).name
            except KeyError:
                try:
                    lang = pycountry.languages.get(iso639_1_code = cls.lang).name
                except KeyError:
                    pass
        return lang
236931
def get_hgvs_language() -> ParserElement:
    """"""
    hgvs = (variant_characters | quote)(IDENTIFIER)
    language = variant_tags + nest(hgvs)
    return language
824207
def tml_language_name_tag(lang = tml_current_language, opts = {})
      show_flag = opts[:flag].nil? ? true : opts[:flag]
      name_type = opts[:language].nil? ? :english : opts[:language].to_sym # :full, :native, :english, :locale, :both

      html = []
      html << "<span style='white-space: nowrap'>"
      html << tml_language_flag_tag(lang, opts) if show_flag
      html << "<span dir='ltr'>"

      if name_type == :both
        html << lang.english_name.to_s
        html << '<span class="trex-native-name">'
        html << lang.native_name
        html << '</span>'
      else
        name = case name_type
          when :native  then lang.native_name
          when :full then lang.full_name
          when :locale  then lang.locale
          else lang.english_name
        end
        html << name.to_s
      end

      html << '</span></span>'
      html.join.html_safe
    end
672592
private static String toLanguageTag(Locale locale) {
        if (locale == null) {
            return null;
        }
        StringBuilder tag = new StringBuilder();

        tag.append(locale.getLanguage().toLowerCase());

        if (!locale.getCountry().isEmpty()) {
            tag.append("-");
            tag.append(locale.getCountry().toUpperCase());
        }

        return tag.toString();
    }