From ae9f2bf654cd8c03314e77d94798c694c737172e Mon Sep 17 00:00:00 2001 From: dhvenema Date: Thu, 27 Jul 2017 21:30:29 +0200 Subject: [PATCH] add Dutch translations to l10n and ui --- src/core/l10n.js | 7 ++++++- src/ui/save-html.js | 8 ++++---- src/ui/search-specref.js | 5 +++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/core/l10n.js b/src/core/l10n.js index f18c021454..ab2c624d5a 100644 --- a/src/core/l10n.js +++ b/src/core/l10n.js @@ -34,7 +34,9 @@ const base = { open_parens: "(", participate: "Participate", references: "References", + save_as: "Save as", save_snapshot: "Save Snapshot", + search_specref: "Search Specref", sotd: "Status of This Document", table_of_fig: "Table of Figures", this_version: "This version:", @@ -109,7 +111,9 @@ const nl = { open_bugs: "open meldingen", participate: "Doe mee", references: "Referenties", + save_as: "Bewaar als", save_snapshot: "Bewaar Snapshot", + search_specref: "Doorzoek Specref", sotd: "Status van dit document", table_of_fig: "Lijst met figuren", this_version: "Deze versie:", @@ -160,7 +164,8 @@ export const l10n = { l10n["zh-hans"] = l10n.zh; l10n["zh-cn"] = l10n.zh; -export const lang = document.documentElement.lang in l10n ? document.documentElement.lang : "en"; +export const lang = + document.documentElement.lang in l10n ? document.documentElement.lang : "en"; export function run(config) { config.l10n = l10n[lang] || l10n.en; diff --git a/src/ui/save-html.js b/src/ui/save-html.js index c48b02677b..e07e0790b6 100644 --- a/src/ui/save-html.js +++ b/src/ui/save-html.js @@ -99,7 +99,7 @@ const save = { // HTML addButton({ id: "respec-save-as-html", - title: "Save as HTML", + title: `${l10n[lang].save_as} HTML`, url: this.htmlToDataURL(this.toString()), popupContent() { self.toHTMLSource(); @@ -114,7 +114,7 @@ const save = { popupContent() { self.toXHTMLSource(); }, - title: "Save as XHTML5", + title: `${l10n[lang].save_as} XHTML5`, url: this.htmlToDataURL(this.toXML()), }); @@ -125,7 +125,7 @@ const save = { popupContent() { window.open(self.makeEPubHref(), "_blank"); }, - title: "Save as EPUB 3", + title: `${l10n[lang].save_as} EPUB 3`, type: "application/epub+zip", url: this.makeEPubHref(), }); @@ -136,7 +136,7 @@ const save = { ui.closeModal(); }); } - ui.freshModal("Save Snapshot", $div, button); + ui.freshModal(l10n[lang].save_snapshot, $div, button); }, htmlToDataURL: function(data) { data = encodeURIComponent(data); diff --git a/src/ui/search-specref.js b/src/ui/search-specref.js index b9b3b7c09e..cf8584d3a7 100644 --- a/src/ui/search-specref.js +++ b/src/ui/search-specref.js @@ -2,9 +2,10 @@ // Search Specref database import { ui } from "core/ui"; import { wireReference } from "core/biblio"; +import { l10n, lang } from "core/l10n"; const button = ui.addCommand( - "Search Specref", + l10n[lang].search_specref, "ui/search-specref", "Ctrl+Shift+Alt+space", "🔎" @@ -116,7 +117,7 @@ form.addEventListener("submit", async ev => { function show() { render(); - ui.freshModal("Search Specref", form, button); + ui.freshModal(l10n[lang].search_specref, form, button); form.querySelector("input[type=search]").focus(); }