Browse Source
Merge pull request #19514 from abpframework/AspNetCore.Culture
Add `.AspNetCore.Culture` cookie when changing language.
pull/19516/head
Enis Necipoglu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
12 additions and
4 deletions
-
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LanguageSwitch.razor
|
|
@ -57,13 +57,21 @@ |
|
|
{ |
|
|
{ |
|
|
await JsRuntime.InvokeVoidAsync( |
|
|
await JsRuntime.InvokeVoidAsync( |
|
|
"localStorage.setItem", |
|
|
"localStorage.setItem", |
|
|
"Abp.SelectedLanguage", language.UiCultureName |
|
|
"Abp.SelectedLanguage", |
|
|
); |
|
|
language.UiCultureName |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
await JsRuntime.InvokeVoidAsync( |
|
|
await JsRuntime.InvokeVoidAsync( |
|
|
"localStorage.setItem", |
|
|
"localStorage.setItem", |
|
|
"Abp.IsRtl", CultureInfo.GetCultureInfo(language.UiCultureName).TextInfo.IsRightToLeft |
|
|
"Abp.IsRtl", |
|
|
); |
|
|
CultureInfo.GetCultureInfo(language.UiCultureName).TextInfo.IsRightToLeft |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
await JsRuntime.InvokeVoidAsync( |
|
|
|
|
|
"abp.utils.setCookieValue", |
|
|
|
|
|
".AspNetCore.Culture", |
|
|
|
|
|
$"c={language.CultureName}|uic={language.UiCultureName}" |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
await JsRuntime.InvokeVoidAsync("location.reload"); |
|
|
await JsRuntime.InvokeVoidAsync("location.reload"); |
|
|
} |
|
|
} |
|
|
|