Module: check_mk
Branch: master
Commit: 13a80c774207934b52e612e533cf9884ce1fdfa3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13a80c77420793…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 4 19:09:25 2013 +0100
WATO: Fix localization of rule options
---
ChangeLog | 1 +
web/htdocs/wato.py | 69 ++++++++++++++++++++++++++-------------------------
2 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a740f57..3824518 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -109,6 +109,7 @@
* FIX: Alias values of host/service/contact groups need to be set and unique
within the group
* FIX: Fixed exception when editing contactgroups without alias
+ * FIX: Fix localization of rule options
* Suggest use default value for filesystem levels that make sense
* Valuespec: CascadingDropdown now able to process choice values from functions
* Freshness checking for classical passive Nagios checks (custom_checks)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c02a1ea..de512db 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9427,40 +9427,6 @@ def change_host_tags_in_rules(folder, operations, mode):
# | from main.mk. |
# '----------------------------------------------------------------------'
-vs_rule_options = Dictionary(
- title = _("Additional options"),
- optional_keys = False,
- render = "form",
- elements = [
- ( "comment",
- TextUnicode(
- title = _("Comment"),
- help = _("An optional comment that helps you documenting the purpose of
"
- "this rule"),
- size = 80,
- attrencode = True,
- )
- ),
- ( "docu_url",
- TextAscii(
- title = _("Documentation-URL"),
- help = _("An optional URL pointing to documentation or any other page.
This will be displayed "
- "as an icon <img class=icon
src='images/button_url_lo.png'> and open a new page when clicked. "
- "You can use either global URLs (beginning with
<tt>http://</tt>), absolute local urls "
- "(beginning with <tt>/</tt>) or relative URLs (that
are relative to <tt>check_mk/</tt>)."),
- size = 80,
- ),
- ),
- ( "disabled",
- Checkbox(
- title = _("Rule activation"),
- help = _("Disabled rules are kept in the configuration but are not
applied."),
- label = _("do not apply this rule"),
- )
- ),
- ]
-)
-
def mode_ruleeditor(phase):
only_host = html.var("host", "")
only_local = "" # html.var("local")
@@ -10267,6 +10233,41 @@ def get_rule_conditions(ruleset):
def mode_edit_rule(phase, new = False):
+ # Due to localization this cannot be defined in the global context!
+ vs_rule_options = Dictionary(
+ title = _("Additional options"),
+ optional_keys = False,
+ render = "form",
+ elements = [
+ ( "comment",
+ TextUnicode(
+ title = _("Comment"),
+ help = _("An optional comment that helps you documenting the purpose
of "
+ "this rule"),
+ size = 80,
+ attrencode = True,
+ )
+ ),
+ ( "docu_url",
+ TextAscii(
+ title = _("Documentation-URL"),
+ help = _("An optional URL pointing to documentation or any other
page. This will be displayed "
+ "as an icon <img class=icon
src='images/button_url_lo.png'> and open a new page when clicked. "
+ "You can use either global URLs (beginning with
<tt>http://</tt>), absolute local urls "
+ "(beginning with <tt>/</tt>) or relative URLs
(that are relative to <tt>check_mk/</tt>)."),
+ size = 80,
+ ),
+ ),
+ ( "disabled",
+ Checkbox(
+ title = _("Rule activation"),
+ help = _("Disabled rules are kept in the configuration but are not
applied."),
+ label = _("do not apply this rule"),
+ )
+ ),
+ ]
+ )
+
varname = html.var("varname")
rulespec = g_rulespecs[varname]