Added i18n to the options page (bug #1) and fixed bugs with dialogs
diff --git a/_locales/ca/messages.json b/_locales/ca/messages.json
index e99d7b8..30e6160 100644
--- a/_locales/ca/messages.json
+++ b/_locales/ca/messages.json
@@ -61,6 +61,38 @@
"message": "Desar",
"description": "Save button in the settings app"
},
+ "options_addlanguage": {
+ "message": "Afegir idioma",
+ "description": "Title for the 'Add language' dialog"
+ },
+ "options_addlanguage_addbutton": {
+ "message": "Afegeix",
+ "description": "Add button in the footer of the languages list"
+ },
+ "options_language_label": {
+ "message": "Idioma:",
+ "description": "Label for the language selector in the 'Add language' dialog"
+ },
+ "options_credits" : {
+ "message": "Crèdits",
+ "description": "Title for the credits link and dialog"
+ },
+ "options_credits_homepage": {
+ "message": "pàgina web",
+ "description": "Homepage link for an item in the credits. NOTE: put in in lowercase letters"
+ },
+ "options_credits_by": {
+ "message": "",
+ "description": "Fragment of the author statement in an item of the credits. NOTE: put in in lowercase letters. EXAMPLE: '{{options_credits_by}} Adrià Vilanova Martínez'"
+ },
+ "options_ok": {
+ "message": "OK",
+ "description": "OK button in the dialogs"
+ },
+ "options_cancel": {
+ "message": "Cancel·lar",
+ "description": "Cancel button in the dialogs"
+ },
"notification_install_title": { "message": "Gràcies per instal·lar 'Traduïr Text Seleccionat'" },
"notification_install_message": { "message": "Fes clic en aquesta notificació per a configurar l'extensión." },
"notification_upgradedtostorage_title": { "message": "'Traduïr Text Seleccionat' s'ha actualizat a v0.6!" },
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index fd9fb40..8e36f91 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -15,7 +15,7 @@
"message": "Translate selection into...",
"description": "Title of the context menu that appears when a right click is done. Inside this parent menu there are the menus"
},
- "contextmenu_title2" : {
+ "contextmenu_title2": {
"message": "Translate selection into '$language$'",
"description": "Title of the context menu that appears when a right click is done and there's only one language available.",
"placeholders": {
@@ -61,6 +61,38 @@
"message": "Save",
"description": "Save button in the settings page"
},
+ "options_addlanguage": {
+ "message": "Add language",
+ "description": "Title for the 'Add language' dialog"
+ },
+ "options_addlanguage_addbutton": {
+ "message": "Add",
+ "description": "Add button in the footer of the languages list"
+ },
+ "options_language_label": {
+ "message": "Language:",
+ "description": "Label for the language selector in the 'Add language' dialog"
+ },
+ "options_credits": {
+ "message": "Credits",
+ "description": "Title for the credits link and dialog"
+ },
+ "options_credits_homepage": {
+ "message": "homepage",
+ "description": "Homepage link for an item in the credits. NOTE: put in in lowercase letters"
+ },
+ "options_credits_by": {
+ "message": "by",
+ "description": "Fragment of the author statement in an item of the credits. NOTE: put in in lowercase letters. EXAMPLE: '{{options_credits_by}} Adrià Vilanova Martínez'"
+ },
+ "options_ok": {
+ "message": "OK",
+ "description": "OK button in the dialogs"
+ },
+ "options_cancel": {
+ "message": "Cancel",
+ "description": "Cancel button in the dialogs"
+ },
"notification_install_title": { "message": "Thanks for installing 'Translate Selected Text'" },
"notification_install_message": { "message": "Click this notification to set it up." },
"notification_upgradedtostorage_title": { "message": "'Translate Selected Text' was updated to v0.6!" },
diff --git a/_locales/es/messages.json b/_locales/es/messages.json
index b643411..5bea4c9 100644
--- a/_locales/es/messages.json
+++ b/_locales/es/messages.json
@@ -61,6 +61,38 @@
"message": "Guardar",
"description": "Save button in the settings app"
},
+ "options_addlanguage": {
+ "message": "Añadir idioma",
+ "description": "Title for the 'Add language' dialog"
+ },
+ "options_addlanguage_addbutton": {
+ "message": "Añade",
+ "description": "Add button in the footer of the languages list"
+ },
+ "options_language_label": {
+ "message": "Idioma:",
+ "description": "Label for the language selector in the 'Add language' dialog"
+ },
+ "options_credits": {
+ "message": "Créditos",
+ "description": "Title for the credits link and dialog"
+ },
+ "options_credits_homepage": {
+ "message": "página web",
+ "description": "Homepage link for an item in the credits. NOTE: put in in lowercase letters"
+ },
+ "options_credits_by": {
+ "message": "",
+ "description": "Fragment of the author statement in an item of the credits. NOTE: put in in lowercase letters. EXAMPLE: '{{options_credits_by}} Adrià Vilanova Martínez'"
+ },
+ "options_ok": {
+ "message": "OK",
+ "description": "OK button in the dialogs"
+ },
+ "options_cancel": {
+ "message": "Cancelar",
+ "description": "Cancel button in the dialogs"
+ },
"notification_install_title": { "message": "Gracias por instalar 'Traducir Texto Seleccionado'" },
"notification_install_message": { "message": "Haz clic en esta notificación para configurar la extensión." },
"notification_upgradedtostorage_title": { "message": "'Traducir Texto Seleccionado' se ha actualizado a v0.6!" },
diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json
index 7c8503b..b370213 100644
--- a/_locales/ru/messages.json
+++ b/_locales/ru/messages.json
@@ -1,8 +1,3 @@
-/*
- * Translation contributed by Alexander Simkin
- *
- *
- */
{
"appName": {
"message": "Перевести выбранный текст",
diff --git a/js/options.js b/js/options.js
index e1ffdfb..5ba72c2 100644
--- a/js/options.js
+++ b/js/options.js
@@ -20,7 +20,15 @@
$("#varioustabs_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_1");
$("#uniquetab_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_2");
$("#panel_label").innerHTML = chrome.i18n.getMessage("options_tabsoption_3");
+ $("#languages_add").innerHTML = chrome.i18n.getMessage("options_addlanguage_addbutton");
$("#save").innerHTML = chrome.i18n.getMessage("options_savebutton");
+ $("#credits").innerHTML = chrome.i18n.getMessage("options_credits");
+ $("#credits_dialog h3").innerHTML = chrome.i18n.getMessage("options_credits");
+ $("#languages_add_ok").innerHTML = chrome.i18n.getMessage("options_ok");
+ $("#languages_add_cancel").innerHTML = chrome.i18n.getMessage("options_cancel");
+ $("#credits_ok").innerHTML = chrome.i18n.getMessage("options_ok");
+ $("#languages_add_dialog h3").innerHTML = chrome.i18n.getMessage("options_addlanguage");
+ $("#language_label").innerHTML = chrome.i18n.getMessage("options_language_label");
}
function print_list_modal() {
@@ -112,11 +120,11 @@
for (var item in json) {
printhtml += "<div>";
if (json[item].url) {
- printhtml += "<a href='"+json[item].url+"' class='homepage' target='_blank'>homepage</a>";
+ printhtml += "<a href='"+json[item].url+"' class='homepage' target='_blank'>"+chrome.i18n.getMessage("options_credits_homepage")+"</a>";
}
printhtml += "<h4>"+json[item].name+"</h4>";
if (json[item].author) {
- printhtml += "<p class='author'>by "+json[item].author;
+ printhtml += "<p class='author'>"+chrome.i18n.getMessage("options_credits_by")+" "+json[item].author;
}
if (json[item].license) {
printhtml += " – "+json[item].license+"</p>";
diff --git a/manifest.json b/manifest.json
index e30f611..dedf7c4 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_appBetaName__",
"description": "__MSG_appDescription__",
- "version": "0.7",
+ "version": "0.7.1",
"permissions": [
"contextMenus",
"storage",
diff --git a/options.html b/options.html
index 9fa0223..2f0a37a 100644
--- a/options.html
+++ b/options.html
@@ -11,7 +11,7 @@
</head>
<body>
<div id="credits_container">
- <a href="#credits">Credits</a>
+ <a href="#credits" id="credits"></a>
</div>
<h1 id="welcome"></h1>
@@ -22,7 +22,7 @@
<ul id="languages"></ul>
</div>
<div id="languages_footer">
- <button id="languages_add">Add</button>
+ <button id="languages_add"></button>
</div>
<h2 id="otheroptionsheader"></h2>
@@ -36,22 +36,22 @@
<button id="save"></button>
<dialog id="languages_add_dialog">
- <h3>Add language</h3>
+ <h3></h3>
<div class="content_area">
- <label id="language_label" for="select_language">Language:</label>
+ <label id="language_label" for="select_language"></label>
<select id="select_language"></select>
</div>
<div class="action_buttons">
- <button id="languages_add_cancel">Cancel</button>
- <button id="languages_add_ok">OK</button>
+ <button id="languages_add_cancel"></button>
+ <button id="languages_add_ok"></button>
</div>
</dialog>
<dialog id="credits_dialog">
- <h3>Credits</h3>
+ <h3></h3>
<div class="content_area">
</div>
<div class="action_buttons">
- <button id="credits_ok">OK</button>
+ <button id="credits_ok"></button>
</div>
</dialog>
</body>