question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Abp.Localization.CultureName" should be configurable

See original GitHub issue

this line is used in ChangeCulture action

Response.Cookies.Add(new HttpCookie("Abp.Localization.CultureName", cultureName) { Expires = Clock.Now.AddYears(2) });

my issue that “Abp.Localization.CultureName” is fixed, it should be configurable, because if i’m developing more than one project, or the user is using more than one application developed by abp framework it will use the same cookie value for all applications

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
hikalkancommented, Feb 2, 2017

Should be like that:

Configuration.Modules.AbpWeb().Localization.CookieName = "MyCookieName";

Write this into PreInitialize method of your module (http://www.aspnetboilerplate.com/Pages/Documents/Module-System#DocModuleLifecycleEvents).

0reactions
glauco-basiliocommented, Feb 1, 2017

@emaish this fix works for you? I looked at the commit but i cant figured out where to set the webLocalizationConfiguration.CookieName in an effective way. I am working with virtual dirs too. The first cookie i receive after set webLocalizationConfiguration.CookieName in the constructor of my controller base has a path (eg. “/arg” my virtual dir) but then i call ChangeCulture then the response i receive a second cookie, duplicated not overrided, with the same name and the having the new value but with the “/” path. And this way the application no recognize the new culture keeping the first cookie as application culture. Can you put some light here? I have workaronded forcing Request.Cookies[_webLocalizationConfiguration.CookieName].Path = Request.ApplicationPath, but i think this is the wrong way

Read more comments on GitHub >

github_iconTop Results From Across the Web

Registering XML Localization Sources
ABP has built-in AbpLocalizationController , its ChangeCulture method changes the current language by writing cookies. It also changes the user's default ...
Read more >
UI/AspNetCore/JavaScript API/Localization
abp.localization.defaultResourceName can be set to change the default localization resource. You normally don't set this since the ABP Framework automatically ...
Read more >
Possibility to ignore application path in language cookie
I need to generate the language cookie "Abp.Localization.CultureName" ignoring the application path. I found in the source code this part:
Read more >
Cannot change Languages through Language select drop ...
I believe the issue is coming from the setting of the Abp.Localization.CultureName cookie - When inspecting the cookies in Chrome, I can see ......
Read more >
[ABP Source code Analysis] 13, multi-lingual (localization) ...
If you want to enable multiple languages, you need to change the UseAbpRequestLocalization status to True at the Configure() in the Startup ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found