override useragent's language with data-isso-lang

This commit is contained in:
Martin Zimmermann 2013-11-17 11:27:48 +01:00
parent 2e9c21db15
commit aeb7c35d8f
3 changed files with 8 additions and 2 deletions

View File

@ -143,6 +143,11 @@ You can configure the client (the JS part) via `data-` attributes:
<script src="..." data-isso-css="false"></script>
```
* 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`.

View File

@ -3,6 +3,7 @@ define(function() {
var config = {
"css": true,
"lang": (navigator.language || navigator.userLanguage).split("-")[0],
"reply-to-self": false
};

View File

@ -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]) {