Proposal to make the text "Select a page" in mobilemenu.js translatable by containing it Drupal.t(). Unfortunately I am not able to make patches and I cannot upload de .js file. But this works!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jaapx created an issue. See original summary.

dipakmdhrm’s picture

@Jaapx: Thanks for reporting this.

We actually don't need to change the content of mobileMenu.js.

We can add the Drupal.t() in custom.js where we call the mobileMenu() function.

So we need to change:

   jQuery('#main-menu > nav > ul').mobileMenu({
    prependTo:'.mobilenavi'
  });

to:

 jQuery('#main-menu > nav > ul').mobileMenu({
    prependTo:'.mobilenavi',
    groupPageText: Drupal.t('Main'),
    topOptionText: Drupal.t('Select a page')
  });

in custom.js.

I'll make the changes and push it do dev branch.

dipakmdhrm’s picture

  • dipakmdhrm committed 52585fa on 8.x-1.x
    Issue #2760087 by dipakmdhrm, Jaapx: Make "Select a page" translatable
    
dipakmdhrm’s picture

Status: Active » Needs review

@Jaapx: Needs your review.

dipakmdhrm’s picture

Status: Needs review » Reviewed & tested by the community

This is working as expected now.

dipakmdhrm’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

edwinDrupal’s picture

I got an error: Uncaught ReferenceError: Drupal is not defined,
when I visited the front page as a guest. And the slideshow box was hidden because of this error.

I removed the Drupal.t() function, and the slider box was show when visiting the page as a guest user.

edwinDrupal’s picture

include - core/drupal below slider-js in nexus.libraries,yml will solve the problem.
http://www.webmaster-forums.net/html-css-and-javascript/drupal-8-tip-deb...