fix: #7289 timeago shorthand toggle fails on non-existant language

- Exposing timeagoCodes to frontend
- Timeago language and shorthand toggling will fall back to 'en'
  if the requested language does not exist
This commit is contained in:
Julian Lam
2019-01-21 16:34:33 -05:00
parent 059a4be204
commit cee47f78b2
2 changed files with 9 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ var categories = require('../categories');
var privileges = require('../privileges');
var plugins = require('../plugins');
var translator = require('../translator');
var languages = require('../languages');
var apiController = module.exports;
@@ -62,6 +63,7 @@ apiController.loadConfig = function (req, callback) {
config.bootswatchSkin = meta.config.bootswatchSkin || '';
config.enablePostHistory = (meta.config.enablePostHistory || 1) === 1;
config.notificationAlertTimeout = meta.config.notificationAlertTimeout || 5000;
config.timeagoCodes = languages.timeagoCodes;
if (config.useOutgoingLinksPage) {
config.outgoingLinksWhitelist = meta.config['outgoingLinks:whitelist'];