Example #1
0
        /// <summary>
        /// <para>Registers a plurality evaluator function for the specified culture.</para>
        /// <para>Plurality evaluators are used to determine which string variant to use for a given quantity of items.</para>
        /// </summary>
        /// <param name="culture">The culture for which to register a plurality evaluator.</param>
        /// <param name="evaluator">The evaluator to register.</param>
        public static void RegisterPluralityEvaluator(String culture, LocalizationPluralityEvaluator evaluator)
        {
            Contract.RequireNotEmpty(culture, nameof(culture));
            Contract.Require(evaluator, nameof(evaluator));

            registeredPluralityEvaluators[culture] = evaluator;
        }
        /// <summary>
        /// Registers a plurality evaluator function for the specified language. Plurality evaluators are used to determine
        /// which string variant to use for a given quantity of items.
        /// </summary>
        /// <param name="language">The language for which to register a plurality evaluator.</param>
        /// <param name="evaluator">The evaluator to register.</param>
        public static void RegisterPluralityEvaluatorForLanguage(String language, LocalizationPluralityEvaluator evaluator)
        {
            Contract.RequireNotEmpty(language, nameof(language));
            Contract.Require(evaluator, nameof(evaluator));

            registeredPluralityEvaluatorsByLanguage[language] = evaluator;
        }
Example #3
0
        /// <summary>
        /// <para>Registers a plurality evaluator function for the specified culture.</para>
        /// <para>Plurality evaluators are used to determine which string variant to use for a given quantity of items.</para>
        /// </summary>
        /// <param name="culture">The culture for which to register a plurality evaluator.</param>
        /// <param name="evaluator">The evaluator to register.</param>
        public static void RegisterPluralityEvaluator(String culture, LocalizationPluralityEvaluator evaluator)
        {
            Contract.RequireNotEmpty(culture, "culture");
            Contract.Require(evaluator, "evaluator");

            registeredPluralityEvaluators[culture] = evaluator;
        }