Besides having the possibility to translate the plugin, you can also change the designer’s language dynamically.

To do this, it’s simple, you will need to configure the plugin locale, as well as an object containing the different languages.

Consider the following example :

var options = {
    locale: 'fr_FR',
    translations: {
       fr_FR: {
           "Layers": 'Calques',
       },
       de_DE: {
           "Layers": 'Lagen',
       }
    }
}

var instance = new AsukaDesigner('#myId'); // Create an instance of the main plugin class

In this example, only the Layers label will be translated into the French and German languages with French by default.

To switch to the German language, we just need to use an API method modifying the locale as follows :

instance.util.setLocale('de_DE');
Was this article helpful to you? Yes No

How can we help?