improvements supplier translations

This commit is contained in:
2013-01-10 20:56:30 +01:00
parent 4d0d1b7dd1
commit f6b28f84f0
7 changed files with 113 additions and 14 deletions
@@ -32,6 +32,10 @@
//= require qwaiter
//= require_directory .
//= require_self
var Qstorage = localStorage;
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}
var path_mapping = {
user_root: '/user',
join_occupied_table: '/user/join_occupied_table',
@@ -49,3 +53,15 @@ function redirect_to(mapping, variables){
function currency(num) {
return Qwaiter.currency(num);
}
$(function(){
$locale = Qstorage.getItem('locale') || 'en';
if(Qstorage.getItem('message')){
var container = $('.alert-success');
var msg_finder = Qstorage.getItem('message');
if(msg_finder.indexOf('.') == -1) msg_finder = 'messages.'+msg_finder;
container.find('div').text(t(msg_finder));
container.show();
Qstorage.removeItem('message');
}
setTranslations();
});