add some i18n

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1220734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-12-19 13:25:46 +00:00
parent 6f32db3293
commit 04934dc294
5 changed files with 13 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<div class='well' id="main-menu" redback-permissions="{permissions: ['archiva-manage-users']}" style="display: none"> <div class='well' id="main-menu" redback-permissions="{permissions: ['archiva-manage-users']}" style="display: none">
<ul class="navigation"> <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> <li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}"><a href="#" onclick="displayRolesGrid()">Role List</a></li>
</ul> </ul>
</div> </div>

View File

@ -29,6 +29,9 @@
this.maxPageIndex = ko.dependentObservable(function () { this.maxPageIndex = ko.dependentObservable(function () {
return Math.ceil(ko.utils.unwrapObservable(this.data).length / this.pageSize); return Math.ceil(ko.utils.unwrapObservable(this.data).length / this.pageSize);
}, this); }, this);
this.i18n=function(key){
return $.i18n.prop(key);
};
} }
}; };

View File

@ -29,6 +29,5 @@ require(["text!redback/templates/user-edit.html", "text!redback/templates/user-g
// template loading // template loading
$("#html-fragments").append(usercreate); $("#html-fragments").append(usercreate);
$("#html-fragments").append(usergrids); $("#html-fragments").append(usergrids);
} }
); );

View File

@ -4,10 +4,10 @@
{{each(i, columnDefinition) columns}} {{each(i, columnDefinition) columns}}
<th>${ columnDefinition.headerText }</th> <th>${ columnDefinition.headerText }</th>
{{/each}} {{/each}}
<th>Edit</th> <th>${$.i18n.prop('edit')}</th>
<th>Delete</th> <th>${$.i18n.prop('delete')}</th>
<th>Locked</th> <th>${$.i18n.prop('user.list.locked')}</th>
<th>Change password required</th> <th>${$.i18n.prop('user.change.password.required')}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -22,7 +22,7 @@
{{else}} {{else}}
<td> <td>
<a href="#" data-bind="click: function(){ row.deleteUser() }"> <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> </a>
</td> </td>
{{/if}} {{/if}}
@ -88,14 +88,14 @@
<script id="usersGrid" type="text/x-jquery-tmpl"> <script id="usersGrid" type="text/x-jquery-tmpl">
<div class="page-header"> <div class="page-header">
<h2>Users list</h2> <h2>${$.i18n.prop('users.list')}</h2>
</div> </div>
<ul id="users-view-tabs" class="tabs"> <ul id="users-view-tabs" class="tabs">
<li class="active" id="users-view-tabs-li-users-grid"> <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>
<li id="users-view-tabs-li-user-edit"> <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> </li>
</ul> </ul>
<div id="users-view-tabs-content" class="tab-content"> <div id="users-view-tabs-content" class="tab-content">

View File

@ -154,7 +154,6 @@ $(function() {
}); });
} }
} }
/** /**
@ -164,6 +163,7 @@ $(function() {
screenChange(); screenChange();
jQuery("#main-content").attr("data-bind",""); jQuery("#main-content").attr("data-bind","");
jQuery("#main-content").html($("#usersGrid").html()); jQuery("#main-content").html($("#usersGrid").html());
jQuery("#main-content").attr("data-bind",'template: {name:"usersGrid"}');
window.redbackModel.usersViewModel = new usersViewModel(); window.redbackModel.usersViewModel = new usersViewModel();
window.redbackModel.usersViewModel.loadUsers(); window.redbackModel.usersViewModel.loadUsers();
ko.applyBindings(window.redbackModel.usersViewModel,jQuery("#main-content").get(0)); ko.applyBindings(window.redbackModel.usersViewModel,jQuery("#main-content").get(0));