mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 11:28:25 +08:00
Merge branch 'master' into master
This commit is contained in:
@@ -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]`)
|
||||
(Default `[Talk]`)
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user