]> source.dussan.org Git - archiva.git/commitdiff
add some i18n
authorOlivier Lamy <olamy@apache.org>
Mon, 19 Dec 2011 13:25:46 +0000 (13:25 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 19 Dec 2011 13:25:46 +0000 (13:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1220734 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

index 79a633ee5a983772560e734b8c470857e8236d3f..979aebb2eb47ca41ee24bb68fff3babead80291d 100644 (file)
@@ -1,7 +1,7 @@
 
   <div class='well' id="main-menu" redback-permissions="{permissions: ['archiva-manage-users']}" style="display: none">
     <ul class="navigation">
-      <li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}"><a href="#" onclick="displayUsersGrid()">User List</a></li>
+      <li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}"><a href="#" onclick="displayUsersGrid()">${$.i18n.prop('users.list')}</a></li>
       <li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}"><a href="#" onclick="displayRolesGrid()">Role List</a></li>
     </ul>
   </div>
index b2cd1df54d45176fc3d58230ac00fc2622ee11c8..c1d331ebecb03e472fe4396cc235f4df004b5958 100644 (file)
@@ -29,6 +29,9 @@
         this.maxPageIndex = ko.dependentObservable(function () {
             return Math.ceil(ko.utils.unwrapObservable(this.data).length / this.pageSize);
         }, this);
+        this.i18n=function(key){
+          return $.i18n.prop(key);
+        };
       }
     };
 
index 9d66734ff796fd7bd5cb877b71a7cf1cba1ed2b6..0fed206a7fb7087f20fa077eee8adeb95a752b77 100644 (file)
@@ -29,6 +29,5 @@ require(["text!redback/templates/user-edit.html", "text!redback/templates/user-g
       // template loading
       $("#html-fragments").append(usercreate);
       $("#html-fragments").append(usergrids);
-
     }
 );
\ No newline at end of file
index af413da7100d3ce9021ce89ebdd547da3dd4773b..f4c655122e90384bae36ab4eb4f65fa8473b28e8 100644 (file)
@@ -4,10 +4,10 @@
           {{each(i, columnDefinition) columns}}
               <th>${ columnDefinition.headerText }</th>
           {{/each}}
-          <th>Edit</th>
-          <th>Delete</th>
-          <th>Locked</th>
-          <th>Change password required</th>
+          <th>${$.i18n.prop('edit')}</th>
+          <th>${$.i18n.prop('delete')}</th>
+          <th>${$.i18n.prop('user.list.locked')}</th>
+          <th>${$.i18n.prop('user.change.password.required')}</th>
       </tr>
   </thead>
   <tbody>
@@ -22,7 +22,7 @@
               {{else}}
                 <td>
                   <a href="#" data-bind="click: function(){ row.deleteUser() }">
-                    <img src="images/delete.png" alt="Delete"/>
+                    <img src="images/delete.png" alt="${$.i18n.prop('delete')}"/>
                   </a>
                 </td>
               {{/if}}
 
 <script id="usersGrid"  type="text/x-jquery-tmpl">
     <div class="page-header">
-      <h2>Users list</h2>
+      <h2>${$.i18n.prop('users.list')}</h2>
     </div>
     <ul id="users-view-tabs" class="tabs">
       <li class="active" id="users-view-tabs-li-users-grid">
-        <a href="#users-view">Users</a>
+        <a href="#users-view">${$.i18n.prop('users.grid.tab.title')}</a>
       </li>
       <li id="users-view-tabs-li-user-edit">
-        <a href="#createUserForm">{window.redbackModel.i18n('user.add')}</a>
+        <a href="#createUserForm">${$.i18n.prop('user.add')}</a>
       </li>
     </ul>
     <div id="users-view-tabs-content" class="tab-content">
index 39994752553ca3ca6ad49be340385b2d88949f79..710fa5c856203aad9998f6053c24f4a0e2a3fa95 100644 (file)
@@ -154,7 +154,6 @@ $(function() {
       });
 
     }
-
   }
 
   /**
@@ -164,6 +163,7 @@ $(function() {
     screenChange();
     jQuery("#main-content").attr("data-bind","");
     jQuery("#main-content").html($("#usersGrid").html());
+    jQuery("#main-content").attr("data-bind",'template: {name:"usersGrid"}');
     window.redbackModel.usersViewModel = new usersViewModel();
     window.redbackModel.usersViewModel.loadUsers();
     ko.applyBindings(window.redbackModel.usersViewModel,jQuery("#main-content").get(0));