Translate Sierra widget (multilingual sites)

Created on 22 July 2020, almost 5 years ago
Updated 27 March 2025, about 1 month ago

Adding a patch to improve translation handling for recurrence patterns in Spanish. See details in the comment below.

📌 Task
Status

Needs work

Version

3.0

Component

Code

Created by

🇮🇱Israel roi

Live updates comments and jobs are added and updated live.
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.

  • Hi.
    I’m using Drupal 11.1.4 with PHP 8.3, along with date_recur 3.9.3 and date_recur_modular 3.3.0, using the Sierra widget. I encountered an issue where recurrence pattern variables do not get properly translated.

    For example:

    t('Weekly on @weekday', $tArgs);
    

    Results in: "Semanalmente el Wednesday" instead of "Semanalmente el miércoles".

    Proposed Solution:
    I implemented a fix that ensures translations respect the current Drupal language. This approach allows recurrence pattern variables to be correctly translated. The patch affects DateRecurModularSierraWidget and DateRecurModularSierraModalForm.

    For the modal form, I used hook_form_alter(), but the logic remains the same. My current implementation only checks for Spanish and a specific timezone case, but it can be improved if integrated into the module directly.

    Looking forward to feedback and improvements from the community. Thanks!

  • Hello, I didn't express myself well in my comment #4.
    I modified and applied this patch to make the site language translations work for me.
    It works for me in Spanish.
    It should work for other languages.

Production build 0.71.5 2024