public void AddLocale(string locale, IEnumerable <KeyValuePair <string, string> > localizedStringsWithTags) { Dictionary <string, string> currentLocale = null; if (string.IsNullOrEmpty(locale)) { throw new ArgumentNullException(nameof(locale)); } if (localizedStringsWithTags == null) { throw new ArgumentNullException(nameof(localizedStringsWithTags)); } if (this.installedLocalesDictionary.ContainsKey(locale)) { currentLocale = this.installedLocalesDictionary[locale]; if (currentLocale != null) { currentLocale.Clear(); } else { this.installedLocalesDictionary.Remove(locale); } } if (currentLocale == null) { currentLocale = new Dictionary <string, string>(); } foreach (KeyValuePair <string, string> currentLocalizedString in localizedStringsWithTags) { currentLocale.Add(currentLocalizedString.Key, currentLocalizedString.Value); } this.installedLocalesDictionary.Add(locale, currentLocale); }