Makes sure all languages we need are actually created
196339
def verify_available_languages!(options)
      return if options[:skip_metadata]

      # Collect all languages we need
      # We only care about languages from user provided values
      # as the other languages are on iTC already anyway
      v = options[:app].edit_version(platform: options[:platform])
      UI.user_error!("Could not find a version to edit for app '#{options[:app].name}', the app metadata is read-only currently") unless v

      enabled_languages = options[:languages] || []
      LOCALISED_VERSION_VALUES.each do |key|
        current = options[key]
        next unless current && current.kind_of?(Hash)
        current.each do |language, value|
          language = language.to_s
          enabled_languages << language unless enabled_languages.include?(language)
        end
      end

      # Reject "default" language from getting enabled
      # because "default" is not an iTC language
      enabled_languages = enabled_languages.reject do |lang|
        lang == "default"
      end.uniq

      if enabled_languages.count > 0
        v.create_languages(enabled_languages)
        lng_text = "language"
        lng_text += "s" if enabled_languages.count != 1
        Helper.show_loading_indicator("Activating #{lng_text} #{enabled_languages.join(', ')}...")
        v.save!
        Helper.hide_loading_indicator
      end
      true
    end
850115
protected function safeGuardAdditionalMultiLanguageTables()
    {
        $maxLang = $this->getCurrentMaxLangId();
        $multiLanguageTables = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aMultiLangTables');

        if (!is_array($multiLanguageTables) || empty($multiLanguageTables)) {
            return; //nothing to do
        }

        foreach ($multiLanguageTables as $table) {
            if ($this->tableExists($table)) {
                //We start with language id 1 and rely on that all fields for language 0 exists.
                //For language id 0 we have e.g. OXTITLE and logic here would expect it to
                //be OXTITLE_0, add that as new field, leading to incorrect data in views later on.
                for ($i=1; $i<=$maxLang; $i++) {
                    $this->ensureMultiLanguageFields($table, $i);
                }
            }
        }
    }
1027450
def install_translations(config):
    """"""

    if not config:
        return

    from . import _translation
    checks_translation = gettext.translation(domain=config["domain"],
                                             localedir=internal.check_dir / config["localedir"],
                                             fallback=True)
    _translation.add_fallback(checks_translation)
837318
private void setupLanguage() {
        Locale locale = LanguageSetting.getLanguage(activity);
        setupLocale(locale);
        currentLanguage = locale;
        LanguageSetting.setLanguage(activity, locale);
    }
1148235
public function saveLanguage()
    {
        $language = Common::getRequestVar('language');

        // Prevent CSRF only when piwik is not installed yet (During install user can change language)
        if (DbHelper::isInstalled()) {
            $this->checkTokenInUrl();
        }

        LanguagesManager::setLanguageForSession($language);
        Url::redirectToReferrer();
    }
94064
protected function submitEditLanguage()
    {
        if ($this->isPosted('delete')) {
            $this->deleteLanguage();
        } else if ($this->isPosted('save') && $this->validateLanguage()) {
            if (isset($this->data_language['code'])) {
                $this->updateLanguage();
            } else {
                $this->addLanguage();
            }
        }
    }
135049
function Compiler(locales, formats, pluralFn) {
  this.locales = locales;
  this.formats = formats;
  this.pluralFn = pluralFn;
}
1259574
def languages
      if default_language != nil
        # Use specified default language as primary language
        [default_language]
      else
        # Calculate the intersection of native development and used languages,
        # fallback to the latter only, if it is empty
        languages = native_dev_languages & used_languages
        if languages.empty?
          used_languages
        else
          languages
        end
      end
    end
144234
def activate_language(instances, language):
    
    language = (
        language if language in get_supported_languages() else get_fallback_language()
    )
    for instance in instances:
        instance.activate_language(language)
1281732
public function actionUpdateAll()
    {
        
        // Scan the locales folder for languages in the wwextension and
        // launch actionUpdate for each of them.

    	// Get the list of languages that will be updated.
		$locales = $this->getLanguageList();

		// We now identified locales to be updated.
    	$this->outVerbose("Languages '" . implode(',', $locales) . "' will be updated for extension '" . $this->options['extension'] . "'.");
    	foreach ($locales as $l) {
    		$this->options['language'] = $l;
    		$this->checkUpdateInput();
    		$this->actionUpdate();
    		
    		$this->outVerbose("");
    	}
        
    }
157076
function (inside, before, insert, root) {
			root = root || _.languages;
			var grammar = root[inside];
			var ret = {};
				
			for (var token in grammar) {
			
				if (grammar.hasOwnProperty(token)) {
					
					if (token == before) {
					
						for (var newToken in insert) {
						
							if (insert.hasOwnProperty(newToken)) {
								ret[newToken] = insert[newToken];
							}
						}
					}
					
					ret[token] = grammar[token];
				}
			}
			
			return root[inside] = ret;
		}
249451
private static function init() {
        $lang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) : null;
        if (empty($lang))
            $lang = "es";
        self::$language = $lang;
        self::$messages = [];
        self::$messagesPath = get_property("app.messages_path", get_app()->resourcesPath() . DIRECTORY_SEPARATOR . "messages");
    }
578405
def _setup_language_variables(self):
        
        if self.language not in AVAILABLE_LANGUAGES:
            # If no official repos, check if user has custom
            user_defined_corpora = self._check_distributed_corpora_file()
            if user_defined_corpora:
                return user_defined_corpora
            else:
                msg = 'Corpora not available (either core or user-defined) for the "{}" language.'.format(self.language)
                logger.info(msg)
                raise CorpusImportError(msg)
        else:
            user_defined_corpora = self._check_distributed_corpora_file()
            return user_defined_corpora
27950
def make(parser):
    """"""
    s = parser.add_subparsers(
        title='commands',
        metavar='COMMAND',
        help='description',
        )

    def create_manila_db_f(args):
        create_manila_db(args)
    create_manila_db_parser = create_manila_db_subparser(s)
    create_manila_db_parser.set_defaults(func=create_manila_db_f)

    def create_service_credentials_f(args):
        create_service_credentials(args)
    create_service_credentials_parser = create_service_credentials_subparser(s)
    create_service_credentials_parser.set_defaults(func=create_service_credentials_f)

    def install_f(args):
        install(args)
    install_parser = install_subparser(s)
    install_parser.set_defaults(func=install_f)
1082106
public void populateLanguages() {
    dataService.add(
        LANGUAGE,
        languageFactory.create(
            LanguageService.DEFAULT_LANGUAGE_CODE, LanguageService.DEFAULT_LANGUAGE_NAME, true));
    dataService.add(
        LANGUAGE,
        languageFactory.create("nl", new Locale("nl").getDisplayName(new Locale("nl")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("pt", new Locale("pt").getDisplayName(new Locale("pt")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("es", new Locale("es").getDisplayName(new Locale("es")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("de", new Locale("de").getDisplayName(new Locale("de")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("it", new Locale("it").getDisplayName(new Locale("it")), false));
    dataService.add(
        LANGUAGE,
        languageFactory.create("fr", new Locale("fr").getDisplayName(new Locale("fr")), false));
    dataService.add(LANGUAGE, languageFactory.create("xx", "My language", false));
  }
924718
public function requirements()
    {
        if (!$this->_step('language')) {
            $this->redirect(['plugin' => 'Installer', 'controller' => 'startup', 'action' => 'language']);
        }

        $tests = $this->_getTester();
        $errors = $tests->errors();

        if (empty($errors)) {
            $this->_step();
        }

        $this->title(__d('installer', 'Server Requirements'));
        $this->set('errors', $errors);
    }
1340910
public Language create(String code, String name, boolean active) {
    Language language = super.create(code);
    language.setName(name);
    language.setActive(active);
    return language;
  }