Checks and sets the per language WPM, singular and plural values.
541991
def _set_lang_settings(self, lang_settings):
        
        is_int = isinstance(lang_settings, int)
        is_dict = isinstance(lang_settings, dict)
        if not is_int and not is_dict:
            raise TypeError(("Settings 'READTIME_WPM' must be either an int,"
                             "or a dict with settings per language."))

        # For backwards compatability reasons we'll allow the
        # READTIME_WPM setting to be set as an to override just the default
        # set WPM.
        if is_int:
            self.lang_settings['default']['wpm'] = lang_settings
        elif is_dict:
            for lang, conf in lang_settings.items():
                if 'wpm' not in conf:
                    raise KeyError(('Missing wpm value for the'
                                    'language: {}'.format(lang)))

                if not isinstance(conf['wpm'], int):
                    raise TypeError(('WPM is not an integer for'
                                     ' the language: {}'.format(lang)))

                if "min_singular" not in conf:
                    raise KeyError(('Missing singular form for "minute" for'
                                    ' the language: {}'.format(lang)))

                if "min_plural" not in conf:
                    raise KeyError(('Missing plural form for "minutes" for'
                                    ' the language: {}'.format(lang)))

                if "sec_singular" not in conf:
                    raise KeyError(('Missing singular form for "second" for'
                                    ' the language: {}'.format(lang)))

                if "sec_plural" not in conf:
                    raise KeyError(('Missing plural form for "seconds" for'
                                    ' the language: {}'.format(lang)))

            self.lang_settings = lang_settings
760888
public function setPluralRule($pluralRule)
	{
		$this->pluralRule = $pluralRule;
		$this->langkeyValidator->setPluralRule($pluralRule);
		return $this;
	}
37807
public function setLanguage($language)
    {
        if (!isset($this->keywords[$language])) {
            $this->language = 'en';
        } else {
            $this->language = $language;
        }
    }
32576
function validate(cldr, pluralize) {
  pluralize.formats.forEach(function(key) {
    if (!cldr[key]) throw new Error('translation object missing required key "' + key + '"');
  });
}
325580
public void setLanguage(String language) {
	if (StringUtil.isEmpty(language)) return;
	this.language = Collection.validateLanguage(language);
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
740357
private static void checkForOtherVariants(Data data, ULocale locale, String style) {
        DecimalFormat.Unit[] otherByBase = data.units.get(OTHER);

        if (otherByBase == null) {
            throw new IllegalArgumentException("No 'other' plural variants defined in "
                    + localeAndStyle(locale, style));
        }

        // Check all other plural variants, and make sure that if any of them are populated, then
        // other is also populated
        for (Map.Entry<String, Unit[]> entry : data.units.entrySet()) {
            if (entry.getKey() == OTHER) continue;
            DecimalFormat.Unit[] variantByBase = entry.getValue();
            for (int log10Value = 0; log10Value < MAX_DIGITS; log10Value++) {
                if (variantByBase[log10Value] != null && otherByBase[log10Value] == null) {
                    throw new IllegalArgumentException(
                            "No 'other' plural variant defined for 10^" + log10Value
                            + " but a '" + entry.getKey() + "' variant is defined"
                            + " in " +localeAndStyle(locale, style));
                }
            }
        }
    }
1155907
public function sp($singular, $plural, $count, $autoTranslate = false) {
		if ((int)$count !== 1) {
			$result = $plural;
		} else {
			$result = $singular;
		}

		if ($autoTranslate) {
			$result = __($result);
		}
		return $result;
	}
649430
def _Pluralize(value, unused_context, args):
    """"""
    
    if len(args) == 0:
        s, p = '', 's'
    elif len(args) == 1:
        s, p = '', args[0]
    elif len(args) == 2:
        s, p = args
    else:
        # Should have been checked at compile time
        raise AssertionError
    
    if value > 1:
        return p
    else:
        return s
225942
def setLanguages(self, languages):
        
        if isinstance(languages, six.string_types):
            languages = [languages]
        for lang in languages:
            assert len(lang) == 3, "Expected to get language in ISO3 code"
        self.topicPage["langs"] = languages
1232702
public void setLanguageIn(LanguageMode languageIn) {
    checkState(languageIn != LanguageMode.NO_TRANSPILE);
    checkState(languageIn != LanguageMode.UNSUPPORTED);
    this.languageIn = languageIn == LanguageMode.STABLE ? LanguageMode.STABLE_IN : languageIn;
  }
945970
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nSeGoods();
    }
    this.itsId.setLang(this.lang);
  }
1092073
protected function setLanguageProperties()
    {
        if (!$this->isInternalRoute()) {

            $langcode = $this->route->getLangcode();

            if (!empty($langcode)) {
                $this->langcode = $langcode;
                $this->translation->set($langcode, $this->current_route['simple_pattern']);
                $this->current_language = $this->language->get($this->langcode);
            }
        }
    }
446034
def _update_settings(self, dialect):
        """"""

        # the first parameter is the dialect itself --> ignore
        for parameter in self.csv_params[2:]:
            pname, ptype, plabel, phelp = parameter

            widget = self._widget_from_p(pname, ptype)

            if ptype is types.TupleType:
                ptype = types.ObjectType

            digest = Digest(acceptable_types=[ptype])

            if pname == 'self.has_header':
                if self.has_header is not None:
                    widget.SetValue(digest(self.has_header))
            else:
                value = getattr(dialect, pname)
                widget.SetValue(digest(value))
970758
protected function setLanguages()
    {
        if ((count($this->languages) === 0) && ! empty($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ])) {
            $this->languages = explode(
                ',',
                preg_replace(
                    '/(;\s?q=[0-9\.]+)|\s/i',
                    '',
                    strtolower(trim($_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ]))
                )
            );
        }

        if (count($this->languages) === 0) {
            $this->languages = ['Undefined'];
        }
    }
301399
def languages(self, value):
        

        if value is not None:
            assert type(value) is list, "'{0}' attribute: '{1}' type is not 'list'!".format("languages", value)
            for element in value:
                assert type(element) is Language, "'{0}' attribute: '{1}' type is not 'Language'!".format(
                    "languages", element)
        self.beginResetModel()
        self.__languages = value
        self.endResetModel()
707724
private function setCache($singular, $plural = null)
    {
        $singular = Utf8String::strtolower($singular);

        if ($plural === null) {
            $plural = $singular;
        } else {
            $plural = Utf8String::strtolower($plural);
        }

        $this->cache[$singular] = $plural;
    }