Skip to content

Localization

Fabian Wennink edited this page Oct 31, 2023 · 2 revisions

Strings

You have the option to customize the text strings used in the widget within your JavaScript code. This allows you to change the language displayed in the widgets to suit your needs. Below you'll find all text strings that can be modified, including their default values.

Text string Default value
messages.header Select the image displayed the <u>least</u> amount of times
messages.initialization.verify Verify that you are human.
messages.initialization.loading Loading challenge...
messages.correct Verification complete.
messages.incorrect.title Uh oh.
messages.incorrect.subtitle You've selected the wrong image.
messages.timeout.title Please wait.
messages.timeout.subtitle You made too many incorrect selections.

Configuration

The code below shows how you can modify these text strings. The text strings are part of the widget configuration, which must be passed to the init function during initialization.

If you do not wish to modify the strings, you may leave out the messages property of the object completely, as the default values will be used in that case.

IconCaptcha.init('.iconcaptcha-widget', {
    // ...
    messages: {
        header: 'Select the image displayed the <u>least</u> amount of times',
        initialization: {
            verify: 'Verify that you are human.',
            loading: 'Loading challenge...',
        },
        correct: 'Verification complete.',
        incorrect: {
            title: 'Uh oh.',
            subtitle: "You've selected the wrong image.",
        },
        timeout: {
            title: 'Please wait.',
            subtitle: 'You made too many incorrect selections.'
        }
    }
});