feat: introduce overridable l10nBaseUrl config value

v1.18.x
Julian Lam 5 years ago
parent 9846498df7
commit def16f9e97

@ -2,7 +2,7 @@
(function (factory) {
function loadClient(language, namespace) {
return Promise.resolve(jQuery.getJSON(config.relative_path + '/assets/language/' + language + '/' + namespace + '.json?' + config['cache-buster']));
return Promise.resolve(jQuery.getJSON(config.l10nBaseUrl + '/' + language + '/' + namespace + '.json?' + config['cache-buster']));
}
var warn = function () { console.warn.apply(console, arguments); };
if (typeof define === 'function' && define.amd) {

@ -19,7 +19,8 @@ apiController.loadConfig = async function (req) {
let config = {
relative_path: nconf.get('relative_path'),
upload_url: nconf.get('upload_url'),
requireBaseUrl: nconf.get('relative_path') + '/assets/src/modules',
requireBaseUrl: `${nconf.get('relative_path')}/assets/src/modules`,
l10nBaseUrl: `${nconf.get('relative_path')}/assets/language`,
siteTitle: validator.escape(String(meta.config.title || meta.config.browserTitle || 'NodeBB')),
browserTitle: validator.escape(String(meta.config.browserTitle || meta.config.title || 'NodeBB')),
titleLayout: (meta.config.titleLayout || '{pageTitle} | {browserTitle}').replace(/{/g, '{').replace(/}/g, '}'),

Loading…
Cancel
Save