From b23b6594adc7d928615d6c0feb8dd61a94541221 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 4 Mar 2021 11:26:01 -0500 Subject: [PATCH] jsxref shouldn't localize slugs (#3132) * jsxref shouldn't localize slugs * delete refs --- kumascript/macros/L10n-JavaScript.json | 20 -------------------- kumascript/macros/jsxref.ejs | 19 +++++++------------ 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/kumascript/macros/L10n-JavaScript.json b/kumascript/macros/L10n-JavaScript.json index edf5abb5948d..3c82e2511f68 100644 --- a/kumascript/macros/L10n-JavaScript.json +++ b/kumascript/macros/L10n-JavaScript.json @@ -1,24 +1,4 @@ { - "slug_reference": { - "en-US": "Reference", - "es": "Referencia", - "de": "Reference", - "fr": "Reference", - "ca": "Referencia", - "pl": "Referencje", - "ru": "Reference" - }, - - "slug_global_objects": { - "en-US": "Global_Objects", - "es": "Objetos_globales", - "de": "Global_Objects", - "fr": "Objets_globaux", - "ca": "Objectes_globals", - "pl": "Obiekty", - "ru": "Global_Objects" - }, - "stdlib": { "en-US": "Standard built-in objects", "fr": "Objets standards", diff --git a/kumascript/macros/jsxref.ejs b/kumascript/macros/jsxref.ejs index cd9bc2fbef2b..83b065e1ee01 100644 --- a/kumascript/macros/jsxref.ejs +++ b/kumascript/macros/jsxref.ejs @@ -14,29 +14,24 @@ // {{jsxref("Global_Objects/Date/getNumber", "Date.prototype.getNumber()")}} // -let jsl10n = JSON.parse(await template('L10n:JavaScript')); - -let l10n = { - refslug: mdn.getLocalString(jsl10n, 'slug_reference'), - slug: mdn.getLocalString(jsl10n, 'slug_global_objects'), -}; +const slug = 'Global_Objects'; let str = $1 || $0; -let URL = "/" + env.locale + "/docs/Web/JavaScript/" + l10n.refslug + '/'; +let URL = `/${env.locale}/docs/Web/JavaScript/Reference/`; let basePath = URL; let api = $0.replace('()', '').replace('.prototype.', '.'); let page = wiki.getPage(URL + $0); -let objectPage = wiki.getPage(URL + l10n.slug + '/' + $0); +let objectPage = wiki.getPage(URL + slug + '/' + $0); if ((api.indexOf("..") === -1) && (api.indexOf(".") !== -1)) { // Handle try...catch case - basePath += l10n.slug + '/'; - URL += l10n.slug + '/' + api.replace('.', '/'); + basePath += slug + '/'; + URL += slug + '/' + api.replace('.', '/'); } else if (!page.slug && objectPage.slug) { - basePath += l10n.slug + '/'; - URL += l10n.slug + '/' + $0; + basePath += slug + '/'; + URL += slug + '/' + $0; } else { URL += web.safeDecodeURIComponent($0); }