Beispiel #1
0
 public JsonResult ChangeLanguage(string key)
 {
     try
     {
         Language language = new Language(key);
         languageCookieService.Set("Language", language, 60 * 60 * 7);
         return(Json(true));
     }
     catch
     {
         return(Json(false));
     }
 }
Beispiel #2
0
 private void LoadLanguage()
 {
     if (Language == null)
     {
         Language language = languageCookieService.Get("Language");
         if (language?.KeyCode == null)
         {
             language = new Language("tr");
             languageCookieService.Set("Language", language, 60 * 24 * 7);
         }
         Language = language.KeyCode;
     }
 }
 public void SetLanguage(Language language)
 {
     languageCookieService.Set("CurrentLanguage", language, int.MaxValue);
 }