Skip to content

Commit

Permalink
Fix language detection when only a sub-locale is provided
Browse files Browse the repository at this point in the history
Fixes #67
  • Loading branch information
lovasoa committed May 5, 2020
1 parent 710c13a commit 2aa00ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class Template {
}
parameters(parsedUrl, request) {
const accept_languages = parsedUrl.query.lang || request.headers['accept-language'];
const language = accept_language_parser.pick(languages, accept_languages) || 'en';
const opts = { loose: true };
const language = accept_language_parser.pick(languages, accept_languages, opts) || 'en';
const translations = TRANSLATIONS[language] || {};
const configuration = client_config || {};
const prefix = request.url.split("/boards/")[0].substr(1);
Expand Down

0 comments on commit 2aa00ce

Please sign in to comment.