Last active
January 31, 2020 15:42
-
-
Save middlesister/f06a064a474bbf48eaa8 to your computer and use it in GitHub Desktop.
Accessible and translatable Genesis reponsive menu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have tested your code.
I have the following suggestions. I am not very good at coding, but would my best to explain.
'responsiveMenubuttonText' => _x( 'Menu', 'Responsive menu button text', 'textdomain'),
Also, someone may use __( ) instead of _x( ) for translating string.
That is
You should change it to something like ' + menuData.screenReaderNavHeading + ' and ' + menuData.responsiveMenubuttonText + '
which close the previous string, add variable and then open the next string.
That is to change line 5 to something like the following:
$("header .genesis-nav-menu, .nav-primary .genesis-nav-menu").addClass("responsive-menu").before('<h2 class="screen-reader-text" id="rian-main-nav">' + menuData.screenReaderNavHeading + '</h2><button class="responsive-menu-icon" aria-controls="menu-primary-navigation" aria-expanded="false">' + menuData.responsiveMenubuttonText + '</button>');
Thank you.