Initializes the env scripts for a given language.

@param language the language
@return the list of env scripts. Never null.
975082
protected List<ExecutableScript> initEnvForLanguage(String language) {

    List<ExecutableScript> scripts = new ArrayList<ExecutableScript>();
    for (ScriptEnvResolver resolver : envResolvers) {
      String[] resolvedScripts = resolver.resolve(language);
      if(resolvedScripts != null) {
        for (String resolvedScript : resolvedScripts) {
          scripts.add(scriptFactory.createScriptFromSource(language, resolvedScript));
        }
      }
    }

    return scripts;
  }
727588
public Locale getLocaleOrDefault(String language) {
        String lang = getLanguageOrDefault(language);
        return Locale.forLanguageTag(lang);
    }
1129006
public String getXmlStart(Language lang, Language motherTongue) {
    StringBuilder xml = new StringBuilder(CAPACITY);
    xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
            .append("<!-- THIS OUTPUT IS DEPRECATED, PLEASE SEE http://wiki.languagetool.org/http-server FOR A BETTER APPROACH -->\n")
            .append("<matches software=\"LanguageTool\" version=\"" + JLanguageTool.VERSION + "\"" + " buildDate=\"")
            .append(JLanguageTool.BUILD_DATE).append("\">\n");
    if (lang != null || motherTongue != null) {
      String languageXml = "<language ";
      String warning = "";
      if (lang != null) {
        languageXml += "shortname=\"" + lang.getShortCodeWithCountryAndVariant() + "\" name=\"" + lang.getName() + "\"";
        String longCode = lang.getShortCodeWithCountryAndVariant();
        if ("en".equals(longCode) || "de".equals(longCode)) {
          xml.append("<!-- NOTE: The language code you selected ('").append(longCode).append("') doesn't support spell checking. Consider using a code with a variant like 'en-US'. -->\n");
        }
      }
      if (motherTongue != null && (lang == null || !motherTongue.getShortCode().equals(lang.getShortCodeWithCountryAndVariant()))) {
        languageXml += " mothertongueshortname=\"" + motherTongue.getShortCode() + "\" mothertonguename=\"" + motherTongue.getName() + "\"";
      }
      languageXml += "/>\n";
      xml.append(languageXml);
      xml.append(warning);
    }
    return xml.toString();
  }
81759
public void initialize(Language language, String treeTaggerHome, Boolean annotateTokens, 
			Boolean annotateSentences, Boolean annotatePartOfSpeech, Boolean improveGermanSentences) {
		this.initialize(language, treeTaggerHome, annotateTokens, annotateSentences, annotatePartOfSpeech,
				improveGermanSentences, null);
	}
1183746
public static boolean isDynamicScriptExpression(String language, String value) {
    return StringUtil.isExpression(value) && (language != null && !JuelScriptEngineFactory.names.contains(language.toLowerCase()));
  }
1188157
static String scrubLanguage(String language) {
    if ("ldpi".equals(language)
        || "mdpi".equals(language)
        || "hdpi".equals(language)
        || "xhdpi".equals(language)) {
      return null; // HTC, you suck!
    }
    return language;
  }
1203350
public void addLanguage(Language language) {
        languages.add(language);

        if (dropdown.isAttached()) {
            addLanguageItem(language);
        } else {
            lazyLoaded = true;
        }
    }
12712
public static Locale locale(String language) {
        if (language.contains("_")) {
            String[] sa = language.split("_");
            if (sa.length > 2) {
                return new Locale(sa[0], sa[1], sa[2]);
            } else if (sa.length > 1) {
                return new Locale(sa[0], sa[1]);
            } else {
                return new Locale(sa[0]);
            }
        }
        return new Locale(language);
    }
271908
private static function initLanguageMap($language = '')
    {
        if (count(self::$map) > 0 && (($language == '') || ($language == self::$language))) {
            return;
        }

        // Is a specific map associated with $language?
        if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
            // Move this map to end. This means it will have priority over others
            $m = self::$maps[$language];
            unset(self::$maps[$language]);
            self::$maps[$language] = $m;
        }

        // Reset static vars
        self::$language = $language;
        self::$map = array();
        self::$chars = '';

        foreach (self::$maps as $map) {
            foreach ($map as $orig => $conv) {
                self::$map[$orig] = $conv;
                self::$chars .= $orig;
            }
        }

        self::$regex = '/[' . self::$chars . ']/u';
    }
411867
public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdLangPreferences();
    }
    this.itsId.setLang(this.lang);
  }
459261
@Override
	public void init(ProcessingEnvironment processingEnv) {
		super.init(processingEnv);
		messager = processingEnv.getMessager();
		filer = processingEnv.getFiler();
		fws = new FileWriterServices(messager, filer);

		jsdir = getJsDirectory(processingEnv.getOptions());
		jsfwk = getJsFramework(processingEnv.getOptions());

		initVisitors(jsfwk);
	}
945089
Env<AttrContext> methodEnv(JCMethodDecl tree, Env<AttrContext> env) {
        Env<AttrContext> localEnv =
            env.dup(tree, env.info.dup(env.info.scope.dupUnshared(tree.sym)));
        localEnv.enclMethod = tree;
        if (tree.sym.type != null) {
            //when this is called in the enter stage, there's no type to be set
            localEnv.info.returnResult = attr.new ResultInfo(KindSelector.VAL,
                                                             tree.sym.type.getReturnType());
        }
        if ((tree.mods.flags & STATIC) != 0) localEnv.info.staticLevel++;
        return localEnv;
    }
1353604
public final void initDefault() {
    try {
      this.messages = null;
      this.messages = ResourceBundle.getBundle("Messages");
    } catch (Exception e) {
      this.logger.error(null, SrvI18n.class,
        " when loading msgs for default locale ", e);
    }
    if (messages != null) {
      this.messagesMap.put(Locale.getDefault().getLanguage(), this.messages);
      this.logger.info(null, SrvI18n.class,
        "Added messages for default locale: " + Locale.getDefault());
    } else {
      //If there is no MessagesBundle[current-locale].properties
      this.logger.error(null, SrvI18n.class,
        "There is no messages for current locale: " + Locale.getDefault());
    }
  }
769066
public void setLanguages(java.util.Collection<DominantLanguage> languages) {
        if (languages == null) {
            this.languages = null;
            return;
        }

        this.languages = new java.util.ArrayList<DominantLanguage>(languages);
    }
426543
public function init($language = null)
    {
        if (!$language) {
            $language = $this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.');
        }
        if (strlen($language) < 2) {
            return $this->error('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');
        }

        $model = $this->param('model');
        if (empty($model)) {
            $model = 'I18nMessages';
        }

        $fields = ['domain', 'singular', 'plural', 'context'];

        $model = TableRegistry::get($model);
        $messages = $model->find()
            ->select($fields)
            ->distinct(['domain', 'singular', 'context'])
            ->enableHydration(false)
            ->toArray();

        $entities = $model->newEntities($messages);

        $return = $model->getConnection()->transactional(
            function () use ($model, $entities, $language) {
                $model->deleteAll([
                    'locale' => $language,
                ]);

                foreach ($entities as $entity) {
                    $entity->set('locale', $language);
                    if ($model->save($entity) === false) {
                        return false;
                    }
                }
            }
        );

        if ($return) {
            $this->out('Created ' . count($messages) . ' messages for "' . $language . '"');
        } else {
            $this->out('Unable to create messages for "' . $language . '"');
        }
    }
1177202
public void setScriptText(String scriptText, String language)
    {
        GVRScriptFile newScript = new GVRJavascriptScriptFile(getGVRContext(), scriptText);
        mLanguage = GVRScriptManager.LANG_JAVASCRIPT;
        setScriptFile(newScript);
    }
523356
function (language) {
  for (var i in config.languages) {
    if (config.languages[i] === language) {return true;}
  }
  //
  return false;
}