Module: check_mk
Branch: master
Commit: 263cefe613f84bbf2d33cdd6c8f17b72644cbd56
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=263cefe613f84b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 24 15:24:21 2014 +0200
#1404 Make title/help of custom user attributes localizable
These two texts now also use the existing <i>Customer user localization</i>
mechanism.
---
.werks/1404 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 15 ++++++++-------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/.werks/1404 b/.werks/1404
new file mode 100644
index 0000000..c606b8f
--- /dev/null
+++ b/.werks/1404
@@ -0,0 +1,9 @@
+Title: Make title/help of custom user attributes localizable
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.5i6
+Date: 1411565020
+Class: feature
+
+These two texts now also use the existing <i>Customer user localization</i>
mechanism.
diff --git a/ChangeLog b/ChangeLog
index 952de45..75f6489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -114,6 +114,7 @@
* 1096 New WATO webservices: manage hosts via webinterface...
* 1155 NagVis map edit/view permissions can now be set using roles/groups...
* 1115 Renamed rule: Hosts using SNMP v2c -> Legacy SNMP devices using SNMP
v2c...
+ * 1404 Make title/help of custom user attributes localizable...
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different
OS versions)...
* 1089 FIX: Snapshot restore: fixed exception during exception handling......
* 1091 FIX: logwatch patterns: allow unicode text in pattern comment
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c3f93bb..afab772 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11463,7 +11463,7 @@ def mode_users(phase):
# the visible custom attributes
for name, attr in visible_custom_attrs:
vs = attr['valuespec']
- table.cell(vs.title())
+ table.cell(_u(vs.title()))
html.write(vs.value_to_text(user.get(name, vs.default_value())))
table.end()
@@ -11522,7 +11522,7 @@ def mode_edit_user(phase):
if not attr.get("permission") or
config.may(attr["permission"]):
vs = attr['valuespec']
- forms.section(vs.title())
+ forms.section(_u(vs.title()))
if attr['user_editable'] and not is_locked(name):
vs.render_input("ua_" + name, user.get(name,
vs.default_value()))
else:
@@ -11531,7 +11531,7 @@ def mode_edit_user(phase):
html.write('<div style="display:none">')
vs.render_input("ua_" + name, user.get(name,
vs.default_value()))
html.write('</div>')
- html.help(vs.help())
+ html.help(_u(vs.help()))
# Load data that is referenced - in order to display dropdown
# boxes and to check for validity.
@@ -15345,9 +15345,9 @@ def page_user_profile():
if attr['user_editable']:
if not attr.get("permission") or
config.may(attr["permission"]):
vs = attr['valuespec']
- forms.section(vs.title())
+ forms.section(_u(vs.title()))
vs.render_input("ua_" + name, user.get(name,
vs.default_value()))
- html.help(vs.help())
+ html.help(_u(vs.help()))
# Save button
forms.end()
@@ -16680,7 +16680,7 @@ def mode_edit_custom_attr(phase, what):
html.write(name)
html.set_focus("title")
- forms.section(_("Title"))
+ forms.section(_("Title") + "<sup>*</sup>")
html.help(_("The title is used to label this attribute."))
html.text_input("title", attr.get('title'))
@@ -16693,7 +16693,7 @@ def mode_edit_custom_attr(phase, what):
('personal', _('Personal Settings')),
], attr.get('topic', 'personal'))
- forms.section(_('Help Text'))
+ forms.section(_('Help Text') + "<sup>*</sup>")
html.help(_('You might want to add some helpful description for the
attribute.'))
html.text_area('help', attr.get('help', ''))
@@ -16719,6 +16719,7 @@ def mode_edit_custom_attr(phase, what):
html.checkbox('add_custom_macro', attr.get('add_custom_macro',
False))
forms.end()
+ show_localization_hint()
html.button("save", _("Save"))
html.hidden_fields()
html.end_form()