Magento2: Frontend: Datepicker/calendar control does not use the store locale

Created on 26 Aug 2016  路  19Comments  路  Source: magento/magento2

the frontend datepicker control (for example for the DOB field) is not localized: month names, day names and week start date are all using en_US.

Preconditions

  1. Magento 2.1.0 CE
  2. a non-en_US language pack is installed, which contains the translated month and weekday names, assuming de_DE for this issue
  3. frontend store is set to use this language/locale

    Steps to reproduce

  4. Admin > Settings > Configuration > Customer > Customer Configuration > "Show Date of Birth: Require"

  5. Admin > Settings > Configuration > General > Locale Options > "First Day of Week: Monday"
  6. clear cache / rebuild static assets if needed
  7. in the frontend, edit your account and use the datepicker of the DoB control

    Expected result

  8. the month names in the dropdown are translated

  9. the weekday names are translated
  10. the week starts with monday

    Actual result

  11. the month names are in english

  12. the weekday names are in english
  13. the week starts with sunday
Translation Fixed in 2.2.x Fixed in 2.3.x Clear Description Format is valid Ready for Work bug report

Most helpful comment

@lfritsche @robinkanters Seem's like adding block Magento\Framework\View\Element\Html\Calendar to the layout of required page resolves this problem (Magento 2.1.2 CE)

So I've added app/design/frontend/<Vendor>/<theme>/Magento_Customer/layout/customer_account_edit.xml with next content:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml" before="-"/>
        </referenceContainer>
    </body>
</page>

All 19 comments

Thanks for reporting, intrnal ticket MAGETWO-57733

@sevos1984
is there any update about this issue?
Our customers are not happy with the unknown date-formatting and I would need a solution quiet soon.
Thank you!

@sevos1984 any progress? it's been almost half a year now

@lfritsche @robinkanters Seem's like adding block Magento\Framework\View\Element\Html\Calendar to the layout of required page resolves this problem (Magento 2.1.2 CE)

So I've added app/design/frontend/<Vendor>/<theme>/Magento_Customer/layout/customer_account_edit.xml with next content:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml" before="-"/>
        </referenceContainer>
    </body>
</page>

Working on this ticket.

Internal ticket to track issue progress: MAGETWO-80096

@heldchen, thank you for your report.
We've created internal ticket(s) MAGETWO-57733 to track progress on the issue.

Hi @heldchen the issue has been fixed in https://github.com/magento/magento2/pull/11067 by @joachimVT . The fix will be available in 2.2.1

This issue still exists in Magento 2.2.1 . I have checked Today.

magento2-1-1

@okorshenko please re-open this issue. I can confirm this issue still exists on 2.2.1.

Hi @heldchen. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1353 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

  • 299109f1265fa15eeb3067e22c2638ff5907205e
  • 57318bf03bf6fe7f84b2956ffb5ecc1332bf41b3
  • 41cd961a217d30c4b7b051a775902c4fb40b84ea
  • 076b90398852478d93d1444f936ac483b4640a82
  • 435a6c200cd548b8765e5bc73b0458039a58645d
  • 5d174b873f8ba369d6504fb9d7ef30296816e2b1
  • a47b10dce854a2d21ead6b362b86ca3ddf595386
  • ab48cb176830ddab69fd1617cae96d76094ab167
  • 46be4c7ea59f6cfb9884f2bc5875245b1960edc6
  • eafc6f0a473547542c3ef80352dcd2be7128da87
  • 63b9e909f1173a51374d4cdfc68249baa66f0007
  • 2edfe9a30bb64f0a7e102bb335a89658b627bfad
  • ef5ddffb43a735627d09535b62fac2a41804a96a
  • 4ada797ece84c2f5eb55499e8bc3f75e0c7ef245
  • c5d9a019b0d51a51b452fd99b527e3b894874be2
  • 72e9e0732b98ea5b8f47bddc781dc47c688c3c58
  • 215180de0a3f6c4a16e02205732bfe8670293ad2
  • 685d50625b68dbb960988a6bfbbfc14455a6cb9e

The fix will be available with the upcoming 2.3.0 release.

As far as I can see this is the only relevant commit; https://github.com/magento/magento2/commit/72e9e0732b98ea5b8f47bddc781dc47c688c3c58

And that is already in (at least) 2.2.3. But it still does not work.

I can confirm that it still does not work in 2.2.3. Should we reopen the issue?

Calendar translation is not working for me yet.. I started with 2.1.7 and updates every releases now i have upgraded it to 2.2.3 but still issues is same.( almost an year) Calendar is not translated in any other locale other than English. Is there any chance it will fix anytime soon in future ..

@magento-engcom-team ?

@okorshenko I can confirm that it still does not work in 2.2.3. Should we reopen the issue?

@magento-engcom-team any update? any quick solution?

Not fixed in 2.2.6.

Waiting for the fix in the core, we made a module that temporarily fix this bug.

Was this page helpful?
0 / 5 - 0 ratings