akhoury / nodebb-plugin-spam-be-gone

yup
MIT License
24 stars 25 forks source link

Message internationalization #11

Open Aure77 opened 10 years ago

Aure77 commented 10 years ago

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

akhoury commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

Aure77 commented 10 years ago

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...

akhoury commented 10 years ago

touche. I'll try and fix that tonight.