-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michael de Bruin <[email protected]>
- Loading branch information
1 parent
64f7cc6
commit 9c961c2
Showing
16 changed files
with
635 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@using Microsoft.Extensions.Options | ||
|
||
@inject IOptions<RequestLocalizationOptions> LocalizationOptions | ||
@inject NavigationManager Navigation | ||
|
||
<div class="mt-3 mb-3 mx-5"> | ||
@if (LocalizationOptions.Value.SupportedCultures != null) | ||
{ | ||
@foreach (var culture in LocalizationOptions.Value.SupportedCultures) | ||
{ | ||
<a onclick="location.href = '@SetCulture(culture.Name)'" class="text-decoration-none"> | ||
<span class="badge rounded-pill mx-1 @(culture.ToString() == CultureInfo.CurrentCulture.ToString()?"bg-primary":"bg-primary-dark")">@culture</span> | ||
</a> | ||
} | ||
} | ||
</div> | ||
|
||
@code | ||
{ | ||
private string SetCulture(string culture) | ||
{ | ||
const string cultureParamName = "culture"; | ||
|
||
var url = Navigation.GetUriWithQueryParameter(cultureParamName, culture); | ||
return url; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.