Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "jcompagnon"

Hello again,

I believe I've got a lead on why I'm receiving duplicated cookies for the current culture, but I'm not sure where to go from here.

While looking over the source code on Github for the Abp.Web & Abp.Web.Mvc modules, I see 2 places that a 'CultureName' cookie is set - one in Abp.Web.Localization.CurrentCultureSetter, and the other in the AbpLocalizationController's ChangeCulture call inside Abp.Web.Mvc.

I think the issue I'm facing is due to the fact that the CurrentCultureSetter's method specifies "Path = [application path]", whereas the ChangeCulture call does not specify a path - but then again, if this is the issue, I don't understand how it was worknig for me previously.

I'd appreciate any input or guidance on this. In the meantime, thanks again, and good job on the clean framework!

Hello,

Are there any updates on this? I'm circling back to the issue every few days to see if I can approach it another way, but I'm still stuck with duplicating cookies. Any help would be greatly appreciated!

My apologies - I'm using ASP.NET Zero configured for MPA when running into this issue.

Separately, I've tried installing the base MVC 5.X w/jQuery to see if I could replicate the issue, and in that project, I also see duplicate culture cookies after trying to switch languages unsuccessfully.

Hello!

No, currently we're using the MVC w/ JQuery setup.

Hello,

I'm currently running into a problem where attempting to change a user's culture from the language dropdown list is failing.

I can see that the call to the AbpLocalizationController's 'ChangeCulture' is going through, but the request reloads the dashboard page in the same language, rather than updating to the new selection.

This issue only appeared after a Clean & Rebuild operation - prior to this, it worked, so I'm not sure why the this would be behaving any differently.

I believe the issue is coming from the setting of the Abp.Localization.CultureName cookie - When inspecting the cookies in Chrome, I can see that the a cookie for the new language is added; however, the previous cookie still exists, and has a "Path" set to the application directory - causing the old language to still be used as the culture. I've tried clearing my cache, removing the cookies, and

I'm not sure how to correct this - from my project, the only reference I see to adding this cookie is done in the web project's Global.asax "RestoreUserLanguage" method:

private void RestoreUserLanguage()
        {
            var settingManager = AbpBootstrapper.IocManager.Resolve<ISettingManager>();
            var defaultLanguage = settingManager.GetSettingValue(LocalizationSettingNames.DefaultLanguage);

            if (defaultLanguage.IsNullOrEmpty())
            {
                return;
            }

            try
            {
                CultureInfo.GetCultureInfo(defaultLanguage);
                Response.Cookies.Add(new HttpCookie("Abp.Localization.CultureName", defaultLanguage) { Expires = Clock.Now.AddYears(2)});
            }
            catch (CultureNotFoundException exception)
            {
                LogHelper.Logger.Warn(exception.Message, exception);
            }
        }

I've registered the languages to be used in the EntityFramework's DefaultLanguagesCreator() method, and re-ran update-database in that project to ensure the DB was seeded appropriately.

Is there something I'm missing to allow for swapping languages? Thanks in advance for any help/advice!

Perfect; thank you for your help!

Hello,

I am working on the same team as @cjannel. Thank you for your responses; they're insightful and really helping me grasp the larger picture.

To follow up your earlier question, we are currently posting the form info through the app service; we would like to add attributes to the Dto definitions in the application layer. So, the questions would be, a: is it feasible to define a custom attribute to use on the Dtos, (which in addition to being based on ComponentModel.DataAnnotations.ValidationAttribute, implements System.Web.Mvc.IClientValidatable to provide the metadata required for our unobtrusive jQuery to work)?; and b: where should the annotation be defined in the project?

Thanks again in advance!

Thank you for the response!

If I understand correctly, the idea would be to create an Enum model of each list, with the Enum elements being the keys used to fetch the localized string from the XML?

I do like this as an option if there were a small number of fairly short lists; however, if there are many & larger lists, then having to create an Enum with all the elements mapped per list, seems like it could get tedious. Ideally, we'd want a dev to be able to receive the XML from a BA, plug it in, and then be able to use the resources directly.

I was hoping there was some way to mark a list within the XML itself and have the resource manager pick out text by parent-list name; it doesn't look like that's currently possible though.

One alternative might be to have separate Localization Sources for each list, but to do this and still have a plug-and-play approach for the resource files, I could, for instance, loop through all resource-bearing folders in my app's "/localization" directory, using the folder names as source names. In this way, I could receive a "ListICD9" folder with localized XML files therein, add this to my "/localization" directory, and be able to retrieve the list values by calling the "ListICD9" source.

Do you think this approach would be workable?

Hello, nice job on the framework!

I was wondering if there were suggested best practices /avenues for localizing list data (as might be used in setting dropdowns, related radio groups, or "levels of satisfaction" scales).

I understood from this thread that creating a service to receive a language code & return the list is one option; my question is, what would this look like in the XML scheme?

If possible, I'd like to not have to register each list as a separate Localization Source in the AbpModule, instead being able to specify a source that would include all localizations for all lists, labels, and error resources.

I'd appreciate any tips, leads or re-orientations!

Showing 31 to 39 of 39 entries