1
0
Fork 0
forked from 0x2620/oxjs

add localization to Ox

This commit is contained in:
j 2013-05-09 13:03:33 +00:00
commit 4d8c716d0b
31 changed files with 499 additions and 352 deletions

View file

@ -86,7 +86,7 @@ Ox.Progressbar = function(options, self) {
if (self.options.showPauseButton) {
self.$pauseButton = Ox.Button({
style: 'symbol',
tooltip: self.options.showTooltips ? ['Pause', 'Resume'] : '',
tooltip: self.options.showTooltips ? [Ox._('Pause'), Ox._('Resume')] : '',
type: 'image',
value: !self.options.paused ? 'pause' : 'redo',
values: ['pause', 'redo']
@ -102,12 +102,12 @@ Ox.Progressbar = function(options, self) {
style: 'symbol',
type: 'image'
}, self.options.showRestartButton ? {
tooltip: self.options.showTooltips ? ['Cancel', 'Restart'] : '',
tooltip: self.options.showTooltips ? [Ox._('Cancel'), Ox._('Restart')] : '',
value: 'close',
values: ['close', 'redo']
} : {
title: 'close',
tooltip: self.options.showTooltips ? 'Cancel' : ''
tooltip: self.options.showTooltips ? Ox._('Cancel') : ''
}))
.bindEvent({
click: toggleCancelled
@ -141,7 +141,7 @@ Ox.Progressbar = function(options, self) {
self.$progress.removeClass('OxAnimate');
($.browser.mozilla || $.browser.opera) && clearInterval(self.interval);
self.$time && self.$time.html(
self.options.cancelled ? 'Cancelled' : 'Paused'
self.options.cancelled ? Ox._('Cancelled') : Ox._('Paused')
);
}
@ -169,7 +169,7 @@ Ox.Progressbar = function(options, self) {
}, 1000 / 32);
}
self.$time && self.$time.html(
self.options.progress ? Ox.formatDuration(that.status().remaining) : 'unknown'
self.options.progress ? Ox.formatDuration(that.status().remaining) : Ox._('unknown')
);
}
@ -178,7 +178,7 @@ Ox.Progressbar = function(options, self) {
Math.floor(self.options.progress * 100) + '%'
);
self.$time && self.$time.html(
self.options.progress ? Ox.formatDuration(that.status().remaining) : 'unknown'
self.options.progress ? Ox.formatDuration(that.status().remaining) : Ox._('unknown')
);
self.$progress.stop().animate({
width: Math.round(14 + Math.abs(self.options.progress) * (self.trackWidth - 16)) + 'px'
@ -190,7 +190,7 @@ Ox.Progressbar = function(options, self) {
function stop() {
pause();
self.$time && self.$time.html(
self.options.cancelled ? 'Cancelled' : 'Complete'
self.options.cancelled ? Ox._('Cancelled') : Ox._('Complete')
);
if (self.$pauseButton && (self.options.cancelled || self.complete)) {
self.$pauseButton.options({disabled: true});

View file

@ -147,13 +147,13 @@ Ox.Resizebar = function(options, self) {
function getTitle() {
var title = '';
if (self.options.collapsed) {
title = 'Click to show';
title = Ox._('Click to show');
} else {
if (self.options.resizable) {
title = 'Drag to resize'
title = Ox._('Drag to resize');
}
if (self.options.collapsible) {
title = (title ? title + ' or c' : 'C') + 'lick to hide'
title = Ox._((title ? title + ' or c' : 'C') + 'lick to hide');
}
}
if (title && Ox.isString(self.options.tooltip)) {