Comments (3)
Great, it working now. Hope you can add this to your documentation. Thanks!
from expresslocalization.
First I will give the solution, then you can read the explanation for more details.
Disable the framework localization culture providers and use only RouteSegmentCultureProvider as below:
services.AddRazorPages()
.AddExpressLocalization<ExpressLocalizationResource, ViewLocalizationResource>(ops =>
{
// Use only route segment culture provider
ops.UseAllCultureProviders = false;
// the rest of the code...
});
Explanation
When using all the localization culture providers, the localization process will check all available culture providers in order to detect the request culture. If the request culture is found it will stop checking and do localization accordingly. If the request culture is not found it will check the next provider by order. Finally if no culture is detected the default culture will be used.
Checking order for request culture:
- RouteSegmentCultureProvider
- QueryStringRequestCultureProvider
- CookieRequestCultureProvider
- AcceptedLanguageHeaderRequestCultureProvider
- Use default request culture from startup settings
So, in your case, I can guess that the localization is falling to no. 4, you can check it in your browser settings.
If you don't prefere this behavior, you can simply use only RouteSegmentCultureProvider and disable other providers as mentioned above, so when there is no culture in the route the default culture will be used.
from expresslocalization.
Thanks for your feedback, I'll add it to the docs soon :)
from expresslocalization.
Related Issues (20)
- Roadmap HOT 2
- Can we create custom DataAnnotations to avoid re-typing ErrorMessage in every attribute HOT 1
- Case sensitivity mismatch HOT 2
- Null pointer exception HOT 5
- Change culture along with Area and extra parameter HOT 6
- Language Selection Dropdown not Working HOT 4
- NullReferenceException when RazorPages is not enabled for MVC project with .NET CORE 3.1 HOT 3
- Missing ExRequiredAttributeAdapter HOT 3
- RoutePatternException HOT 8
- DataAnnotation messages not being translated HOT 2
- Retrieve Value from .resx file HOT 6
- Problem with ExpressValidationAttributeAdapterProvider HOT 7
- ExRange unexpected behavior as Required HOT 3
- ExpressLocalizationCore3 Field Validation Issue HOT 2
- Culture is not supported HOT 9
- Null Reference Error HOT 4
- Urls without language tag does not work. HOT 2
- Localization with query string HOT 3
- Breaking change in MS.NET.Test.Sdk HOT 5
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 expresslocalization.