From f0fa2bf752a968c296ef249e038d46005045f3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Tue, 8 Feb 2022 17:49:05 +1100 Subject: [PATCH] refactor: move l10n strings to sotd template (#4013) --- profiles/w3c.js | 1 - src/w3c/l10n.js | 53 --------------------------------------- src/w3c/templates/sotd.js | 29 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 55 deletions(-) delete mode 100644 src/w3c/l10n.js diff --git a/profiles/w3c.js b/profiles/w3c.js index 353b690f3..1c7edbd1e 100644 --- a/profiles/w3c.js +++ b/profiles/w3c.js @@ -8,7 +8,6 @@ const modules = [ import("../src/w3c/defaults.js"), import("../src/core/style.js"), import("../src/w3c/style.js"), - import("../src/w3c/l10n.js"), import("../src/core/github.js"), import("../src/core/data-include.js"), import("../src/core/markdown.js"), diff --git a/src/w3c/l10n.js b/src/w3c/l10n.js deleted file mode 100644 index 8021259b5..000000000 --- a/src/w3c/l10n.js +++ /dev/null @@ -1,53 +0,0 @@ -// @ts-check -// Module w3c/l10n -// Looks at the lang attribute on the root element and uses it to manage the config.l10n object so -// that other parts of the system can localise their text -import { html } from "../core/import-maps.js"; -import { l10n } from "../core/l10n.js"; -export const name = "w3c/l10n"; -const additions = { - en: { - status_at_publication: html`This section describes the status of this - document at the time of its publication. A list of current W3C - publications and the latest revision of this technical report can be found - in the W3C technical reports index at - https://www.w3.org/TR/.`, - }, - ko: { - status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해 - 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판을 - https://www.w3.org/TR/ 의 - W3C technical reports index 에서 - 열람할 수 있습니다.`, - }, - zh: { - status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列 - 表和最新版本可通过W3C技术报告索引访问。`, - }, - ja: { - status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 - W3C technical reports index - (https://www.w3.org/TR/)`, - }, - es: { - status_at_publication: html`Esta sección describe el estado del presente - documento al momento de su publicación. Una lista de las publicaciones - actuales del W3C y la última revisión del presente informe técnico puede - hallarse en http://www.w3.org/TR/ - el índice de informes técnicos del - W3C.`, - }, - de: { - status_at_publication: html`Dieser Abschnitt beschreibt den Status des - Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen - Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann - im W3C technical reports index unter - https://www.w3.org/TR/ abgerufen werden.`, - }, -}; - -Object.keys(additions).forEach(key => { - if (!l10n[key]) l10n[key] = {}; - Object.assign(l10n[key], additions[key]); -}); diff --git a/src/w3c/templates/sotd.js b/src/w3c/templates/sotd.js index d715310d3..76353004a 100644 --- a/src/w3c/templates/sotd.js +++ b/src/w3c/templates/sotd.js @@ -5,24 +5,51 @@ import { status2track } from "../headers.js"; const localizationStrings = { en: { sotd: "Status of This Document", + status_at_publication: html`This section describes the status of this + document at the time of its publication. A list of current W3C + publications and the latest revision of this technical report can be found + in the W3C technical reports index at + https://www.w3.org/TR/.`, }, ko: { sotd: "현재 문서의 상태", + status_at_publication: html`이 부분은 현재 문서의 발행 당시 상태에 대해 + 기술합니다. W3C 발행 문서의 최신 목록 및 테크니컬 리포트 최신판을 + https://www.w3.org/TR/ 의 + W3C technical reports index 에서 + 열람할 수 있습니다.`, }, zh: { sotd: "关于本文档", + status_at_publication: html`本章节描述了本文档的发布状态。W3C的文档列 + 表和最新版本可通过W3C技术报告索引访问。`, }, ja: { sotd: "この文書の位置付け", + status_at_publication: html`この節には、公開時点でのこの文書の位置づけが記されている。現時点でのW3Cの発行文書とこのテクニカルレポートの最新版は、下記から参照できる。 + W3C technical reports index + (https://www.w3.org/TR/)`, }, nl: { sotd: "Status van dit document", }, es: { sotd: "Estado de este Document", + status_at_publication: html`Esta sección describe el estado del presente + documento al momento de su publicación. Una lista de las publicaciones + actuales del W3C y la última revisión del presente informe técnico puede + hallarse en http://www.w3.org/TR/ + el índice de informes técnicos del + W3C.`, }, de: { sotd: "Status dieses Dokuments", + status_at_publication: html`Dieser Abschnitt beschreibt den Status des + Dokuments zum Zeitpunkt der Publikation. Eine Liste der aktuellen + Publikatinen des W3C und die aktuellste Fassung dieser Spezifikation kann + im W3C technical reports index unter + https://www.w3.org/TR/ abgerufen werden.`, }, }; @@ -45,7 +72,7 @@ export default (conf, opts) => { : conf.isNoTrack ? renderIsNoTrack(conf, opts) : html` -

${conf.l10n.status_at_publication}

+

${l10n.status_at_publication}

${conf.isMemberSubmission ? noteForSubmission(conf, opts) : html`