Date pattern configuration broken when Language core modules used

Created on 20 July 2017, about 7 years ago
Updated 11 February 2023, over 1 year ago

Problem/Motivation

I realized at a very basic German production site that it was not possible to modify the date patterns via web frontend. At this site only German is installed. Ony markdown and tayonomy_menu are installed. Bartik theme is used. I tested this on a clean new site.

<!--break-->

In the following I abbreviate "admin/config/regional/date-time" with "DATETIME".

To test whether this actually could be a Drupal core bug I did the following:

  1. Clean install of Drupal version 8.3.5 with PHP 5.6.30 with empty MYSQL 5.6.33 database.
  2. Left the language-related core modules inactive.
  3. Went to the DATETIME page.
  4. Modified all the default date patterns over the web frontend from m/d/Y into d/m/Y.
  5. Worked flawless. DATETIME page showed the modified date patterns.
  6. Added a short dummy article. The posting date also showed the modified date pattern. Perfect.
  7. Now activated language and translation modules.
  8. Installed German from the web frontend.
  9. Switched to German as default language.
  10. Again went to DATETIME.
  11. The listed default date patterns were switched back to m/d/Y but the names of the days were German.
  12. Again tried to modify the date patterns over DATETIME/formats/manage/long, DATETIME/formats/manage/medium and DATETIME/formats/manage/short.
  13. AJAX immediately showed the display of the modified patterns at the right of the input box, see See here.
  14. But the modified patterns did no longer show up on the DATETIME page, see see here.
  15. Did cache rebuild. No effect.
  16. It was no longer possible to influence the date pattern over the web frontend.

It is very counter-intuitive to have the date-time frontend which does nothing any more. Therefore one might guess that this is a bug.

Note: The meaning of the date 07/10/2017 depends on the language:

  • English: July 10, 2017
  • German: Oct 10, 2017

So it is very confusing for readers if an Englisch date format is applied to a German text.

Proposed resolution

If it is a bug, a patch would be fine.

Workarounds without patch:

  1. 1. Modifying twig files which obviously means sub-theming, see drupal.stackexchange.com I am not shure whether this works on non-English sites
  2. 2. Leaving the Language module inactive. Default date patterns remain editable over the frontend. But to translate e.g. the "submitted by" of posting dates one has to modify node.html.twig which again means subtheming. This worked.
  3. Edit Oct 10, 2017: The best workaround for non-English monolingual sites known to me and tested by me is: Directly install the target language! Never install English or you may be lost! This can be done with the language selection web interface during web install after having loaded the Dupal code. I was not able to do this with drush but drush is dead as an installation tool for Drupal 8.4 anyway.
🐛 Bug report
Status

Closed: outdated

Version

10.1

Component
Language system 

Last updated 1 day ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇩🇪Germany BeginnersMind

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone New Zealand

    I tested this on Drupal 10.1.x, standard install. I followed the steps in the Issue Summary, although I used Italian instead of German. At step 11, the date formats were not switched back to m/d/y. I modified the medium date pattern and it was correctly shown on the content that I had created in step 6. I then set the site default language to English and the date time format were not changed, that is they were still d/m/y. Assuming I have followed the step correctly, this appears to have been fixed.

    Therefore, I am closing this as outdated. Reopen and add a comment if there is still a problem.

Production build 0.71.5 2024