Mailinglist Archive: yast-commit (1914 mails)

< Previous Next >
[yast-commit] <web-client> master : use localized error messages for backend problems
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 10 Sep 2009 17:01:41 +0200
  • Message-id: <E1Mll9j-0003xo-Hf@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 7ead49b79d3462633c79bbae19babdd9f20d3b4f
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Sep 10 17:01:15 2009 +0200

use localized error messages for backend problems
---
plugins/systemtime/doc/README_FOR_APP | 2 +-
webclient/lib/error_constructor.rb | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/plugins/systemtime/doc/README_FOR_APP
b/plugins/systemtime/doc/README_FOR_APP
index a991b9c..c56758d 100644
--- a/plugins/systemtime/doc/README_FOR_APP
+++ b/plugins/systemtime/doc/README_FOR_APP
@@ -1,4 +1,4 @@
-Language
+systemtime
=========

Plugin for setting time and timezones.
diff --git a/webclient/lib/error_constructor.rb
b/webclient/lib/error_constructor.rb
index 8ec12fa..9d08098 100644
--- a/webclient/lib/error_constructor.rb
+++ b/webclient/lib/error_constructor.rb
@@ -3,7 +3,17 @@

module ErrorConstructor
def construct_error (error)
- #now use stupid unlocalized message
- return error["error"]["description"]
+
+ error = error["error"]
+ case error["type"]
+ when "NO_PERM"
+ return _("Permission #{error["permission"]} is not granted for user
#{error["user"]}")
+ when "POLKIT"
+ return _("Policy kit exception for user #{error["user"]} and permission
#{error["permission"]} (untranslated message): #{error["message"]}")
+ when "NOT_LOGGED"
+ return _("Noone is logged to rest service.")
+ when "BADFILE"
+ return _("Target system is not consistent: Missing or corrupted file
#{@file}")
+ end
end
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages