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">
<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>

View 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);
};
}
};

View 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);
}
);

View 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}}
@ -88,14 +88,14 @@
<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">

View 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));