From 69e4c5478d3df1b69de19ed064e42203188d6c0d Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 21 Dec 2017 23:26:34 -0700 Subject: [PATCH 1/3] fixes default lang select bug --- services/i18n.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/services/i18n.js b/services/i18n.js index cd1bacd93..14597e89b 100644 --- a/services/i18n.js +++ b/services/i18n.js @@ -32,6 +32,14 @@ let translations = fs.readdirSync(resolve()) // Create a list of all supported translations. const languages = Object.keys(translations); +// Move the default language to the front. +if (languages.includes(DEFAULT_LANG)) { + const from = languages.indexOf(DEFAULT_LANG); + languages.splice(from, 1); + languages.splice(0, 0, DEFAULT_LANG); +} +debug(`loaded language sets for ${languages}`); + let loadedPluginTranslations = false; const loadPluginTranslations = () => { if (loadedPluginTranslations) { @@ -80,8 +88,11 @@ const t = (language) => (key, ...replacements) => { */ const i18n = { request(req) { + debug(`possible languages given request '${accepts(req).languages()}'`); const lang = accepts(req).language(languages); + debug(`parsed request language as '${lang}'`); const language = lang ? lang : DEFAULT_LANG; + debug(`decided language as '${language}'`); return t(language); }, From 140bba23e0a65224f583696e2de04dfec9b21b24 Mon Sep 17 00:00:00 2001 From: Andrii Gakhov Date: Thu, 28 Dec 2017 13:04:37 +0100 Subject: [PATCH 2/3] Fix a variable name for redis client configuration The documentation incorrectly stated that the advanced Redis Client configuration could be set using `TALK_REDIS_CLIENT_CONFIG`, while, in fact, the correct variable is `TALK_REDIS_CLIENT_CONFIGURATION`, as it parsed in https://github.com/coralproject/talk/blob/master/config.js#L114 --- docs/_docs/02-02-advanced-configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/02-02-advanced-configuration.md b/docs/_docs/02-02-advanced-configuration.md index 47be44fcc..f72b6e04b 100644 --- a/docs/_docs/02-02-advanced-configuration.md +++ b/docs/_docs/02-02-advanced-configuration.md @@ -319,7 +319,7 @@ default to providing only a time based lockout. Refer to [reCAPTCHA](https://www.google.com/recaptcha/intro/index.html) for information on getting an account setup. -## TALK_REDIS_CLIENT_CONFIG +## TALK_REDIS_CLIENT_CONFIGURATION Configuration overrides for the redis client configuration in a JSON encoded string. Configuration is overridden as the second parameter to the redis client @@ -466,4 +466,4 @@ same as any other user in the system. (Default `FALSE`) The prefix for the subject of emails sent. An email with the specified subject of `Email Confirmation` would then be sent as `[Talk] Email Confirmation`. -(Default `[Talk]`) \ No newline at end of file +(Default `[Talk]`) From d7097ff729f89b4d0c2ff4e10c31e7f46a6d1bb7 Mon Sep 17 00:00:00 2001 From: "J. Heasly" Date: Wed, 3 Jan 2018 17:51:58 -0800 Subject: [PATCH 3/3] Up patch version to match tag. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c46a4caaa..568db2577 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "3.9.0", + "version": "3.9.1", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "private": true,