[chrome-gnome-shell] i18n: added "About translation" dialog
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chrome-gnome-shell] i18n: added "About translation" dialog
- Date: Sat, 5 Mar 2016 08:09:49 +0000 (UTC)
commit c161d2d65a3fb739201719ba698681ad58319136
Author: Yuri Konotopov <ykonotopov gmail com>
Date: Sat Mar 5 11:07:57 2016 +0300
i18n: added "About translation" dialog
extension/_locales/en/messages.json | 10 ++++++
extension/_locales/ru/messages.json | 10 ++++++
extension/css/options.css | 4 ++
extension/options.html | 61 +++++++++++++++++++---------------
extension/options.js | 22 ++++++++++++
5 files changed, 80 insertions(+), 27 deletions(-)
---
diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json
index 01cab39..e3689dc 100644
--- a/extension/_locales/en/messages.json
+++ b/extension/_locales/en/messages.json
@@ -47,6 +47,9 @@
}
}
},
+ "options_link": {
+ "message": "Options"
+ },
"options_saved": {
"message": "Options saved."
},
@@ -66,6 +69,13 @@
"message": "Next check"
},
+ "translation_credits_title": {
+ "message": "About translation"
+ },
+ "translation_credits": {
+ "message": ""
+ },
+
"hours": {
"message": "hours"
},
diff --git a/extension/_locales/ru/messages.json b/extension/_locales/ru/messages.json
index 860e666..b13a46b 100644
--- a/extension/_locales/ru/messages.json
+++ b/extension/_locales/ru/messages.json
@@ -47,6 +47,9 @@
}
}
},
+ "options_link": {
+ "message": "Настройки"
+ },
"options_saved": {
"message": "Настройки сохранены."
},
@@ -66,6 +69,13 @@
"message": "Следующая проверка"
},
+ "translation_credits_title": {
+ "message": "О переводе"
+ },
+ "translation_credits": {
+ "message": ""
+ },
+
"hours": {
"message": "часов"
},
diff --git a/extension/css/options.css b/extension/css/options.css
index 160a18f..e2250e2 100644
--- a/extension/css/options.css
+++ b/extension/css/options.css
@@ -3,6 +3,10 @@ body {
min-width: 500px;
}
+#translation_credits {
+ display: none;
+}
+
#update_check_period { width: 5em; }
#status {
display: none;
diff --git a/extension/options.html b/extension/options.html
index c41b2e5..21cc735 100644
--- a/extension/options.html
+++ b/extension/options.html
@@ -8,37 +8,44 @@
<script type="text/javascript" src="include/constants.js"></script>
</head>
<body>
- <div id="status" data-i18n="options_saved"></div>
+ <a id='switch_tab' href='#' data-i18n='translation_credits_title' style='float: right;'></a>
+ <div id="options">
+ <div id="status" data-i18n="options_saved"></div>
- <fieldset>
- <dl>
- <dt><span data-i18n="options_update_check"></span>:</dt>
- <dd>
- <label for='update_check_yes' data-i18n="yes"></label> <input
type='radio' id='update_check_yes' name='update_check' />
- <label for='update_check_no' data-i18n="no"></label> <input
type='radio' id='update_check_no' name='update_check' />
+ <fieldset>
+ <dl>
+ <dt><span data-i18n="options_update_check"></span>:</dt>
+ <dd>
+ <label for='update_check_yes' data-i18n="yes"></label> <input
type='radio' id='update_check_yes' name='update_check' />
+ <label for='update_check_no' data-i18n="no"></label> <input
type='radio' id='update_check_no' name='update_check' />
- <div class='notice'><span data-i18n="options_last_check"></span>:
<span id="last_update_check" data-i18n="never"></span></div>
- </dd>
- </dl>
- <dl>
- <dt><label for='update_check_period'
data-i18n="options_check_period"></label>:</dt>
- <dd>
- <input id='update_check_period' type='number' min="3" /> <span
data-i18n="hours"></span>
+ <div class='notice'><span
data-i18n="options_last_check"></span>: <span id="last_update_check" data-i18n="never"></span></div>
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for='update_check_period'
data-i18n="options_check_period"></label>:</dt>
+ <dd>
+ <input id='update_check_period' type='number' min="3" />
<span data-i18n="hours"></span>
- <div class='notice'><span data-i18n="options_next_check"></span>:
<span id="next_update_check" data-i18n="never"></span></div>
- </dd>
- </dl>
- <dl>
- <dt><span data-i18n="options_show_release_notes"></span>:</dt>
- <dd>
- <label for='show_release_notes_yes' data-i18n="yes"></label> <input
type='radio' id='show_release_notes_yes' name='show_release_notes' />
- <label for='show_release_notes_no' data-i18n="no"></label> <input
type='radio' id='show_release_notes_no' name='show_release_notes' />
- </dd>
- </dl>
- </fieldset>
+ <div class='notice'><span
data-i18n="options_next_check"></span>: <span id="next_update_check" data-i18n="never"></span></div>
+ </dd>
+ </dl>
+ <dl>
+ <dt><span data-i18n="options_show_release_notes"></span>:</dt>
+ <dd>
+ <label for='show_release_notes_yes' data-i18n="yes"></label>
<input type='radio' id='show_release_notes_yes' name='show_release_notes' />
+ <label for='show_release_notes_no' data-i18n="no"></label>
<input type='radio' id='show_release_notes_no' name='show_release_notes' />
+ </dd>
+ </dl>
+ </fieldset>
- <div class='buttons'>
- <button id="save" data-i18n="save"></button>
+ <div class='buttons'>
+ <button id="save" data-i18n="save"></button>
+ </div>
+ </div>
+ <div id="translation_credits">
+ <h2 data-i18n='translation_credits_title'></h2>
+ <div data-i18n='translation_credits' data-i18n-html='true'></div>
</div>
<script type="text/javascript" src="options.js"></script>
diff --git a/extension/options.js b/extension/options.js
index eabc1f4..683b956 100644
--- a/extension/options.js
+++ b/extension/options.js
@@ -92,6 +92,28 @@ i18n();
document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('save').addEventListener('click', save_options);
+if($('#translation_credits div').is(':empty'))
+{
+ $('#switch_tab').hide();
+}
+else
+{
+ $('#switch_tab').click(function() {
+ $('#options, #translation_credits').toggle();
+
+ if($('#options').is(':visible'))
+ {
+ $(this).text(m('translation_credits_title'));
+ }
+ else
+ {
+ $(this).text(m('options_link'));
+ }
+
+ return false;
+ });
+}
+
chrome.storage.onChanged.addListener(function (changes, areaName) {
if (areaName === 'local' && changes.lastUpdateCheck)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]