esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r825836 - in /incubator/esme/trunk/server/src/main: resources/ESMEBase.properties scala/bootstrap/liftweb/Boot.scala scala/org/apache/esme/lib/AccessPoolMgr.scala scala/org/apache/esme/lib/AuthMgr.scala scala/org/apache/esme/lib/TrackMgr.scala
Date Fri, 16 Oct 2009 10:33:12 GMT
Author: rhirsch
Date: Fri Oct 16 10:33:11 2009
New Revision: 825836

URL: http://svn.apache.org/viewvc?rev=825836&view=rev
Log:
[ESME-40] Static Texts in Resource File
Now scala files

Modified:
    incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala

Modified: incubator/esme/trunk/server/src/main/resources/ESMEBase.properties
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/resources/ESMEBase.properties?rev=825836&r1=825835&r2=825836&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/resources/ESMEBase.properties (original)
+++ incubator/esme/trunk/server/src/main/resources/ESMEBase.properties Fri Oct 16 10:33:11
2009
@@ -1,2 +1,20 @@
 base_nav_list_users=List all users
 base_signup_submit=Let me in
+
+base_error_not_logged_in="Please logon"
+
+base_menu_logout=Log out
+base_menu_signup=Sign Up
+base_menu_search=Search
+base_menu_logout_error=You must be logged in to log out
+
+base_action_menu=Pools
+base_action_error_name_short=Pool name is too short
+
+base_token_menu=Tokens
+base_token_error_name_short=Token description too short!
+base_token_msg_new_token=A new token has been created. 
+
+base_track_menu=Tracks
+base_track_error_name_short=Track is too short!
+base_track_msg_success=Now tracking %s

Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=825836&r1=825835&r2=825836&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Fri Oct 16 10:33:11
2009
@@ -116,20 +116,20 @@
 
     UserAuth.register(UserPwdAuthModule)
     UserAuth.register(OpenIDAuthModule)
-
-    // Build SiteMap
+    
+      // Build SiteMap
     val entries = Menu(Loc("Home", List("index"), "Home")) ::
     Menu(Loc("user", List("info_view", "user"), "User Info", Hidden,
       Loc.Snippet("user_info", TagDisplay.userInfo))) ::
     Menu(Loc("about", List("static", "about"), "About", Hidden)) ::
     Menu(Loc("tag", List("info_view", "tag"), "Tag", Hidden, Loc.Snippet("tag_display", TagDisplay.display)))
::
-    Menu(Loc("search", List("user_view", "search"), "Search", Hidden)) ::
-    Menu(Loc("sign_up", List("signup"), "Sign Up", 
+    Menu(Loc("search", List("user_view", "search"), S.?("base_menu_search"), Hidden)) ::
+    Menu(Loc("sign_up", List("signup"), S.?("base_menu_signup"), 
              Snippet("signup", User.signupForm),
              Unless(User.loggedIn_? _, "Can't sign up when logged in"))) ::
-    Menu(Loc("logout", List("logout"), "Log Out",
+    Menu(Loc("logout", List("logout"), S.?("base_menu_logout"),
              EarlyResponse(() => {User.logUserOut; S.redirectTo(S.referer openOr "/")}),
-             If(User.loggedIn_? _, "You must be logged in to log out"))) ::
+             If(User.loggedIn_? _, S.?("base_menu_logout_error")))) ::
     // User.sitemap :::
     UserMgr.menuItems :::
     TrackMgr.menuItems :::

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala?rev=825836&r1=825835&r2=825836&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Fri
Oct 16 10:33:11 2009
@@ -52,7 +52,7 @@
   val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("You must be logged in")))
 
   val menuItems =
-  Menu(Loc("accessPools", List("pools_view", "index"), "Manage Access Pools", ifIsLoggedIn,
+  Menu(Loc("accessPools", List("pools_view", "index"), S.?("base_action_menu"), ifIsLoggedIn,
            Loc.Snippet("addPool", addPool),
            Loc.Snippet("editPool", editPool),
            Loc.Snippet("poolUsers", displayPoolUsers),
@@ -74,7 +74,7 @@
     
     def addNewPool(name: String) = {
       name.trim match {
-        case x if x.length < 3 => S.error("Name too short")
+        case x if x.length < 3 => S.error(S.?("base_action_error_name_short"))
         case x => {
           val pool = AccessPool.create.realm(AccessPool.Native).setName(name)
           pool match {

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala?rev=825836&r1=825835&r2=825836&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AuthMgr.scala Fri Oct 16
10:33:11 2009
@@ -46,10 +46,10 @@
 object AuthMgr {
   def loggedIn_? = User.loggedIn_?
 
-  val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("You must be logged in")))
+  val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("base_error_not_logged_in")))
 
   val menuItems =
-  Menu(Loc("authToken", List("auth_view", "index"), "Manage Tokens", ifIsLoggedIn,
+  Menu(Loc("authToken", List("auth_view", "index"), S.?("base_token_menu"), ifIsLoggedIn,
            Loc.Snippet("displayTokens", displayTokens),
            Loc.Snippet("main", mainTokens))) ::
   Nil
@@ -91,9 +91,9 @@
     
     def addAuthToken(desc: String): JsCmd = {
       desc.trim match {
-        case x if x.length < 3 => S.error("Description too short")
+        case x if x.length < 3 => S.error(S.?("base_token_error_name_short"))
         case x => AuthToken.create.description(x).user(user).saveMe
-          S.notice("New token added")
+          S.notice(S.?("base_token_msg_new_token"))
       }
 
       redisplayTokens() & SetValById(theInput, "")

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala?rev=825836&r1=825835&r2=825836&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/TrackMgr.scala Fri Oct
16 10:33:11 2009
@@ -46,10 +46,10 @@
 object TrackMgr {
   def loggedIn_? = User.loggedIn_?
 
-  val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("You must be logged in")))
+  val ifIsLoggedIn = If(loggedIn_? _, strFuncToFailMsg(() => S.?("base_error_not_logged_in")))
 
   val menuItems =
-  Menu(Loc("trackMgt", List("track_view", "index"), "Item Tracking", ifIsLoggedIn,
+  Menu(Loc("trackMgt", List("track_view", "index"), S.?("base_track_menu"), ifIsLoggedIn,
            Loc.Snippet("displayTracking", displayTracking),
            Loc.Snippet("main", mainTracking))) ::
   Nil
@@ -92,9 +92,9 @@
     
     def addTrack(what: String): JsCmd = {
       what.trim match {
-        case x if x.length < 3 => S.error("Too short")
+        case x if x.length < 3 => S.error(S.?("base_track_error_name_short"))
         case x => Tracking.create.regex(x).user(user).saveMe
-          S.notice("Now tracking "+x)
+          S.notice(S.?("base_track_msg_success", x))
       }
 
       redisplayTracking() & SetValById(theInput, "")



Mime
View raw message