Add option to set the calendar language to the current language

Created on 30 January 2024, 5 months ago
Updated 31 January 2024, 5 months ago

Could be nice to have the calendar in the current drupal site language without the need to manually change the language select list at the bottom.
If needed, we can add an option in the config "Default to the current site language" which will lead to this behavior.
I have tried without success to set the language with JS with the following code

(function ($, Drupal, once) {
  Drupal.behaviors.calendar_language = {
    attach: function (context, settings) {
      once('set-language', '#locale-selector-0', context).forEach(function (element) {
        var langCode = drupalSettings.path.currentLanguage;
        $('#locale-selector-0').val(langCode).change();
      });
    }
  };
})(jQuery, Drupal, once);
✨ Feature request
Status

Closed: works as designed

Version

5.1

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @DuneBL
  • Status changed to Closed: works as designed 5 months ago
  • πŸ‡§πŸ‡ͺBelgium DuneBL

    Sorry, this option already exists. In the language list you can select "Language of the current page" which is very nice

Production build 0.69.0 2024