Translations introduction

To localize the menu, include the desired translation .js file and use the language configuration option.

        "DOMContentLoaded", () => {
            new Mmenu( "#my-menu", {
                // options
            }, {
                language: "nl"

Add a new translation

The best approach to add a translation, is to create a new translation .ts file for the core and each add-on that contains a translatable text.

First, copy one of the already available translation .ts files and rename it using the naming convention:


Where [language] refers to the translation language, can be any word but preferred is a two digits language code in lowercase.

For example, a new translation in French would result in the following files:


Next, create a custom build and run $ gulp in the command-line.

If you're using Git, you might want to create a pull request for these changes.

Override translation

If you only want to override a part of an already available translation (or if you think the above method to create a new translation is to difficult), copy the contents of an already available translation .js file and paste it in a new file or as inline script.

        'Search': 'Doorzoek het menu'
    }, 'nl' );

To get a list of all translatable texts, invoke the $.mmenu.i18n function.

    console.log( Mmenu.i18n() );