From 171d19baee18d91588dad6e8002b6fa456a751aa Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 18 Feb 2021 11:57:16 +0530 Subject: [PATCH] modify homeNotice API to allow translations without a circular dependency --- customize.dist/pages/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/customize.dist/pages/index.js b/customize.dist/pages/index.js index c03c0c283..f15d1819b 100644 --- a/customize.dist/pages/index.js +++ b/customize.dist/pages/index.js @@ -121,8 +121,14 @@ define([ ]; var notice; +/* Admins can specify a notice to display in application_config.js via the `homeNotice` attribute. + If the text is the key for the translation system then then the most appropriate translated text + will be displayed. Otherwise, the direct text will be included as HTML. +*/ if (AppConfig.homeNotice) { - notice = h('div.alert.alert-info', Pages.setHTML(h('span'), AppConfig.homeNotice)); + notice = h('div.alert.alert-info', Pages.setHTML(h('span'), [ + Msg[AppConfig.homeNotice] || AppConfig.homeNotice + ])); } return [