Exemple #1
0
 /// <summary>
 /// Change language
 /// </summary>
 /// <param name="language"></param>
 private void ChangeLanguage(Language language)
 {
     MovieService.ChangeTmdbLanguage(language);
     ShowService.ChangeTmdbLanguage(language);
     LocalizeDictionary.Instance.Culture = new CultureInfo(language.Culture);
     Messenger.Default.Send(new ChangeLanguageMessage());
 }
Exemple #2
0
 /// <summary>
 /// Set the current language of the application
 /// </summary>
 /// <param name="language">Language</param>
 public void SetCurrentLanguage(Language language)
 {
     User.Language.Culture = language.Culture;
     MovieService.ChangeTmdbLanguage(language);
     ShowService.ChangeTmdbLanguage(language);
     LocalizeDictionary.Instance.Culture = new CultureInfo(language.Culture);
     Messenger.Default.Send(new ChangeLanguageMessage());
 }
Exemple #3
0
 /// <summary>
 /// Set the current language of the application
 /// </summary>
 /// <param name="language">Language</param>
 public async Task SetCurrentLanguageAsync(Language language)
 {
     try
     {
         var watch = Stopwatch.StartNew();
         User = await GetUser().ConfigureAwait(false);
         User.Language.Culture = language.Culture;
         ChangeLanguage(User.Language);
         await UpdateUser(User).ConfigureAwait(false);
         watch.Stop();
         var elapsedMs = watch.ElapsedMilliseconds;
         Logger.Debug(
             $"SetCurrentLanguageAsync ({User.Language.Name}) in {elapsedMs} milliseconds.");
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
 }