Provide method to set application language by country name.
550583
public final void setLanguage(Context context, String language) {
        Locale locale = new Locale(language);
        setLanguage(context, locale);
    }
319702
def set_language(self, language):
        '''
        
        '''
        if language == 'ZH':
            self.set_cookie('ulocale', 'zh_CN')
            self.set_cookie('blocale', 'zh_CN')
        else:
            self.set_cookie('ulocale', 'en_US')
            self.set_cookie('blocale', 'en_US')
1223612
protected void setLocale( Locale locale )
    {
        if ( locale == null ) locale = getDefaultLocale();
        getSession().setAttribute( Globals.LOCALE_KEY, locale );
    }
289684
def _set_name(self, version=AUTO):
        """"""

        name = 'python'

        if version:
            if version is AUTO:
                version = sys.version_info[0]

                if version == 2:
                    version = ''

            name = '%s%s' % (name, version)

        self.name = name
636456
def lang_items(self, lang=None):
        """"""
        if lang is None:
            lang = self.language
        yield from self.cache.setdefault(lang, {}).items()
608307
public void set(Language language) {
        this.language = language;

        Cookie cookie = new Cookie(COOKIE_NAME, language.name());
        cookie.setPath("/");
        cookie.setMaxAge(Integer.MAX_VALUE);
        VaadinService.getCurrentResponse().addCookie(cookie);
    }
483780
@NonNull
    public static Context applyLanguageForContext(@NonNull Context context, @NonNull Locale locale) {
        Resources resources = context.getResources();
        Configuration config = resources.getConfiguration();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            config.setLocale(locale);
            return context.createConfigurationContext(config);
        } else {
            config.locale = locale;
            resources.updateConfiguration(config, resources.getDisplayMetrics());
            return context;
        }
    }
238417
def process_LANGUAGE_CODE(self, language_code, data):
        '''
        
        '''
        # Dirty hack to fix non included default
        language_code = 'en-us' if language_code == 'en' else language_code
        language = translation.get_language_info('en' if language_code == 'en-us' else language_code)
        if not settings.JS_CONTEXT or 'LANGUAGE_NAME' in settings.JS_CONTEXT \
            or (settings.JS_CONTEXT_EXCLUDE and 'LANGUAGE_NAME' in settings.JS_CONTEXT_EXCLUDE):
            data['LANGUAGE_NAME'] = language['name']
        if not settings.JS_CONTEXT or 'LANGUAGE_NAME_LOCAL' in settings.JS_CONTEXT \
            or (settings.JS_CONTEXT_EXCLUDE and 'LANGUAGE_NAME_LOCAL' in settings.JS_CONTEXT_EXCLUDE):
            data['LANGUAGE_NAME_LOCAL'] = language['name_local']
        return language_code
1083405
def set_current_language(self, language_code, initialize=False):
        
        self._current_language = normalize_language_code(language_code or get_language())

        # Ensure the translation is present for __get__ queries.
        if initialize:
            self._get_translated_model(use_fallback=False, auto_create=True)
863167
void setLocale(Locale locale)
   {
      m_resourceNames = LocaleData.getStringArray(locale, LocaleData.RESOURCE_NAMES);

      String name;
      m_resourceNumbers.clear();

      for (int loop = 0; loop < m_resourceNames.length; loop++)
      {
         name = m_resourceNames[loop];
         if (name != null)
         {
            m_resourceNumbers.put(name, Integer.valueOf(loop));
         }
      }
   }
722105
function set(props, req, language) {
  if(language) {
    req.language = language;
  }
  else {
    language = req.language = acceptLanguage.get(req.headers['accept-language']);
  }

  if(typeof props.localizations === 'function') {
    req.localizations = props.localizations(language);
  }
}
214018
def supported_app_locales():
    
    locale = _get_locale()
    codes = current_app.config["BABEL_ACCEPT_LANGUAGES"]
    return ((Locale.parse(code), locale.languages.get(code, code)) for code in codes)
342418
def language(lang_code):
    ''''''
    ctx = None
    if not request:
        ctx = current_app.test_request_context()
        ctx.push()
    backup = g.get('lang_code')
    g.lang_code = lang_code
    refresh()
    yield
    g.lang_code = backup
    if ctx:
        ctx.pop()
    refresh()
479006
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nInvItem();
    }
    this.itsId.setLang(this.lang);
  }
1373248
def set_new_country(code, ccy, name):
    '''
    
    '''
    code = str(code).upper()
    cdb = countries()
    if code in cdb:
        raise CountryError('Country %s already in database' % code)
    ccys = currencydb()
    ccy = str(ccy).upper()
    if ccy not in ccys:
        raise CountryError('Currency %s not in database' % ccy)
    cdb[code] = str(name)
    cccys = countryccys()
    cccys[code] = ccy
839234
def set_language(self, language):
        
        if isinstance(language, str):
            language_obj = languages.getlang(language)
            if language_obj:
                self.language = language_obj.code
            else:
                raise TypeError("Language code {} not found".format(language))
        if isinstance(language, languages.Language):
            self.language = language.code
1048985
public function setLocale()
    {
        $locale = app('session')->get('administrator_locale');

        if ($locale) {
            $this->app->translator->setLocale($locale);
        }
    }