Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge localization-docs-fix-1988 into production #1994

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions globalization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ app.Run();

>caption Step 2 - Sample controller for changing the thread UI culture and redirecting the user (a redirect is required by the framework)

<div class="skip-repl"></div>

````CS
[Route("[controller]/[action]")]
public class CultureController : Controller
Expand Down Expand Up @@ -209,14 +211,14 @@ public class CultureController : Controller
public string Value { get; set; }
}

public List<CultureData> Cultures { get; set; } = new List<CultureData>()
private List<CultureData> Cultures { get; set; } = new List<CultureData>()
{
new CultureData() { Text = "English", Value = "en-US" },
new CultureData() { Text = "French", Value = "fr-FR" },
new CultureData() { Text = "Bulgarian", Value = "bg-BG" },
};

public string SelectedCulture { get; set; } = Thread.CurrentThread.CurrentUICulture.Name;
private string SelectedCulture { get; set; } = Thread.CurrentThread.CurrentUICulture.Name;

public void OnValueChanged(string eventArgs)
{
Expand All @@ -240,6 +242,8 @@ public class CultureController : Controller

>tip You must implement the indexer only. You can obtain the needed strings from any source you prefer and that matches your application needs, such as database, `resx` files, `json` files, hash tables, and so on.

<div class="skip-repl"></div>

````CS
using Telerik.Blazor.Services;

Expand Down Expand Up @@ -294,3 +298,4 @@ Make sure to:
## See Also

* [Globalization Overview]({%slug globalization-overview%})
* [Localize Only Some Component Labels]({%slug common-kb-localize-selected-localization-keys%})
Loading