Closed faresayyad closed 1 year ago
Is this unexpected behavior regarding using .Net core 6 ??
Hi @faresayyad ,
When you set a culture as default culture, XLocalizer assumes that the default texts are written with the default culture, so it doesn't localize the default culture by default.
e.g.:
<!-- if default culture is ar -->
<!-- in the view it is expected to have the texts in Arabic -->
<h1 localize-content>مرحبا</h1>
But if you have these texts in a culture different than the default culture, "en" for exmple; then you can tell XLocalizer to localize default culture as well:
services.AddControllersWithViews()
.AddXLocalizer<LocSource>(ops =>
{
...
ops.LocalizeDefaultCulture = true;
});
Hello,
I am trying to make the primary language(Default request): Arabic, The code in ConfigureServices is the following:
The defCulture variable is: ar and the cultures variable is an array of two values {'ar','en'}
In the Configure method:
In the view i have the following:
When debugging the code with breakpoint the variable requestCulture value is : ar
but the issue is with the values read from resx file, such as:
@_loc.GetString("Search")
the search name and value exist in the \LocalizationResources folder within LocSource.ar.resx file.the value Search(as an example) is still in English, it's not translated into Arabic.!!?