Exemple #1
0
        public static void Apply(this LanguagesConfig languagesConfig, AppLanguageUpdated @event)
        {
            var fallback = @event.Fallback;

            if (fallback != null && fallback.Count > 0)
            {
                var existingLangauges = languagesConfig.OfType <LanguageConfig>().Select(x => x.Language);

                fallback = fallback.Intersect(existingLangauges).ToList();
            }

            languagesConfig.Set(new LanguageConfig(@event.Language, @event.IsOptional, fallback));

            if (@event.IsMaster)
            {
                languagesConfig.MakeMaster(@event.Language);
            }
        }