From: Aline Manera <alinefm(a)br.ibm.com>
V1 -> V2:
- Add missing messages to i18n.py
- Fix inconsistency with error message KCHTMPL6001M
- Replace "Storage Pool" to "storage pool"
- Replace "Storage Volume" to "storage volume"
- Replace "VM" to "virtual machine"
- And other minor changes suggested by Leonardo
This patch set includes:
- Create a common Exception class (KimchiError) to translate the error message
and proper set the parameters
- Create a i18n.py file with all messages used on backend
- Update build process to add the messages in this file to .po files
- Update UI to show the message received from backend to the user
- Update UI messages to add a code for them
- Display error message like: <code>: <msg>
Aline Manera (8):
refactor exception: Create a common Exception to translate error
messages
refactor exception: Add messages to be translated on backend
refactor exception: Set error messages for jsonschema validation
refator exception: Update control to raise the exception message
refactor exception: Update all exceptions
refactor exception: Update gen-pot script to get messages from
i18n.py
refactor exception: Update UI references
refactor exception: Update all po files
plugins/sample/API.json | 23 +-
plugins/sample/Makefile.am | 1 +
plugins/sample/__init__.py | 7 +-
plugins/sample/i18n.py | 44 ++
plugins/sample/model.py | 12 +-
po/POTFILES.in | 1 +
po/en_US.po | 739 ++++++++++++++++++++++++------
po/gen-pot.in | 8 +-
po/kimchi.pot | 664 ++++++++++++++++++++++-----
po/pt_BR.po | 738 +++++++++++++++++++++++------
po/zh_CN.po | 726 +++++++++++++++++++++++------
src/kimchi/API.json | 144 ++++--
src/kimchi/Makefile.am | 1 +
src/kimchi/asynctask.py | 4 +-
src/kimchi/auth.py | 8 +-
src/kimchi/control/base.py | 116 ++---
src/kimchi/control/utils.py | 14 +-
src/kimchi/disks.py | 5 +-
src/kimchi/distroloader.py | 5 +-
src/kimchi/exception.py | 42 +-
src/kimchi/i18n.py | 181 ++++++++
src/kimchi/iscsi.py | 6 +-
src/kimchi/isoinfo.py | 17 +-
src/kimchi/mockmodel.py | 113 +++--
src/kimchi/model/config.py | 2 +-
src/kimchi/model/debugreports.py | 18 +-
src/kimchi/model/host.py | 10 +-
src/kimchi/model/interfaces.py | 4 +-
src/kimchi/model/libvirtstoragepool.py | 14 +-
src/kimchi/model/networks.py | 37 +-
src/kimchi/model/storagepools.py | 39 +-
src/kimchi/model/storageservers.py | 2 +-
src/kimchi/model/storagevolumes.py | 37 +-
src/kimchi/model/templates.py | 44 +-
src/kimchi/model/utils.py | 2 +-
src/kimchi/model/vmifaces.py | 15 +-
src/kimchi/model/vms.py | 28 +-
src/kimchi/objectstore.py | 4 +-
src/kimchi/root.py | 10 +-
src/kimchi/template.py | 2 +-
src/kimchi/utils.py | 12 +-
src/kimchi/vmtemplate.py | 6 +-
tests/test_exception.py | 12 +-
tests/test_rest.py | 4 +-
tests/utils.py | 5 +-
ui/js/src/kimchi.api.js | 4 +-
ui/js/src/kimchi.guest_add_main.js | 7 +-
ui/js/src/kimchi.guest_main.js | 32 +-
ui/js/src/kimchi.host.js | 46 +-
ui/js/src/kimchi.line-chart.js | 2 +-
ui/js/src/kimchi.login_window.js | 8 +-
ui/js/src/kimchi.main.js | 6 +-
ui/js/src/kimchi.message.js | 4 +
ui/js/src/kimchi.network.js | 22 +-
ui/js/src/kimchi.report_add_main.js | 8 +-
ui/js/src/kimchi.storage_main.js | 18 +-
ui/js/src/kimchi.storagepool_add_main.js | 28 +-
ui/js/src/kimchi.template_add_main.js | 18 +-
ui/js/src/kimchi.template_main.js | 16 +-
ui/js/widgets/filter-select.js | 4 +-
ui/js/widgets/select-menu.js | 4 +-
ui/pages/guest-add.html.tmpl | 2 +-
ui/pages/i18n.html.tmpl | 172 ++++---
ui/pages/storagepool-add.html.tmpl | 4 +-
ui/pages/tabs/network.html.tmpl | 2 +-
65 files changed, 3243 insertions(+), 1090 deletions(-)
create mode 100644 plugins/sample/i18n.py
create mode 100644 src/kimchi/i18n.py
--
1.7.10.4