Add translation for SecuredPage
authorMoulliard Charles <cmoulliard@apache.org>
Thu, 8 Sep 2011 16:25:39 +0000 (16:25 +0000)
committerMoulliard Charles <cmoulliard@apache.org>
Thu, 8 Sep 2011 16:25:39 +0000 (16:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1166778 13f79535-47bb-0310-9956-ffa450edef68

core/src/main/java/org/apache/karaf/webconsole/core/page/SecuredPage.java
core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage.html
core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage.properties [new file with mode: 0644]
core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage_fr.properties [new file with mode: 0644]

index 86e186c..dbb498f 100644 (file)
  */
 package org.apache.karaf.webconsole.core.page;
 
-import java.util.List;
-
 import org.apache.karaf.webconsole.core.BasePage;
 import org.apache.karaf.webconsole.core.navigation.ConsoleTabProvider;
 import org.apache.karaf.webconsole.core.navigation.markup.NavigationPanel;
 import org.apache.wicket.Session;
 import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
+import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.Link;
 import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.model.StringResourceModel;
 import org.ops4j.pax.wicket.api.PaxWicketBean;
 
+import java.util.List;
+
 /**
  * Page which requires admin role, in other words authorized user.
  */
@@ -44,13 +46,16 @@ public class SecuredPage extends BasePage {
             }
         }));
 
-        add(new Link<Void>("logoutLink") {
+        Link aLink = new Link<Void>("logoutLink") {
             @Override
             public void onClick() {
                 Session.get().invalidateNow();
                 getRequestCycle().setRedirect(true);
                 setResponsePage(LoginPage.class);
             }
-        });
+        };
+        aLink.add(new Label("logoutTranslatedLink",new StringResourceModel("logout.link", this.getDefaultModel())));
+        add(aLink);
+
     }
 }
index 4fac146..f40d71f 100644 (file)
@@ -25,7 +25,7 @@
 <body>
 
     <wicket:extend>
-        <a href="#" wicket:id="logoutLink">Logout</a>
+        <a href="#" wicket:id="logoutLink"><div wicket:id="logoutTranslatedLink"/></a>
 
         <div class="grid_12">
             <div wicket:id="navigationPanel">Navigation goes here</div>
diff --git a/core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage.properties b/core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage.properties
new file mode 100644 (file)
index 0000000..1e98788
--- /dev/null
@@ -0,0 +1,2 @@
+# Login properties
+logout.link=Logout
\ No newline at end of file
diff --git a/core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage_fr.properties b/core/src/main/resources/org/apache/karaf/webconsole/core/page/SecuredPage_fr.properties
new file mode 100644 (file)
index 0000000..af7f830
--- /dev/null
@@ -0,0 +1,2 @@
+# Login properties
+logout.link=Se d\u00E9connecter
\ No newline at end of file