diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-08 14:06:20 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2010-02-08 14:06:20 +0000 |
commit | 0a7ad1459c22ccf65f21b2af7d53951062155190 (patch) | |
tree | 65e4784d53547d2ff36db0679028196ba71e9b48 | |
parent | 10a059fb201355a06a5e24e5959e62735458c297 (diff) | |
download | msec-0a7ad1459c22ccf65f21b2af7d53951062155190.tar msec-0a7ad1459c22ccf65f21b2af7d53951062155190.tar.gz msec-0a7ad1459c22ccf65f21b2af7d53951062155190.tar.bz2 msec-0a7ad1459c22ccf65f21b2af7d53951062155190.tar.xz msec-0a7ad1459c22ccf65f21b2af7d53951062155190.zip |
revert support for translatable values
-rw-r--r-- | src/msec/config.py | 32 | ||||
-rwxr-xr-x | src/msec/libmsec.py | 4 |
2 files changed, 3 insertions, 33 deletions
diff --git a/src/msec/config.py b/src/msec/config.py index 2e7726a..4f80bb5 100644 --- a/src/msec/config.py +++ b/src/msec/config.py @@ -41,32 +41,6 @@ try: except IOError: _ = str -# reverse translations -# the strings for reverse translations are defined with N_ instead of _, -# and are saved in config._translations{} with their reverse mapping -# config._value_mapping{} stores the mapping between raw and translated -# values in forward-compatible way -_translations={} -_value_mapping={} -def N_(s): - """Translates string and stores the reverse mapping""" - trans = _(s) - _translations[trans] = s - _value_mapping[s] = trans - return trans - -def translate_to_raw(s): - """Recovers reverse mapping of a translated string (if any)""" - if s in _translations: - return _translations[s] - return s - -def translate_from_raw(s): - """Maps a value into its translated version""" - if s in _value_mappings: - return _value_mappings[s] - return s - # shared strings MODIFICATIONS_FOUND = _('Modified system files') MODIFICATIONS_NOT_FOUND = _('No changes in system files') @@ -82,12 +56,12 @@ SETTINGS = { 'BASE_LEVEL': ("libmsec.base_level", ['*']), } # text for disabled options -OPTION_DISABLED=N_("Disabled") +OPTION_DISABLED=_("Disabled") # options for periodic checks -VALUES_PERIODIC=[N_('manual'), N_('daily'), N_('weekly'), N_('monthly'), N_('no')] +VALUES_PERIODIC=['manual', 'daily', 'weekly', 'monthly', 'no'] # options for yes-no checks -VALUES_YESNO=[N_('yes'), N_('no')] +VALUES_YESNO=['yes', 'no'] # some checks require installation of additional packages if a specific option was activated REQUIRE_PACKAGES = { diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index 77bcf7f..bcd7e7b 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -749,10 +749,6 @@ class MSEC: if param == None or len(param) == 0: self.log.debug("Skipping %s" % opt) continue - # checking if parameter value was translated - print "Before: %s" % param - param = config.translate_to_raw(param) - print "After: %s" % param if param not in valid_params and '*' not in valid_params: self.log.error(_("Invalid parameter for %s: '%s'. Valid parameters: '%s'.") % (opt, param, valid_params)) |