Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can set up the different default languages for your editable elements (instances) on the same page using the init() WProofreader initialization in a bundle There is an option to start WProofreader in different text fields with different predefined settings, like a language. It can be archived with the setLang method and syncOptions parameter.To do so, please follow the next steps:

1. Initialize WProofreader using the init() methodwhen if you clearly know in which control field you want to initialize WProofreader which provides additional management options.

2. Pass Specify the appropriate language shortcode for in the setLang in WEBSPELLCHECKER.init, for .For example, using it in thea combination with getInstances()method.

Code Block
languagejs
themeEmacs
WEBSPELLCHECKER.getInstances()[0].setLang('NEW_LANGUAGE_CODE')

3. Disable Also, it's recommended to disable synchronizing of ignore options and languages between all the created WProofreader instances. It's enabled by default. To disable it using syncOptionsin WEBSPELLCHECKER_CONFIG as shown below. Please note that this option also handles synchronization of the spell check ignore options.

Code Block
languagejs
themeEmacs
syncOptions: false,

4. If needed, disable storing of the user-selected language between browser sessions using disableOptionsStorage in WEBSPELLCHECKER_CONFIG.

If it's not done, the user-selected language will be saved in the browser local storage until it's cleared and the predefined options will be of no effect.

Code Block
languagejs
themeEmacs
disableOptionsStorage: [lang],