From 88fe99361be4f5ff3e646901f054fad749d7caa1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sat, 26 Dec 2020 08:29:49 +0100 Subject: [PATCH] Simplify translation template `this.po` is not being used anywhere, so drop the whole `!loaded` code path. There is no defer mechanism, so `po.js` *must* be loaded after cockpit.js. Let's trigger a crash instead of silently dropping translations, to make such a bug obvious in manual and automatic tests. --- po/po.empty.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/po/po.empty.js b/po/po.empty.js index b27dad9..7c2d480 100644 --- a/po/po.empty.js +++ b/po/po.empty.js @@ -1,14 +1,2 @@ -(function (root, data) { - var loaded, module; - - /* Load into Cockpit locale */ - if (typeof cockpit === 'object') { - cockpit.locale(data) - loaded = true; - } - - if (!loaded) - root.po = data; - -/* The syntax of this line is important by po2json */ -}(this, {"":{"language":"en"}})); +/* The syntax of this line is important for po2json */ +cockpit.locale({"":{"language":"en"}});