Currently, most modal dialogs use their respective action verb as the
main button's labels. For example, the submit button in the dialog
"Create network" has the label "Create". But that does not happen
consistently in all dialogs. For example, when editing a guest, the
dialog's submit button is labeled "Save" instead of "Edit".
It's an interesting topic here. Take edit template for example. The
flow is:
Change some buttons' labels to reflect their dialog's action verbs.
Also, remove the translation entries which are not used anymore.
Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
---
po/en_US.po | 3 ---
po/kimchi.pot | 3 ---
po/pt_BR.po | 3 ---
po/zh_CN.po | 3 ---
ui/js/src/kimchi.guest_edit_main.js | 8 ++++----
ui/js/src/kimchi.repository_edit_main.js | 6 +++---
ui/js/src/kimchi.template_edit_main.js | 2 +-
ui/pages/guest-edit.html.tmpl | 4 ++--
ui/pages/repository-edit.html.tmpl | 4 ++--
ui/pages/template-edit.html.tmpl | 2 +-
10 files changed, 13 insertions(+), 25 deletions(-)
diff --git a/po/en_US.po b/po/en_US.po
index 5c3d5d8..485ab25 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -946,9 +946,6 @@ msgstr "Network"
msgid "Type"
msgstr "Type"
-msgid "Save"
-msgstr "Save"
-
msgid "Detach"
msgstr ""
diff --git a/po/kimchi.pot b/po/kimchi.pot
index 89e6567..76f6f8b 100755
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -946,9 +946,6 @@ msgstr ""
msgid "Type"
msgstr ""
-msgid "Save"
-msgstr ""
-
msgid "Detach"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index b0058c4..9526973 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -1040,9 +1040,6 @@ msgstr "Redes"
msgid "Type"
msgstr "Tipo"
-msgid "Save"
-msgstr "Salvar"
-
msgid "Detach"
msgstr "Remover"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 2b6ac17..e39d7a9 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -966,9 +966,6 @@ msgstr "网络"
msgid "Type"
msgstr "类型"
-msgid "Save"
-msgstr "保存"
-
msgid "Detach"
msgstr "卸载"
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 0236e2d..e5e7698 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -30,7 +30,7 @@ kimchi.guest_edit_main = function() {
});
var guestEditForm = $('#form-guest-edit-general');
- var saveButton = $('#guest-edit-button-save');
var refreshCDROMs = function() {
kimchi.listVMStorages({
@@ -203,7 +203,7 @@ kimchi.guest_edit_main = function() {
kimchi.retrieveVM(kimchi.selectedGuest, initContent);
var submitForm = function(event) {
- $(saveButton).prop('disabled', true);
+ $(submitButton).prop('disabled', true);
var data=$('#form-guest-edit-general').serializeObject();
if(data['memory']!=undefined) {
data['memory'] = Number(data['memory']);
@@ -217,12 +217,12 @@ kimchi.guest_edit_main = function() {
kimchi.window.close();
}, function(err) {
kimchi.message.error(err.responseJSON.reason);
- $(saveButton).prop('disabled', false);
+ $(submitButton).prop('disabled', false);
});
event.preventDefault();
};
$(guestEditForm).on('submit', submitForm);
- $(saveButton).on('click', submitForm);
+ $(submitButton).on('click', submitForm);
};
diff --git a/ui/js/src/kimchi.repository_edit_main.js b/ui/js/src/kimchi.repository_edit_main.js
index 26d6c66..ce45514 100644
--- a/ui/js/src/kimchi.repository_edit_main.js
+++ b/ui/js/src/kimchi.repository_edit_main.js
@@ -19,7 +19,7 @@ kimchi.repository_edit_main = function() {
var editForm = $('#form-repository-edit');
- var saveButton = $('#repository-edit-button-save');
+ var submitButton = $('#repository-edit-button');
if(kimchi.host.capabilities['repo_mngt_tool']=="yum") {
editForm.find('input.deb').prop('disabled', true);
@@ -33,7 +33,7 @@ kimchi.repository_edit_main = function() {
$('input', editForm).on('input propertychange', function(event) {
if($(this).val() !== '') {
- $(saveButton).prop('disabled', false);
+ $(submitButton).prop('disabled', false);
}
});
});
@@ -71,5 +71,5 @@ kimchi.repository_edit_main = function() {
};
$(editForm).on('submit', editRepository);
- $(saveButton).on('click', editRepository);
+ $(submitButton).on('click', editRepository);
};
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index f0f4718..8f0a150 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -133,7 +133,7 @@ kimchi.template_edit_main = function() {
}
});
- $('#tmpl-edit-button-save').on('click', function() {
+ $('#tmpl-edit-button').on('click', function() {
var editableFields = [ 'name', 'cpus', 'memory', 'storagepool', 'disks', 'graphics'];
var data = {};
$.each(editableFields, function(i, field) {
diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
index 96d907e..75ef19d 100644
--- a/ui/pages/guest-edit.html.tmpl
+++ b/ui/pages/guest-edit.html.tmpl
@@ -116,8 +116,8 @@
</div>
<footer>
<div id="action-button-container" class="btn-group">
- <button id="guest-edit-button-save" class="btn-normal">
- <span class="text">$_("Save")</span>
+ <button id="guest-edit-button" class="btn-normal">
+ <span class="text">$_("Edit")</span>
</button>
</div>
</footer>
diff --git a/ui/pages/repository-edit.html.tmpl b/ui/pages/repository-edit.html.tmpl
index fbef4f3..d2dff59 100644
--- a/ui/pages/repository-edit.html.tmpl
+++ b/ui/pages/repository-edit.html.tmpl
@@ -103,8 +103,8 @@
</div>
<footer>
<div class="btn-group">
- <button type="submit" id="repository-edit-button-save" class="btn-normal">
- <span class="text">$_("Save")</span>
+ <button type="submit" id="repository-edit-button" class="btn-normal">
+ <span class="text">$_("Edit")</span>
</button>
</div>
</footer>
diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl
index 434d938..c4fe54a 100644
--- a/ui/pages/template-edit.html.tmpl
+++ b/ui/pages/template-edit.html.tmpl
@@ -142,7 +142,7 @@
<footer>
<div class="btn-group">
<a id="tmpl-edit-button-cancel" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Cancel")</span></a>
- <a id="tmpl-edit-button-save" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Save")</span></a>
+ <a id="tmpl-edit-button" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Edit")</span></a>
</div>
</footer>
</div>