Verify all declared locales in one step.
506216
public List<Cal10nError> verifyAllLocales() {
    List<Cal10nError> errorList = new ArrayList<Cal10nError>();

    String[] localeNameArray = getLocaleNames();

    ErrorFactory errorFactory = new ErrorFactory(enumTypeAsStr, null, getBaseName());


    if (localeNameArray == null || localeNameArray.length == 0) {
      errorList.add(errorFactory.buildError(MISSING_LOCALE_DATA_ANNOTATION, "*"));
      return errorList;
    }
    for (String localeName : localeNameArray) {
      Locale locale = MiscUtil.toLocale(localeName);
      List<Cal10nError> tmpList = verify(locale);
      errorList.addAll(tmpList);
    }

    return errorList;
  }
258511
def _verify_python3_env():
    """"""
    if PY2:
        return
    try:
        import locale
        fs_enc = codecs.lookup(locale.getpreferredencoding()).name
    except Exception:
        fs_enc = 'ascii'
    if fs_enc != 'ascii':
        return

    extra = ''
    if os.name == 'posix':
        import subprocess
        try:
            rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE).communicate()[0]
        except OSError:
            rv = b''
        good_locales = set()
        has_c_utf8 = False

        # Make sure we're operating on text here.
        if isinstance(rv, bytes):
            rv = rv.decode('ascii', 'replace')

        for line in rv.splitlines():
            locale = line.strip()
            if locale.lower().endswith(('.utf-8', '.utf8')):
                good_locales.add(locale)
                if locale.lower() in ('c.utf8', 'c.utf-8'):
                    has_c_utf8 = True

        extra += '\n\n'
        if not good_locales:
            extra += (
                'Additional information: on this system no suitable UTF-8\n'
                'locales were discovered.  This most likely requires resolving\n'
                'by reconfiguring the locale system.'
            )
        elif has_c_utf8:
            extra += (
                'This system supports the C.UTF-8 locale which is recommended.\n'
                'You might be able to resolve your issue by exporting the\n'
                'following environment variables:\n\n'
                '    export LC_ALL=C.UTF-8\n'
                '    export LANG=C.UTF-8'
            )
        else:
            extra += (
                'This system lists a couple of UTF-8 supporting locales that\n'
                'you can pick from.  The following suitable locales were\n'
                'discovered: %s'
            ) % ', '.join(sorted(good_locales))

        bad_locale = None
        for locale in os.environ.get('LC_ALL'), os.environ.get('LANG'):
            if locale and locale.lower().endswith(('.utf-8', '.utf8')):
                bad_locale = locale
            if locale is not None:
                break
        if bad_locale is not None:
            extra += (
                '\n\nClick discovered that you exported a UTF-8 locale\n'
                'but the locale system could not pick up from it because\n'
                'it does not exist.  The exported locale is "%s" but it\n'
                'is not supported'
            ) % bad_locale

    raise RuntimeError(
        'Click will abort further execution because Python 3 was'
        ' configured to use ASCII as encoding for the environment.'
        ' Consult https://click.palletsprojects.com/en/7.x/python3/ for'
        ' mitigation steps.' + extra
    )
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)
885190
def find_globals_and_nonlocals(node, globs, nonlocals, code, version):
    """"""
    for n in node:
        if isinstance(n, SyntaxTree):
            globs, nonlocals = find_globals_and_nonlocals(n, globs, nonlocals,
                                                          code, version)
        elif n.kind in read_global_ops:
            globs.add(n.pattr)
        elif (version >= 3.0
              and n.kind in nonglobal_ops
              and n.pattr in code.co_freevars
              and n.pattr != code.co_name
              and code.co_name != '<lambda>'):
            nonlocals.add(n.pattr)
    return globs, nonlocals
222240
def sanitize_available_locales(available_languages)
      available_languages.map do |available|
        available.to_s.split(/[_-]/).reject { |part| part.start_with?("x") }.join("-")
      end
    end
525693
function handleLocaleChange({ locale, languageTag }) {
      const newTag = normalize( languageTag );
      if( newTag === tags[ locale ] ) {
         return;
      }
      tags[ locale ] = newTag;
      callbacks[ locale ] = callbacks[ locale ] || [];
      callbacks[ locale ].forEach( f => { f( languageTag ); } );
   }
1285139
def _get_localized_field_checks(self):
        
        localized_fields_checks = []
        for localized_field in self.instance.localized_fields:
            if self.cleaned_data.get(localized_field) is None:
                continue
            f = getattr(self.instance.__class__, localized_field, None)
            if f and f.unique:
                if f.unique:
                    local_name = get_real_fieldname(localized_field, self.language)
                    localized_fields_checks.append((localized_field, local_name))
                    
        return localized_fields_checks
272340
def globals(self):
        """"""
        defglobal = lib.EnvGetNextDefglobal(self._env, ffi.NULL)

        while defglobal != ffi.NULL:
            yield Global(self._env, defglobal)

            defglobal = lib.EnvGetNextDefglobal(self._env, defglobal)
844677
protected void addAllLocalisationsForCleanUp()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "addAllLocalisationsForCleanUp");

        _protoRealization.addAllLocalisationsForCleanUp(_singleServer);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "addAllLocalisationsForCleanUp");
    }
45674
def clean_locale(configuration, locale):
    
    dirname = configuration.get_messages_dir(locale)
    if not dirname.exists():
        # Happens when we have a supported locale that doesn't exist in Transifex
        return
    for filename in dirname.files('*.po'):
        clean_file(configuration, dirname.joinpath(filename))
695006
private void checkLocaleChange(Context context) {
        if (!isCurrentLanguageSetting(context, currentLanguage)) {
            sendOnBeforeLocaleChangedEvent();
            isLocalizationChanged = true;
            callDummyActivity();
            activity.recreate();
        }
    }
344930
public void check()
    {
        for (AnnotationTypeDeclaration atd : _atds)
        {
            Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
            for (Declaration decl : decls)
            {
                check(decl);
            }
        }
    }
492727
protected final void verify() {
        collectInitialisers();
        verifyCandidates();
        verifyInitialisers();
        collectPossibleInitialValues();
        verifyPossibleInitialValues();
        collectEffectiveAssignmentInstructions();
        verifyEffectiveAssignmentInstructions();
        collectAssignmentGuards();
        verifyAssignmentGuards();
        end();
    }
651459
function localeMiddleware(req, res, next) {

    // detect locale
    var locale = undefined, requested = undefined, accept = undefined;
    options.getLocaleFrom.some(function(name) {
      if (name === 'default') return false;
      var strategy = strategies[name];
      locale = strategy.getLocaleFrom(req, options.locales);
      if (!requested) {
        requested = (typeof locale === 'object') ? locale.requestedLocale : locale;
      }
      if (typeof locale === 'object') return true;
      if (options.locales) locale = matchLocale(locale);
      return !!locale;
    });

    // no locale detected to store, try with accept-language
    if (!locale) {
      if (strategies['accept-language']) {
        accept = strategies['accept-language'].getLocalesFrom(req);
        // the first one was already tested with getLocaleFrom
        accept.shift();
        accept.some(function(l) {
          locale = l;
          if (!requested) requested = l;
          if (options.locales) locale = matchLocale(l);
          return !!locale;
        });
      }
    }

    // no locale detected to store, take default locale when added as strategy
    if (!locale) {
      if (strategies.default) {
        locale = strategies.default.getLocaleFrom(req, options.locales);
        requested = null;
      }
    }

    // no locale at all
    if (!locale) return next();

    if (typeof locale === 'string') locale = locale.toLowerCase();
    if (typeof requested === 'string') requested = requested.toLowerCase();

    // store locale
    var localeObject = typeof locale === 'object' ? locale : createLocaleObject(locale, accept, requested);

    // ok finally, locale detected -> store locale
    options.storeLocaleTo.forEach(function(name) {
      var strategy = strategies[name];
      strategy.storeLocaleTo(req, res, localeObject);
    });
    return next();

  }
360556
def verify():
    """"""
    verbose = True
    log(
        "Verifying current directory as a Dallinger experiment...",
        delay=0,
        verbose=verbose,
    )
    ok = verify_package(verbose=verbose)
    if ok:
        log("✓ Everything looks good!", delay=0, verbose=verbose)
    else:
        log("☹ Some problems were found.", delay=0, verbose=verbose)
296793
def register_languages():
    """"""
    for language in set(SUPPORTED_LANGUAGES) - {"en"}:
        language_stemmer = partial(nltk_stemmer, get_language_stemmer(language))
        Pipeline.register_function(language_stemmer, "stemmer-{}".format(language))
293314
def execute_with_locale(locale = ::I18n.locale, &block)
      actual_locale = ::I18n.locale
      ::I18n.locale = locale

      block.call

      ::I18n.locale = actual_locale
    end