Nop 4.0 customer registration page date picker not localized

Posted: February 18, 2018 at 5:33 PM Quote #200833
Hi!

I can't get the date picker on the customer registration page to get localized. When I click on Register, the date picker have the default values "Day", "Month" and "Year" but I would like them localized. All string resources in the table are translated so I cannot figure out where to change this, not even when I look in the sourcecode.
Help is preciated :)

Regards Markus
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: February 18, 2018 at 11:06 PM Quote #200840
d99mj wrote:
Hi!

I can't get the date picker on the customer registration page to get localized. When I click on Register, the date picker have the default values "Day", "Month" and "Year" but I would like them localized. All string resources in the table are translated so I cannot figure out where to change this, not even when I look in the sourcecode.
Help is preciated :)

Regards Markus


Resource Names are

Common.Day
Common.Month
Common.Year

Try to change below resources.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Thanks & Kind Regards
Pratik Manek
SuperNop Solutions

Visit out Official site for Plugins or Customization,
PM me if you want to hire us, or you can visit us at
http://www.supernopcommerce.com/
Email:  [email protected]
Skype: supernopcommerce

Please +1 if this post help
Posted: February 19, 2018 at 4:43 PM Quote #200888
Hi!

Thanks for you help! Unfortunately they already are translated and it still doesen't work. I have tried to change the resource value from Nop Admin, empty cache and still no luck. When I debug and step through the code it seems like the translated sring resources are never requested. Only the hard coded default values are returned.
In version 3.9 it worked with the same database (now updated with the upgrade script).

More tips are apreciated! :)

Regards Markus
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: February 21, 2018 at 3:58 PM Quote #201007
It seems that the if statement below always evaluates to false why the localized strings never are used. Is it a bug or do I need to change a setting anywhere to get the values of Common.Day, Common.Month and Common.Year instead?


            if (bool.TryParse(LocalizeLabels, out bool localizeLabels) && localizeLabels)
            {
                var locService = EngineContext.Current.Resolve<ILocalizationService>();
                dayLocale = locService.GetResource("Common.Day");
                monthLocale = locService.GetResource("Common.Month");
                yearLocale = locService.GetResource("Common.Year");
            }
            else
            {
                dayLocale = "Day";
                monthLocale = "Month";
                yearLocale = "Year";
            }


Regards Markus
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 08, 2018 at 2:59 PM Quote #214088
d99mj wrote:
It seems that the if statement below always evaluates to false why the localized strings never are used. Is it a bug or do I need to change a setting anywhere to get the values of Common.Day, Common.Month and Common.Year instead?


            if (bool.TryParse(LocalizeLabels, out bool localizeLabels) && localizeLabels)
            {
                var locService = EngineContext.Current.Resolve<ILocalizationService>();
                dayLocale = locService.GetResource("Common.Day");
                monthLocale = locService.GetResource("Common.Month");
                yearLocale = locService.GetResource("Common.Year");
            }
            else
            {
                dayLocale = "Day";
                monthLocale = "Month";
                yearLocale = "Year";
            }


Regards Markus


Hey Markus,

I came across the same issue, not sure if you resolved it yet; As you noticed LocalizeLabels only exists as a local var and is always NULL.

My fix is the following:

            try
            {
                var locService = EngineContext.Current.Resolve<ILocalizationService>();
                dayLocale = locService.GetResource("Common.Day");
                monthLocale = locService.GetResource("Common.Month");
                yearLocale = locService.GetResource("Common.Year");
            }
            catch
            {
                dayLocale = "Day";
                monthLocale = "Month";
                yearLocale = "Year";
            }
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.