diff --git a/README.md b/README.md index 713090e..48c34aa 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,11 @@ You can configure the client (the JS part) via `data-` attributes: ``` +* data-isso-lang + + Override useragent's preferred language. Currently available: german (de), + english (en) and french (fr). + * data-isso-reply-to-self Set to `true` when spam guard is configured with `reply-to-self = true`. diff --git a/isso/js/app/config.js b/isso/js/app/config.js index d946857..1456c40 100644 --- a/isso/js/app/config.js +++ b/isso/js/app/config.js @@ -3,6 +3,7 @@ define(function() { var config = { "css": true, + "lang": (navigator.language || navigator.userLanguage).split("-")[0], "reply-to-self": false }; diff --git a/isso/js/app/i18n.js b/isso/js/app/i18n.js index 83ec30d..17090bc 100644 --- a/isso/js/app/i18n.js +++ b/isso/js/app/i18n.js @@ -11,8 +11,8 @@ define(["app/i18n/de", "app/i18n/en"], function(de, en) { plurals["de"] = plurals["en"]; - // the user's language. you can replace this with your own code - var lang = (navigator.language || navigator.userLanguage).split("-")[0]; + // useragent's prefered language (or manually overridden) + var lang = config.lang; // fall back to English if (!plurals[lang]) {