nodebb-plugin-spam-be-gone icon indicating copy to clipboard operation
nodebb-plugin-spam-be-gone copied to clipboard

Message internationalization

Open Aure77 opened this issue 11 years ago • 5 comments

Support different language for users messages (like "Wrong Captcha" toast). I can help you for French translation if you want.

Aure77 avatar Jul 23 '14 19:07 Aure77

Well, currently the Captcha language settings will attempt to use the NodeBB language settings. see this line here, however, if the language is not natively supported by the Google Captcha, (see list here: https://developers.google.com/recaptcha/docs/customization#i18n) it will default back to English.

But now I think about it, I can add advanced language settings to customize the messages.

akhoury avatar Jul 23 '14 19:07 akhoury

from that recaptcha google link above:

<script type="text/javascript">
        var RecaptchaOptions = {
                custom_translations : {
                        instructions_visual : "Scrivi le due parole:",
                        instructions_audio : "Trascrivi ci\u00f2 che senti:",
                        play_again : "Riascolta la traccia audio",
                        cant_hear_this : "Scarica la traccia in formato MP3",
                        visual_challenge : "Modalit\u00e0 visiva",
                        audio_challenge : "Modalit\u00e0 auditiva",
                        refresh_btn : "Chiedi due nuove parole",
                        help_btn : "Aiuto",
                        incorrect_try_again : "Scorretto. Riprova.",
                },
                lang : 'it', // Unavailable while writing this code (just for audio challenge)
                theme : 'red' // Make sure there is no trailing ',' at the end of the RecaptchaOptions dictionary
        };
</script>

so yea, it's possible

akhoury avatar Jul 23 '14 19:07 akhoury

till then, just set your NodeBB language to fr and you should get a the french captcha version, since it is supported.

akhoury avatar Jul 23 '14 19:07 akhoury

reCaptcha language works fine. I was talking about error message on register if captcha is wrong. Message is hardcoded https://github.com/akhoury/nodebb-plugin-spam-be-gone/blob/master/library.js#L194 and displayed to user...

Aure77 avatar Jul 23 '14 20:07 Aure77

touche. I'll try and fix that tonight.

akhoury avatar Jul 23 '14 21:07 akhoury