Problem/Motivation

Twig-Bug example

The Screenshot above shows a tour popup and the next button is not translated.

This is because the Next button text comes from core/vendor/jquery-joyride and there is no way to handle it with t() right now.

Remaining tasks

Patch needs to be written
Patch needs to be reviewed
Patch needs to be tested
Patch needs to be committed to Core.

User interface changes

None

API changes

Maybe we need to be able to parse js text with t()

Data model changes

Release notes snippet

Original report by [username]

Comments

Joachim Namyslo created an issue. See original summary.

joachim namyslo’s picture

Issue summary: View changes
joachim namyslo’s picture

Issue summary: View changes
joachim namyslo’s picture

Title: Tour module Next button untranslateable » Malformed HTML filter makes Next button of Tour module untranslateable
Related issues: +#3099772: Varbase Media
joachim namyslo’s picture

StatusFileSize
new78.76 KB

Here is a live example from Varbase update 8.7 to 8.8

div bug live example

joachim namyslo’s picture

Issue tags: +Novice
mradcliffe’s picture

I'm not sure where to start here, and though it was suggested to add the Novice tag I'm not sure what the actionable task is. Generally issues work best for novices when there is clear consensus on what to do.

I think at least adding the issue summary template and identify novice tasks for new contributors, then it might still be a Novice issue.

joachim namyslo’s picture

Hopefully, someone will take a look at that before Drupal 9 comes out. Maybe it's just a regex-pattern to change. I don't know where the routine lives. as I said in the updated Issue template. In my opinion, this is not a novice thing. But I am glad that someone noticed and broght it up again.

joachim namyslo’s picture

Issue summary: View changes
joachim namyslo’s picture

Issue summary: View changes
joachim namyslo’s picture

OK it seems this is plugged in by useing a jquery lib and next isn't psrsed trough (t) will Update this as soon as I find the Code Block again.

joachim namyslo’s picture

OK it seems this is plugged in by useing a jquery lib and next isn't psrsed trough (t) will Update this as soon as I find the Code Block again.

joachim namyslo’s picture

  },
    toggleTour: function toggleTour() {
      if (this.model.get('isActive')) {
        var $tour = this._getTour();
        this._removeIrrelevantTourItems($tour, this._getDocument());
        var that = this;
        var close = Drupal.t('Close');
        if ($tour.find('li').length) {
          $tour.joyride({
            autoStart: true,
            postRideCallback: function postRideCallback() {
              that.model.set('isActive', false);
            },

            template: {
              link: '<a href="#close" class="joyride-close-tip" aria-label="' + close + '">&times;</a>',
              button: '<a href="#" class="button button--primary joyride-next-tip"></a>'

Code in

lin 61 - 75 looks like
The file is tour.js and toures6.js so in js not t() is possible. Therefore the next in tour UI isn't translateable right now.

The text string is in core/assets/vendor/jquery-joyride/jquery.joyride-2.1.js

line 215

button_text : function (txt) {
        if (settings.nextButton) {
          txt = $.trim(txt) || 'Next';
          txt = methods.outerHTML($(settings.template.button).append(txt)[0]);
        } else {
          txt = '';
        }
        return txt;
      },

So how to get the next parsed trogh t()?

Edited the file and changed next to the german equivalent Weiter. just to see if the line above is the right one.

So If anyone able to provide a patch to tranlate the txt string although it comes from a js file that would help a lot.

joachim namyslo’s picture

Title: Malformed HTML filter makes Next button of Tour module untranslateable » Next button of Tour module untranslateable
Issue summary: View changes
Related issues: -#3075822: Thunder / Slick disallowed HTML, -#3075838: Configuration translation disallowed HTML, -#3099772: Varbase Media
sokru’s picture

Version: 8.8.x-dev » 8.9.x-dev
StatusFileSize
new1.04 KB

Could attached patch solve this issue?

baluertl’s picture

Status: Active » Needs review

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

bmagalhaes’s picture

StatusFileSize
new603 bytes

Hello,

Just use the patch attached

psf_’s picture

Status: Needs review » Needs work

The patch in #15 duplicate the string, and the patch in #18 is applied over an external library, I think is not the best practice.

joachim namyslo’s picture

Let's close this in favor of #2901517: Next Button Translation

joachim namyslo’s picture

Status: Needs work » Closed (duplicate)
joachim namyslo’s picture

Status: Closed (duplicate) » Active

Reopen This issue because it still exists in Drupal 9.1.5 So Maybe some one more tchnically versed, than me should check if core still uses joiride just like beforre or if there is a different approach for the tour functionality right now.

joachim namyslo’s picture

Status: Active » Needs review
anruether’s picture

Let's close this in favor of #2901517: Next Button Translation

But isn't it indeed a dup of that issue? We don't need two issues for the same thing. Did you test the patch in the other issue? If it fixes the problem, please give feedback there.

Version: 9.1.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new160 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

quietone’s picture

Component: transliteration system » tour.module
Status: Needs work » Postponed

This should be in the tour.module component.

This extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » Tour
Version: 11.x-dev » 1.0.x-dev
Component: tour.module » Code
Status: Postponed » Needs work
smustgrave’s picture

Status: Needs work » Closed (outdated)