Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L10n #1341

Merged
merged 5 commits into from Jul 27, 2017
Merged

L10n #1341

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/core/l10n.js
Expand Up @@ -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:",
Expand Down Expand Up @@ -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:",
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/ui/save-html.js
Expand Up @@ -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();
Expand All @@ -114,7 +114,7 @@ const save = {
popupContent() {
self.toXHTMLSource();
},
title: "Save as XHTML5",
title: `${l10n[lang].save_as} XHTML5`,
url: this.htmlToDataURL(this.toXML()),
});

Expand All @@ -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(),
});
Expand All @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/ui/search-specref.js
Expand Up @@ -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",
"🔎"
Expand Down Expand Up @@ -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();
}

Expand Down