public void WhenUserClickOnAddButton() { //Add profile Language Langobj = new Language(); Langobj.AddLanguage(); }
public static void LoadResources(List <string> packFilenames) { Log.Info("Resource load requested"); UnloadResources(); foreach (var packFilename in packFilenames) { try { var pack = new ResourcePack(Path.Combine("resourcepacks", packFilename)); Log.Info($"Adding resource pack {packFilename}"); Log.Info($" {pack.Description.RawText}"); LoadedPacks.Add(pack); foreach (var lang in pack.AdditionalLanguages) { Language.AddLanguage(lang, overwrite: false); } } catch (Exception e) { Log.Error($"Couldn't parse resource pack {packFilename}: {e.Message}"); throw; } } foreach (var manager in Managers) { manager.LoadResources(); } }
public Task InitializeAsync(CancellationToken ct = default) { foreach (var(key, value) in options) { if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(value)) { Language.AddLanguage(key, value); } } return(Task.CompletedTask); }
/// <summary> /// Saves the changes. /// </summary> /// <param name="context">The context.</param> public void SaveChanges(IDictionary context) { if (LanguageId > 0) { Language.UpdateLanguage(LanguageId, tbLanguageName.Text, FriendlyNameText.Text, IsDefault.IsSelected); } else { // add new language Language.AddLanguage(tbLanguageName.Text, FriendlyNameText.Text, IsDefault.IsSelected); } }