Comments (10)
Check if you have a culture paramter setup already made in page route, if so remove it because the code below is already adding the culture parameter to all routes.
.AddMvcOptions(ops => ops.Conventions.Insert(0, new RouteTemplateModelConventionMvc()))
Or delete the above line if you want to use your own culture parameter setup.
from xlocalizer.
After remove this line -> .AddMvcOptions(ops => ops.Conventions.Insert(0, new RouteTemplateModelConventionMvc()))
when choosing language -> error
This localhost page canβt be foundNo webpage was found for the web address: https://localhost:44349/ar
HTTP ERROR 404
from xlocalizer.
After removing that line you need to manually add the culture parameter to the routes {culture}
from xlocalizer.
add to this line -> like this
<language-nav cookie-handler-url="@Url.Action("SetCultureCookie", "Home", "{culture}",new { area="", cltr="{0}", returnUrl="{1}", culture=CultureInfo.CurrentCulture.Name })">
from xlocalizer.
So if it is ok now we can close this issue, is it?
from xlocalizer.
sir,
when using the package LazZiya.ExpressLocalization
after running the code shown in this route ->
https://localhost:44349/en/Identity/Account/Login/?ReturnUrl=/en/
so, this route is wrong and this true route -> https://localhost:44349/Account/Login/?culture=en
so how to edit my route to be true
#note I'm using .net 6
and this is my code in program.cs
CultureInfo us = new CultureInfo("en-US");
var cultures = new CultureInfo[]
{ new CultureInfo("en"),
new CultureInfo("ar")
{ DateTimeFormat = us.DateTimeFormat } };
// Add services to the container.
builder.Services.AddControllersWithViews()
.AddExpressLocalization<LocSource>(
ops =>
{
ops.ResourcesPath = "LocalizationResources";
ops.RequestLocalizationOptions = o =>
{
o.SupportedCultures = cultures;
o.SupportedUICultures = cultures;
o.DefaultRequestCulture = new RequestCulture("en");
};
});
app.UseRequestLocalization();
from xlocalizer.
Well, I see you are using LazZiya.ExpressLocalization
, I recommend you switch to XLocalizer
, it is much better in terms of flexibility and provides better support for newer frameworks.
from xlocalizer.
After removing that line you need to manually add the culture parameter to the routes {culture}
how invested this lin by parameter {culture}
.AddMvcOptions(ops => ops.Conventions.Insert(0, new RouteTemplateModelConventionMvc()))
please tell me step by step
from xlocalizer.
With reference to XLocalizer version of RouteTemplateModelConventionMvc()
, it adds a route parameter named {culture?}
to all routes in the app, so you don't have to add it manually to each route in the routing table.
// e.g.:
[controller]/[action] --> {culture?}/[controller]/[action]
from xlocalizer.
Hi @Malkawi1 ,
Do you still need support with this issue?
from xlocalizer.
Related Issues (20)
- Multi-tenancy provider HOT 3
- Adding option to refresh cache memory HOT 3
- AmbiguousActionException when using services.AddMvc().AddXDbLocalizer<TDbContext, TTranslator>() HOT 7
- FluentValidation placeholders with XLocalizer HOT 2
- localize-att- and localize-att-args- HOT 3
- InvalidOperationException: Cache entry must specify a value for Size when SizeLimit is set. HOT 1
- Is it possible to localize <select asp-items />? HOT 4
- XLocalizer.DB database concurrency problem HOT 11
- How to set default culture? HOT 2
- localize-att- in Hyperlinks has forced localize-content HOT 1
- Blazor AddXDbLocalizer HOT 7
- localize-att-* also localize tag's content HOT 4
- RESX file reload at startup HOT 7
- fail: XLocalizer.Resx.ResxResourceProvider[0] HOT 7
- XLocalizer.Resx.ResxResourceProvider HOT 15
- Set Arabic as default request culture HOT 2
- FormatException: Input string was not in a correct format. HOT 9
- translating html tags HOT 1
- Configure XLocalizer to use XML files inside an RCL HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlocalizer.