add localization to pandora

This commit is contained in:
j 2013-05-09 10:13:58 +00:00
parent f02b8a73ff
commit 651e92b85b
85 changed files with 929 additions and 849 deletions

View file

@ -9,7 +9,8 @@ local_settings.py
config.jsonc
./local
./static/js/pandora.min.js.gz
./static/json/pandora.json.gz
./static/json/*.json.gz
./static/json/locale.??.json
./static/oxjs
./static/admin
./data

View file

@ -7,6 +7,7 @@ import sys
import shutil
import time
import thread
from glob import glob
from django.conf import settings
from django.contrib.auth.models import User
@ -192,6 +193,20 @@ def update_static():
shutil.copyfile(site, image)
else:
shutil.copyfile(pandora, image)
#locale
for f in sorted(glob(os.path.join(settings.STATIC_ROOT, 'json/locale.pandora.*.json'))):
with open(f) as fd:
locale = json.load(fd)
site_locale = f.replace('pandora', settings.CONFIG['site']['id'])
locale_file = f.replace('.pandora', '')
if os.path.exists(site_locale):
with open(f) as site_locale:
locale.update(json.load(fd))
print 'write', locale_file
with open(locale_file, 'w') as fd:
json.dump(locale, fd)
os.system('gzip -9 -c "%s" > "%s.gz"' % (locale_file, locale_file))
#download geo data
update_geoip()

View file

@ -768,6 +768,7 @@
"listSort": [{"key": "director", "operator": "+"}],
"listView": "grid",
"lists": {},
"locale": "en",
"mapFind": "",
"mapSelection": "",
"page": "",

View file

@ -805,6 +805,7 @@
"listSort": [{"key": "year", "operator": "+"}],
"listView": "grid",
"lists": {},
"locale": "en",
"mapFind": "",
"mapSelection": "",
"page": "",

View file

@ -686,6 +686,7 @@
"listSort": [{"key": "title", "operator": "+"}],
"listView": "grid",
"lists": {},
"locale": "en",
"mapFind": "",
"mapSelection": "",
"page": "",

View file

@ -606,6 +606,7 @@
"listSort": [{"key": "title", "operator": "+"}],
"listView": "grid",
"lists": {},
"locale": "en",
"mapFind": "",
"mapSelection": "",
"page": "",

View file

@ -310,56 +310,55 @@ appPanel
});
// set up url controller
pandora.URL.init().parse(function() {
if (data.browserSupported) {
stopAnimation();
$('#loadingScreen').remove();
} else {
loadBrowserMessage();
}
Ox.Theme(pandora.user.ui.theme);
if (isEmbed) {
pandora.$ui.embedPanel = pandora.ui.embedPanel().display();
Ox.$parent.onMessage({
settheme: function(data) {
if (Ox.contains(pandora.site.themes, data.theme)) {
Ox.Theme(data.theme);
}
},
seturl: function(data) {
if (pandora.isEmbedURL(data.url)) {
pandora.URL.push(data.url);
}
}
});
} else if (isPrint) {
pandora.$ui.printView = pandora.ui.printView().display();
} else {
pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
Ox.Request.bindEvent({
error: pandora.ui.errorDialog,
request: function(data) {
pandora.$ui.loadingIcon.options({
tooltip: (data.requests || 'No')
+ ' request'
+ (data.requests == 1 ? '' : 's')
});
}
});
pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8;
if (getLocalStorage('pandora.onload')) {
try {
eval(localStorage['pandora.onload'])
} catch(e) {}
pandora.setLocale(pandora.user.ui.locale, function() {
pandora.URL.init().parse(function() {
if (data.browserSupported) {
stopAnimation();
$('#loadingScreen').remove();
} else {
loadBrowserMessage();
}
}
Ox.Theme(pandora.user.ui.theme);
if (isEmbed) {
pandora.$ui.embedPanel = pandora.ui.embedPanel().display();
Ox.$parent.onMessage({
settheme: function(data) {
if (Ox.contains(pandora.site.themes, data.theme)) {
Ox.Theme(data.theme);
}
},
seturl: function(data) {
if (pandora.isEmbedURL(data.url)) {
pandora.URL.push(data.url);
}
}
});
} else if (isPrint) {
pandora.$ui.printView = pandora.ui.printView().display();
} else {
pandora.$ui.appPanel = pandora.ui.appPanel().display();
Ox.Request.requests() && pandora.$ui.loadingIcon.start();
pandora.$ui.body.ajaxStart(pandora.$ui.loadingIcon.start);
pandora.$ui.body.ajaxStop(pandora.$ui.loadingIcon.stop);
Ox.Request.bindEvent({
error: pandora.ui.errorDialog,
request: function(data) {
pandora.$ui.loadingIcon.options({
tooltip: (data.requests || 'No')
+ ' request'
+ (data.requests == 1 ? '' : 's')
});
}
});
pandora.site.sectionButtonsWidth = pandora.$ui.sectionButtons.width() + 8;
if (getLocalStorage('pandora.onload')) {
try {
eval(localStorage['pandora.onload'])
} catch(e) {}
}
}
});
});
}

View file

@ -40,22 +40,22 @@ pandora.ui.accountDialogOptions = function(action, value) {
resetAndSignin: 'Sign In'
},
dialogText = {
signin: 'To sign in to your account, please enter your username and password.',
signup: 'To sign up for an account, please choose a username and password, and enter your e-mail address.',
reset: 'To reset your password, please enter either your username or your e-mail address.',
resetAndSignin: 'To sign in to your account, please choose a new password, and enter the code that we have just e-mailed to you.'
signin: Ox._('To sign in to your account, please enter your username and password.'),
signup: Ox._('To sign up for an account, please choose a username and password, and enter your e-mail address.'),
reset: Ox._('To reset your password, please enter either your username or your e-mail address.'),
resetAndSignin: Ox._('To sign in to your account, please choose a new password, and enter the code that we have just e-mailed to you.')
},
dialogTitle = {
signin: 'Sign In',
signup: 'Sign Up',
reset: 'Reset Password',
resetAndSignin: 'Reset Password'
signin: Ox._('Sign In'),
signup: Ox._('Sign Up'),
reset: Ox._('Reset Password'),
resetAndSignin: Ox._('Reset Password')
};
function button(type) {
if (type == 'cancel') {
return Ox.Button({
id: 'cancel' + Ox.toTitleCase(action),
title: 'Cancel'
title: Ox._('Cancel')
}).bindEvent({
click: function() {
pandora.$ui.accountDialog.close();
@ -66,7 +66,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
return Ox.Button({
disabled: true,
id: 'submit' + Ox.toTitleCase(action),
title: buttonTitle[action]
title: Ox._(buttonTitle[action])
}).bindEvent({
click: function() {
pandora.$ui.accountForm.submit();
@ -75,7 +75,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
} else {
return Ox.Button({
id: type,
title: buttonTitle[type] + '...'
title: Ox._(buttonTitle[type] + '...')
}).bindEvent({
click: function() {
if (['signin', 'signup'].indexOf(type) > -1 && type != pandora.user.ui.page) {
@ -151,7 +151,7 @@ pandora.ui.accountForm = function(action, value) {
pandora.signin(result.data);
} else {
pandora.$ui.accountDialog.enableButtons();
that.setMessages([{id: 'password', message: 'Incorrect password'}]);
that.setMessages([{id: 'password', message: Ox._('Incorrect password')}]);
}
});
} else if (action == 'signup') {
@ -176,7 +176,7 @@ pandora.ui.accountForm = function(action, value) {
pandora.$ui.accountDialog.enableButtons();
} else {
pandora.$ui.accountDialog.enableButtons();
that.setMessages([{id: 'usernameOrEmail', message: 'Unknown ' + (key == 'username' ? 'username' : 'e-mail address')}])
that.setMessages([{id: 'usernameOrEmail', message: Ox._('Unknown ' + (key == 'username' ? 'username' : 'e-mail address'))}])
}
});
} else if (action == 'resetAndSignin') {
@ -186,7 +186,7 @@ pandora.ui.accountForm = function(action, value) {
pandora.signin(result.data);
} else {
pandora.$ui.accountDialog.enableButtons();
that.setMessages([{id: 'code', message: 'Incorrect code'}]);
that.setMessages([{id: 'code', message: Ox._('Incorrect code')}]);
}
});
}
@ -204,7 +204,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: pandora.autovalidateCode,
id: 'code',
label: 'Code',
label: Ox._('Code'),
labelWidth: 120,
validate: pandora.validateCode,
width: 320
@ -213,7 +213,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: pandora.autovalidateEmail,
id: 'email',
label: 'E-Mail Address',
label: Ox._('E-Mail Address'),
labelWidth: 120,
type: 'email', // fixme: ??
validate: pandora.validateUser('email'),
@ -223,7 +223,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: /.+/,
id: 'password',
label: 'New Password',
label: Ox._('New Password'),
labelWidth: 120,
type: 'password',
validate: pandora.validateNewPassword,
@ -233,7 +233,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: pandora.autovalidateUsername,
id: 'username',
label: 'Username',
label: Ox._('Username'),
labelWidth: 120,
validate: pandora.validateUser('username'),
width: 320
@ -242,7 +242,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
disabled: true,
id: 'username',
label: 'Username',
label: Ox._('Username'),
labelWidth: 120,
value: value,
width: 320
@ -251,7 +251,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: /.+/,
id: 'password',
label: 'Password',
label: Ox._('Password'),
labelWidth: 120,
type: 'password',
validate: pandora.validatePassword,
@ -261,7 +261,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({
autovalidate: pandora.autovalidateUsername,
id: 'username',
label: 'Username',
label: Ox._('Username'),
labelWidth: 120,
validate: pandora.validateUser('username', true),
width: 320
@ -273,8 +273,8 @@ pandora.ui.accountForm = function(action, value) {
pandora.$ui.usernameOrEmailSelect = Ox.Select({
id: 'usernameOrEmailSelect',
items: [
{id: 'username', title: 'Username'},
{id: 'email', title: 'E-Mail Address'},
{id: 'username', title: Ox._('Username')},
{id: 'email', title: Ox._('E-Mail Address')},
],
overlap: 'right',
width: 128
@ -315,7 +315,7 @@ pandora.ui.accountSignoutDialog = function() {
buttons: [
Ox.Button({
id: 'stay',
title: 'Stay Signed In'
title: Ox._('Stay Signed In')
}).bindEvent({
click: function() {
that.close();
@ -324,7 +324,7 @@ pandora.ui.accountSignoutDialog = function() {
}),
Ox.Button({
id: 'signout',
title: 'Sign Out'
title: Ox._('Sign Out')
}).bindEvent({
click: function() {
that.close();
@ -350,7 +350,7 @@ pandora.ui.accountSignoutDialog = function() {
height: 128,
keys: {enter: 'signout', escape: 'stay'},
removeOnClose: true,
title: 'Sign Out',
title: Ox._('Sign Out'),
width: 304
});
return that;
@ -361,7 +361,7 @@ pandora.ui.accountWelcomeDialog = function() {
buttons: [
Ox.Button({
id: 'preferences',
title: 'Preferences...'
title: Ox._('Preferences...')
}).bindEvent('click', function() {
that.close();
pandora.$ui.preferencesDialog = pandora.ui.preferencesDialog().open();
@ -369,7 +369,7 @@ pandora.ui.accountWelcomeDialog = function() {
{},
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent('click', function() {
that.close();
})
@ -392,7 +392,7 @@ pandora.ui.accountWelcomeDialog = function() {
height: 128,
keys: {enter: 'close', escape: 'close'},
removeOnClose: true,
title: 'Welcome to ' + pandora.site.site.name,
title: Ox._('Welcome to {0}', [pandora.site.site.name]),
width: 304
});
return that;

View file

@ -41,8 +41,8 @@ pandora.ui.allItems = function() {
})
.html(
pandora.user.ui.section == 'items'
? 'All ' + pandora.site.itemName.plural
: pandora.site.site.name + ' ' + Ox.toTitleCase(pandora.user.ui.section)
? Ox._('All {0}', [Ox._(pandora.site.itemName.plural)])
: Ox._('{0} ' + Ox.toTitleCase(pandora.user.ui.section), [pandora.site.site.name])
)
.appendTo(that),
$items;
@ -59,7 +59,7 @@ pandora.ui.allItems = function() {
Ox.Button({
style: 'symbol',
title: 'add',
tooltip: canAddItems ? 'Add ' + pandora.site.itemName.singular : '',
tooltip: canAddItems ? Ox._('Add {0}', [Ox._(pandora.site.itemName.singular)]) : '',
type: 'image'
})
.css({opacity: canAddItems ? 1 : 0.25})
@ -70,7 +70,7 @@ pandora.ui.allItems = function() {
Ox.Button({
style: 'symbol',
title: 'upload',
tooltip: canUploadVideo ? 'Upload Video...' : '',
tooltip: canUploadVideo ? Ox._('Upload Video...') : '',
type: 'image'
})
.css({opacity: canUploadVideo ? 1 : 0.25})
@ -89,14 +89,14 @@ pandora.ui.allItems = function() {
Ox.Button({
style: 'symbol',
title: 'file',
tooltip: 'HTML',
tooltip: Ox._('HTML'),
type: 'image'
})
.appendTo(that);
Ox.Button({
style: 'symbol',
title: 'help',
tooltip: 'Help',
tooltip: Ox._('Help'),
type: 'image'
})
.bindEvent({

View file

@ -6,20 +6,20 @@ pandora.ui.annotationDialog = function(layer) {
that = pandora.ui.iconDialog({
buttons: [].concat(
isEditor ? [
Ox.Button({title: 'Sign Up...'}).bindEvent({
Ox.Button({title: Ox._('Sign Up...')}).bindEvent({
click: function() {
that.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
}
}),
Ox.Button({title: 'Sign In...'}).bindEvent({
Ox.Button({title: Ox._('Sign In...')}).bindEvent({
click: function() {
that.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
}
})
] : [
Ox.Button({title: 'Switch to Editor'}).bindEvent({
Ox.Button({title: Ox._('Switch to Editor')}).bindEvent({
click: function() {
that.close();
pandora.UI.set({itemView: 'editor'});
@ -28,17 +28,17 @@ pandora.ui.annotationDialog = function(layer) {
],
[
{},
Ox.Button({title: 'Not Now'}).bindEvent({
Ox.Button({title: Ox._('Not Now')}).bindEvent({
click: function() {
that.close();
}
})
]
),
text: 'To add or edit ' + layer + ', ' + (
text: Ox._('To add or edit {0}, ' + (
isEditor
? 'please sign up or sign in.'
: 'just switch to the editor.'
: 'just switch to the editor.'), [layer]
),
title: Ox.toTitleCase(layer)
});

View file

@ -13,7 +13,7 @@ pandora.ui.apiDialog = function() {
buttons: [
Ox.Button({
id: 'switch',
title: 'Help...'
title: Ox._('Help...')
}).bindEvent({
click: function() {
pandora.UI.set({page: 'help', 'hash.anchor': ''});
@ -22,7 +22,7 @@ pandora.ui.apiDialog = function() {
{},
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
@ -37,7 +37,7 @@ pandora.ui.apiDialog = function() {
minHeight: 256,
minWidth: 544 + Ox.UI.SCROLLBAR_SIZE,
removeOnClose: true,
title: 'API Documentation',
title: Ox._('API Documentation'),
width: 672 + Ox.UI.SCROLLBAR_SIZE
})
.bindEvent({
@ -55,7 +55,7 @@ pandora.ui.apiDialog = function() {
pandora.api.api({docs: true, code: true}, function(results) {
var items = [{
id: '',
title: 'API Documentation',
title: Ox._('API Documentation'),
sort: 'aaa'
}];
actions = results.data.actions;
@ -180,7 +180,7 @@ pandora.ui.apiDialog = function() {
.appendTo($text);
Ox.Button({
title: 'Source (' + f + ')',
title: Ox._('Source ({0})', [f]),
}).bindEvent({
click: function() {
$code.toggle();

View file

@ -56,11 +56,11 @@ pandora.validateNewEmail = function(value, callback) {
operator: '=='
}, function(result) {
callback({
message: 'E-mail address already exists',
message: Ox._('E-mail address already exists'),
valid: !result.data.users.length
});
}) : callback({
message: value.length ? 'Invalid e-mail address' : '',
message: value.length ? Ox._('Invalid e-mail address') : '',
// message: (!value.length ? 'Missing' : 'Invalid') + ' e-mail address',
valid: false
});
@ -97,12 +97,12 @@ pandora.validateUser = function(key, existing) {
var valid = existing == !!result.data.users.length;
callback({
message: existing ?
'Unknown ' + string :
string[0].toUpperCase() + string.slice(1) + ' already exists',
Ox._('Unknown ' + string) :
Ox._(string[0].toUpperCase() + string.slice(1) + ' already exists'),
valid: valid
});
}) : callback({
message: value.length ? 'Invalid ' + string : '',
message: value.length ? Ox._('Invalid ' + string) : '',
// message: (!value.length ? 'Missing' : 'Invalid') + ' ' + string,
valid: false
});

View file

@ -2,7 +2,7 @@
'use strict';
pandora.ui.backButton = function() {
var that = Ox.Button({
title: 'Back to ' + pandora.site.itemName.plural,
title: Ox._('Back to {0}', [Ox._(pandora.site.itemName.plural)]),
width: 96
}).css({
float: 'left',

View file

@ -122,7 +122,7 @@ pandora.chunkupload = function(options) {
} else if(file.slice) {
chunk = file.slice(chunkOffset, chunkOffset+chunkSize, file.type);
} else {
that.status = 'Sorry, your browser is currently not supported.';
that.status = Ox._('Sorry, your browser is currently not supported.');
done();
}

View file

@ -11,7 +11,7 @@ pandora.ui.clipsView = function(videoRatio) {
fontSize: '9px',
textAlign: 'center'
})
.html('Loading...'),
.html(Ox._('Loading...')),
that = Ox.SplitPanel({
elements: [
@ -23,14 +23,14 @@ pandora.ui.clipsView = function(videoRatio) {
.append(
Ox.Input({
clear: true,
placeholder: 'Find Clips',
placeholder: Ox._('Find Clips'),
value: pandora.user.ui.itemFind,
width: 192
})
.css({float: 'right', margin: '4px'})
.bindEvent({
submit: function(data) {
$status.html('Loading...');
$status.html(Ox._('Loading...'));
pandora.UI.set('itemFind', data.value);
// since this is the only way itemFind can change,
// there's no need for an event handler
@ -59,8 +59,7 @@ pandora.ui.clipsView = function(videoRatio) {
init: function(data) {
var items = data.items;
$status.html(
(items ? Ox.formatNumber(items) : 'No')
+ ' Clip' + (items == 1 ? '' : 's')
Ox.formatCount(items, 'Clip')
);
}
});

View file

@ -12,7 +12,7 @@ pandora.ui.contactForm = function() {
items: [
Ox.Input({
id: 'name',
label: 'Your Name',
label: Ox._('Your Name'),
labelWidth: 128,
validate: function(value, callback) {
callback({valid: true});
@ -23,13 +23,13 @@ pandora.ui.contactForm = function() {
Ox.Input({
autovalidate: pandora.autovalidateEmail,
id: 'email',
label: 'Your E-Mail Address',
label: Ox._('Your E-Mail Address'),
labelWidth: 128,
validate: function(value, callback) {
callback({
message: 'Please enter '
message: Ox._('Please enter '
+ (value.length == 0 ? 'your' : 'a valid')
+ ' e-mail address',
+ ' e-mail address'),
valid: Ox.isValidEmail(value)
});
},
@ -38,7 +38,7 @@ pandora.ui.contactForm = function() {
}),
Ox.Input({
id: 'subject',
label: 'Subject',
label: Ox._('Subject'),
labelWidth: 128,
validate: function(value, callback) {
callback({valid: true});
@ -54,7 +54,7 @@ pandora.ui.contactForm = function() {
type: 'textarea',
validate: function(value, callback) {
callback({
message: 'Please enter a message',
message: Ox._('Please enter a message'),
valid: value.length > 0
});
},
@ -73,7 +73,7 @@ pandora.ui.contactForm = function() {
$receiptCheckbox = Ox.Checkbox({
id: 'receipt',
title: 'Send a receipt to ' + pandora.user.email,
title: Ox._('Send a receipt to {}', pandora.user.email),
value: pandora.user.level != 'guest',
width: width - 136
})
@ -82,8 +82,8 @@ pandora.ui.contactForm = function() {
change: function(data) {
$receiptCheckbox.options({
title: data.value
? 'Send a receipt to ' + pandora.user.email
: 'Don\'t send me a receipt'
? Ox._('Send a receipt to {0}', [pandora.user.email])
: Ox._('Don\'t send me a receipt')
});
}
})
@ -91,7 +91,7 @@ pandora.ui.contactForm = function() {
$sendButton = Ox.Button({
disabled: true,
title: 'Send Message',
title: Ox._('Send Message'),
width: 128
})
.css({float: 'left', margin: '8px 0 8px ' + (pandora.user.level == 'guest' ? width - 128 : 4) + 'px'})
@ -100,7 +100,7 @@ pandora.ui.contactForm = function() {
var data = $form.values();
$sendButton.options({
disabled: true,
title: 'Sending Message...'
title: Ox._('Sending Message...')
});
pandora.api.contact({
name: data.name,
@ -113,7 +113,7 @@ pandora.ui.contactForm = function() {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
$dialog.close();
@ -122,13 +122,13 @@ pandora.ui.contactForm = function() {
})
],
keys: {enter: 'close', escape: 'close'},
text: 'Thanks for your message!<br/><br/>We will get back to you as soon as possible.',
title: 'Message Sent'
text: Ox._('Thanks for your message!<br/><br/>We will get back to you as soon as possible.'),
title: Ox._('Message Sent')
})
.open();
$sendButton.options({
disabled: false,
title: 'Send Message'
title: Ox._('Send Message')
});
});
@ -139,9 +139,9 @@ pandora.ui.contactForm = function() {
$text = $('<div>')
.css({width: width + 'px'})
.html(
'&nbsp;Alternatively, you can contact us via <a href="mailto:'
+ pandora.site.site.email.contact + '">'
+ pandora.site.site.email.contact + '</a>'
'&nbsp;' + Ox._('Alternatively, you can contact us via {0}',
['<a href="mailto:' + pandora.site.site.email.contact + '">'
+ pandora.site.site.email.contact + '</a>'])
)
.appendTo(that);

View file

@ -7,7 +7,7 @@ pandora.ui.deleteFileDialog = function(file, callback) {
buttons: [
Ox.Button({
id: 'keep',
title: 'Keep File'
title: Ox._('Keep File')
}).bindEvent({
click: function() {
that.close();
@ -15,7 +15,7 @@ pandora.ui.deleteFileDialog = function(file, callback) {
}),
Ox.Button({
id: 'delete',
title: 'Delete File'
title: Ox._('Delete File')
}).bindEvent({
click: function() {
that.close();
@ -26,9 +26,8 @@ pandora.ui.deleteFileDialog = function(file, callback) {
})
],
keys: {enter: 'delete', escape: 'keep'},
text: 'Are you sure you want to delete the file'
+ ' "'+ file + '"?',
title: 'Delete File'
text: Ox._('Are you sure you want to delete the file "{0}"?', [file]),
title: Ox._('Delete File')
});
return that;

View file

@ -7,7 +7,7 @@ pandora.ui.deleteItemDialog = function(item) {
buttons: [
Ox.Button({
id: 'keep',
title: 'Keep ' + pandora.site.itemName.singular
title: Ox._('Keep {0}', [Ox._(pandora.site.itemName.singular)])
}).bindEvent({
click: function() {
that.close();
@ -15,7 +15,7 @@ pandora.ui.deleteItemDialog = function(item) {
}),
Ox.Button({
id: 'delete',
title: 'Delete ' + pandora.site.itemName.singular
title: Ox._('Delete {0}', [Ox._(pandora.site.itemName.singular)])
}).bindEvent({
click: function() {
that.close();
@ -29,10 +29,10 @@ pandora.ui.deleteItemDialog = function(item) {
})
],
keys: {enter: 'delete', escape: 'keep'},
text: 'Are you sure you want to delete the '
+ pandora.site.itemName.singular
+ ' "'+ item.title + '"?<br><br>All data will be removed.',
title: 'Delete ' + pandora.site.itemName.singular
text: Ox._('Are you sure you want to delete the {0} "{1}"?'
+ '<br><br>All data will be removed.',
[Ox._(pandora.site.itemName.singular), item.title]),
title: Ox._('Delete {0}', [Ox._(pandora.site.itemName.singular)])
});
return that;

View file

@ -14,7 +14,7 @@ pandora.ui.deleteListDialog = function(list) {
buttons: [
Ox.Button({
id: 'keep',
title: 'Keep ' + folderItem
title: Ox._('Keep {0}', [folderItem])
}).bindEvent({
click: function() {
that.close();
@ -22,7 +22,7 @@ pandora.ui.deleteListDialog = function(list) {
}),
Ox.Button({
id: 'delete',
title: 'Delete ' + folderItem
title: Ox._('Delete {0}', [folderItem])
}).bindEvent({
click: function() {
that.close();
@ -51,8 +51,9 @@ pandora.ui.deleteListDialog = function(list) {
})
],
keys: {enter: 'delete', escape: 'keep'},
text: 'Are you sure you want to delete the ' + folderItem.toLowerCase() + ' "' + listData.name + '"?',
title: 'Delete ' + folderItem
text: Ox._('Are you sure you want to delete the {0} "{1}"?',
[folderItem.toLowerCase(), listData.name]),
title: Ox._('Delete {0}', [folderItem])
});
return that;

View file

@ -34,12 +34,12 @@ pandora.ui.embedError = function(notImplemented) {
.css({marginTop: '4px', fontSize: '9px', textAlign: 'center'})
.html(
notImplemented
? 'This view is not<br>implemented.'
: 'This view cannot<br>be embedded.'
? Ox._('This view is not<br>implemented.')
: Ox._('This view cannot<br>be embedded.')
)
)
.appendTo(that);
return that;
};
};

View file

@ -10,7 +10,7 @@ pandora.ui.embedFileDialog = function(id) {
$content = Ox.Element()
.css({margin: '16px'})
.html(
'To embed this file, use the following HTML:<br>'
Ox._('To embed this file, use the following HTML:<br>')
),
$embed = $('<textarea>')
@ -36,7 +36,7 @@ pandora.ui.embedFileDialog = function(id) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
@ -49,7 +49,7 @@ pandora.ui.embedFileDialog = function(id) {
height: 128,
keys: {escape: 'close'},
removeOnClose: true,
title: 'Embed File',
title: Ox._('Embed File'),
width: 368
});

View file

@ -70,8 +70,8 @@ pandora.ui.embedPlayer = function() {
['timeline', 'position', 'settings']
),
controlsTooltips: {
close: 'Close',
open: 'Watch on ' + pandora.site.site.name
close: Ox._('Close'),
open: Ox._('Watch on {0}', [pandora.site.site.name])
},
controlsTop: [
options.showCloseButton ? 'close'
@ -331,4 +331,4 @@ pandora.ui.embedPlayer = function() {
return that;
};
};

View file

@ -11,7 +11,7 @@ pandora.ui.embedVideoDialog = function() {
$content = Ox.Element()
.css({margin: '16px'})
.html('To embed this clip, use the following HTML:<br>'),
.html(Ox._('To embed this clip, use the following HTML:<br>')),
$embed = $('<textarea>')
.css({
@ -39,7 +39,7 @@ pandora.ui.embedVideoDialog = function() {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
@ -52,7 +52,7 @@ pandora.ui.embedVideoDialog = function() {
height: 128,
keys: {escape: 'close'},
removeOnClose: true,
title: 'Embed Video',
title: Ox._('Embed Video'),
width: 368
});

View file

@ -15,7 +15,7 @@ pandora.ui.errorDialog = function(data) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -24,7 +24,7 @@ pandora.ui.errorDialog = function(data) {
})
],
keys: {enter: 'close', escape: 'close'},
text: 'Sorry, you have made an unauthorized request.',
text: Ox._('Sorry, you have made an unauthorized request.'),
title: Ox.toTitleCase(data.status.text)
})
.addClass('OxErrorDialog')
@ -40,7 +40,7 @@ pandora.ui.errorDialog = function(data) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -49,12 +49,12 @@ pandora.ui.errorDialog = function(data) {
})
],
keys: {enter: 'close', escape: 'close'},
text: 'Sorry, a server ' + error
text: Ox._('Sorry, a server {0}'
+ ' occured while handling your request.'
+ ' To help us find out what went wrong,'
+ ' you may want to report this error to an administrator.'
+ ' Otherwise, please try again later.',
title: 'Server ' + Ox.toTitleCase(error)
+ ' Otherwise, please try again later.', [error]),
title: Ox._('Server {0}', [Ox.toTitleCase(error)])
})
.addClass('OxErrorDialog')
.open();

View file

@ -10,7 +10,7 @@ pandora.ui.eventsDialog = function(options) {
buttons: [
Ox.Button({
id: 'managePlaces',
title: 'Manage Places...'
title: Ox._('Manage Places...')
}).bindEvent({
click: function() {
that.close();
@ -22,7 +22,7 @@ pandora.ui.eventsDialog = function(options) {
{},
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -37,7 +37,7 @@ pandora.ui.eventsDialog = function(options) {
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Events',
title: Ox._('Manage Events'),
width: width
})
.bindEvent({

View file

@ -12,7 +12,7 @@ pandora.ui.filesDialog = function() {
$reloadButton = Ox.Button({
disabled: true,
title: 'redo',
tooltip: 'Reload',
tooltip: Ox._('Reload'),
type: 'image'
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
@ -25,7 +25,7 @@ pandora.ui.filesDialog = function() {
}),
$userCheckbox = Ox.Checkbox({
title: 'Only show my files',
title: Ox._('Only show my files'),
value: false
})
.css({float: 'left', margin: '4px 2px'})
@ -40,9 +40,9 @@ pandora.ui.filesDialog = function() {
$findSelect = Ox.Select({
items: [
{id: 'all', title: 'Find: All'},
{id: 'user', title: 'Find: Username'},
{id: 'file', title: 'Find: Filename'}
{id: 'all', title: Ox._('Find: All')},
{id: 'user', title: Ox._('Find: Username')},
{id: 'file', title: Ox._('Find: Filename')}
],
overlap: 'right',
type: 'image'
@ -57,7 +57,7 @@ pandora.ui.filesDialog = function() {
$findInput = Ox.Input({
changeOnKeypress: true,
clear: true,
placeholder: 'Find: All',
placeholder: Ox._('Find: All'),
width: 192
})
.bindEvent({
@ -77,7 +77,7 @@ pandora.ui.filesDialog = function() {
{
id: 'user',
operator: '+',
title: 'Username',
title: Ox._('Username'),
visible: true,
width: 128
},
@ -85,14 +85,14 @@ pandora.ui.filesDialog = function() {
align: 'right',
id: 'name',
operator: '+',
title: 'Filename',
title: Ox._('Filename'),
visible: true,
width: 256
},
{
id: 'extension',
operator: '+',
title: 'Extension',
title: Ox._('Extension'),
visible: true,
width: 64
},
@ -103,7 +103,7 @@ pandora.ui.filesDialog = function() {
},
id: 'size',
operator: '-',
title: 'Size',
title: Ox._('Size'),
visible: true,
width: 64
},
@ -111,14 +111,14 @@ pandora.ui.filesDialog = function() {
align: 'right',
id: 'matches',
operator: '-',
title: 'Matches',
title: Ox._('Matches'),
visible: true,
width: 64
},
{
id: 'description',
operator: '+',
title: 'Description',
title: Ox._('Description'),
visible: true,
width: 256
},
@ -129,7 +129,7 @@ pandora.ui.filesDialog = function() {
},
id: 'created',
operator: '-',
title: 'Created',
title: Ox._('Created'),
visible: true,
width: 144
},
@ -140,7 +140,7 @@ pandora.ui.filesDialog = function() {
},
id: 'modified',
operator: '-',
title: 'Modified',
title: Ox._('Modified'),
visible: true,
width: 144
}
@ -156,8 +156,7 @@ pandora.ui.filesDialog = function() {
.bindEvent({
init: function(data) {
$status.html(
Ox.formatNumber(data.items)
+ ' file' + (data.items == 1 ? '' : 's')
Ox.formatCount(data.items, 'file')
);
},
load: function() {
@ -171,7 +170,7 @@ pandora.ui.filesDialog = function() {
$embedButton = Ox.Button({
title: 'embed',
tooltip: 'Embed',
tooltip: Ox._('Embed'),
type: 'image'
})
.css({
@ -188,7 +187,7 @@ pandora.ui.filesDialog = function() {
$closeButton = Ox.Button({
title: 'close',
tooltip: 'Close',
tooltip: Ox._('Close'),
type: 'image'
})
.css({
@ -210,7 +209,7 @@ pandora.ui.filesDialog = function() {
$itemToolbar = Ox.Bar({size: 24}),
$deleteButton = Ox.Button({
title: 'Delete File...',
title: Ox._('Delete File...'),
width: 96
})
.css({float: 'left', margin: '4px'})
@ -222,7 +221,7 @@ pandora.ui.filesDialog = function() {
$uploadButton = Ox.FileButton({
maxFiles: 1,
title: 'Upload File...',
title: Ox._('Upload File...'),
width: 96
})
.css({float: 'right', margin: '4px'})
@ -285,7 +284,7 @@ pandora.ui.filesDialog = function() {
$itemLabel = Ox.Label({
textAlign: 'center',
title: 'No file selected',
title: Ox._('No file selected'),
width: getLabelWidth()
})
.css({
@ -297,7 +296,7 @@ pandora.ui.filesDialog = function() {
buttons: [
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -313,7 +312,7 @@ pandora.ui.filesDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
title: 'Manage Files',
title: Ox._('Manage Files'),
width: dialogWidth
}),
@ -371,7 +370,7 @@ pandora.ui.filesDialog = function() {
Ox.Input({
disabled: true,
id: 'username',
label: 'Username',
label: Ox._('Username'),
labelWidth: 80,
value: file.user,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -379,7 +378,7 @@ pandora.ui.filesDialog = function() {
Ox.Input({
disabled: !editable,
id: 'name',
label: 'Filename',
label: Ox._('Filename'),
labelWidth: 80,
value: file.name,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -387,7 +386,7 @@ pandora.ui.filesDialog = function() {
Ox.Input({
disabled: true,
id: 'extension',
label: 'Extension',
label: Ox._('Extension'),
labelWidth: 80,
value: file.extension,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -395,7 +394,7 @@ pandora.ui.filesDialog = function() {
Ox.Input({
disabled: true,
id: 'size',
label: 'Size',
label: Ox._('Size'),
labelWidth: 80,
value: Ox.formatValue(file.size, 'B'),
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -403,7 +402,7 @@ pandora.ui.filesDialog = function() {
Ox.Input({
disabled: true,
id: 'matches',
label: 'Matches',
label: Ox._('Matches'),
labelWidth: 80,
value: file.matches,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -412,7 +411,7 @@ pandora.ui.filesDialog = function() {
disabled: !editable,
height: 256,
id: 'description',
placeholder: 'Description',
placeholder: Ox._('Description'),
type: 'textarea',
value: file.description,
width: itemWidth - 16 - Ox.UI.SCROLLBAR_SIZE
@ -472,7 +471,7 @@ pandora.ui.filesDialog = function() {
$itemLabel.options({
title: selected
? selected.split(':').slice(1).join(':')
: 'No file selected',
: Ox._('No file selected'),
width: getLabelWidth()
});
}

View file

@ -31,13 +31,13 @@ pandora.ui.filesView = function(options, self) {
{
disabled: true,
id: 'ignore',
title: 'Ignore Selected Files'
title: Ox._('Ignore Selected Files')
},
{},
{
disabled: !pandora.site.capabilities.canRemoveItems[pandora.user.level],
id: 'delete',
title: 'Delete ' + pandora.site.itemName.singular + '...'
title: Ox._('Delete {0}...', [Ox._(pandora.site.itemName.singular)])
}
],
title: 'set',
@ -60,7 +60,7 @@ pandora.ui.filesView = function(options, self) {
self.$saveButton = Ox.Button({
disabled: true,
title: 'Save Changes',
title: Ox._('Save Changes'),
width: 128
})
.css({
@ -96,14 +96,14 @@ pandora.ui.filesView = function(options, self) {
},
id: 'selected',
operator: '-',
title: 'Status',
title: Ox._('Status'),
titleImage: 'check',
tooltip: function (data) {
return data.encoding
? 'Processing video on server'
? Ox._('Processing video on server')
: data.instances.filter(function(i) {return i.ignore; }).length > 0
? 'Use this file'
: 'Dont use this file';
? Ox._('Use this file')
: Ox._('Dont use this file');
},
visible: true,
width: 16
@ -112,7 +112,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'users',
operator: '+',
title: 'Users',
title: Ox._('Users'),
visible: true,
width: 60
},
@ -120,7 +120,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'path',
operator: '+',
title: 'Path',
title: Ox._('Path'),
visible: true,
width: 360
},
@ -128,7 +128,7 @@ pandora.ui.filesView = function(options, self) {
editable: true,
id: 'version',
operator: '+',
title: 'Version',
title: Ox._('Version'),
visible: true,
width: 60
},
@ -136,7 +136,7 @@ pandora.ui.filesView = function(options, self) {
editable: true,
id: 'part',
operator: '+',
title: 'Part',
title: Ox._('Part'),
visible: true,
width: 60
},
@ -144,7 +144,7 @@ pandora.ui.filesView = function(options, self) {
editable: true,
id: 'partTitle',
operator: '+',
title: 'Part Title',
title: Ox._('Part Title'),
visible: true,
width: 120
},
@ -152,7 +152,7 @@ pandora.ui.filesView = function(options, self) {
editable: true,
id: 'language',
operator: '+',
title: 'Language',
title: Ox._('Language'),
visible: true,
width: 60
},
@ -160,7 +160,7 @@ pandora.ui.filesView = function(options, self) {
editable: true,
id: 'extension',
operator: '+',
title: 'Extension',
title: Ox._('Extension'),
visible: true,
width: 60
},
@ -168,7 +168,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'type',
operator: '+',
title: 'Type',
title: Ox._('Type'),
visible: true,
width: 60
},
@ -177,7 +177,7 @@ pandora.ui.filesView = function(options, self) {
format: {type: 'value', args: ['B']},
id: 'size',
operator: '-',
title: 'Size',
title: Ox._('Size'),
visible: true,
width: 90
},
@ -186,7 +186,7 @@ pandora.ui.filesView = function(options, self) {
format: {type: 'resolution', args: ['px']},
id: 'resolution',
operator: '-',
title: 'Resolution',
title: Ox._('Resolution'),
visible: true,
width: 90
},
@ -195,7 +195,7 @@ pandora.ui.filesView = function(options, self) {
format: {type: 'duration', args: [0, 'short']},
id: 'duration',
operator: '-',
title: 'Duration',
title: Ox._('Duration'),
visible: true,
width: 90
},
@ -203,7 +203,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'id',
operator: '+',
title: 'ID',
title: Ox._('ID'),
visible: false,
width: 120
},
@ -211,7 +211,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'instances',
operator: '+',
title: 'Instances',
title: Ox._('Instances'),
visible: false,
width: 120
}
@ -279,7 +279,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'user',
operator: '+',
title: 'User',
title: Ox._('User'),
visible: true,
width: 120
},
@ -287,7 +287,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'volume',
operator: '+',
title: 'Volume',
title: Ox._('Volume'),
visible: true,
width: 120
},
@ -295,7 +295,7 @@ pandora.ui.filesView = function(options, self) {
align: 'left',
id: 'path',
operator: '+',
title: 'Path',
title: Ox._('Path'),
visible: true,
width: 480
},
@ -316,15 +316,17 @@ pandora.ui.filesView = function(options, self) {
self.$movieLabel = Ox.Label({
textAlign: 'center',
title: 'Move selected files to another '
+ pandora.site.itemName.singular.toLowerCase(),
title: Ox._('Move selected files to another {0}',
[Ox._(pandora.site.itemName.singular.toLowerCase())]),
width: 240
})
.css({margin: '8px'});
['title', 'director', 'year', 'id'].forEach(function(key) {
var itemKey = Ox.getObjectById(pandora.site.itemKeys, key);
self['$' + key + 'Input'] = Ox.Input({
label: key == 'id' ? 'ID' : Ox.toTitleCase(key),
label: Ox._(key == 'id' ? 'ID'
: itemKey ? itemKey.title : Ox.toTitleCase(key)),
labelWidth: 64,
width: 240
})
@ -372,9 +374,8 @@ pandora.ui.filesView = function(options, self) {
});
self.$switch = Ox.Checkbox({
title: 'Switch to this '
+ pandora.site.itemName.singular.toLowerCase()
+ ' after moving files',
title: Ox._('Switch to this {0} after moving files',
[Ox._(pandora.site.itemName.singular.toLowerCase())]),
value: false,
width: 240
});
@ -392,7 +393,7 @@ pandora.ui.filesView = function(options, self) {
.css({margin: '8px'});
self.$clearButton = Ox.Button({
title: 'Clear Form',
title: Ox._('Clear Form'),
width: 116
})
.css({margin: '0 4px 4px 8px'})
@ -406,7 +407,7 @@ pandora.ui.filesView = function(options, self) {
self.$moveButton = Ox.Button({
disabled: true,
title: 'Move Files',
title: Ox._('Move Files'),
width: 116
})
.css({margin: '0 4px 4px 4px'})
@ -480,7 +481,7 @@ pandora.ui.filesView = function(options, self) {
data[key] = self['$' + key + 'Input'].value();
});
self.$moveButton.options(
{disabled: true, title: 'Moving Files...'}
{disabled: true, title: Ox._('Moving Files...')}
);
pandora.api.moveMedia(data, function(result) {
if (
@ -495,7 +496,7 @@ pandora.ui.filesView = function(options, self) {
self.$filesList.reloadList();
self.$instancesList.reloadList();
self.$moveButton.options(
{disabled: false, title: 'Move Files'}
{disabled: false, title: Ox._('Move Files')}
);
}
}
@ -530,7 +531,7 @@ pandora.ui.filesView = function(options, self) {
}
function saveChanges() {
self.$saveButton.options({disabled: true, title: 'Saving Changes...'});
self.$saveButton.options({disabled: true, title: Ox._('Saving Changes...')});
pandora.api.findMedia({
keys: ['id'],
query: self.filesQuery
@ -545,7 +546,7 @@ pandora.ui.filesView = function(options, self) {
return item;
})
}, function(result) {
self.$saveButton.options({title: 'Save Changes'});
self.$saveButton.options({title: Ox._('Save Changes')});
Ox.Request.clearCache(); // fixme: remove
self.$filesList.reloadList();
});

View file

@ -4,7 +4,7 @@ pandora.ui.filter = function(id) {
var i = Ox.getIndexById(pandora.user.ui.filters, id),
filter = Ox.getObjectById(pandora.site.filters, id),
panelWidth = pandora.$ui.document.width() - (pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize) - 1,
title = Ox.getObjectById(pandora.site.filters, id).title,
title = Ox._(Ox.getObjectById(pandora.site.filters, id).title),
//width = pandora.getFilterWidth(i, panelWidth),
that = Ox.TableList({
_selected: !pandora.user.ui.showFilters
@ -87,7 +87,7 @@ pandora.ui.filter = function(id) {
init: function(data) {
that.setColumnTitle(
'name',
Ox.getObjectById(pandora.site.filters, id).title
Ox._(Ox.getObjectById(pandora.site.filters, id).title)
+ '<div class="OxColumnStatus OxLight">'
+ (data.items ? Ox.formatNumber(data.items) : '')
+ '</div>'
@ -176,8 +176,8 @@ pandora.ui.filter = function(id) {
}),
$menu = Ox.MenuButton({
items: [
{id: 'clearFilter', title: 'Clear Filter', keyboard: 'shift control a'},
{id: 'clearFilters', title: 'Clear All Filters', keyboard: 'shift alt control a'},
{id: 'clearFilter', title: Ox._('Clear Filter'), keyboard: 'shift control a'},
{id: 'clearFilters', title: Ox._('Clear All Filters'), keyboard: 'shift alt control a'},
{},
{group: 'filter', max: 1, min: 1, items: pandora.site.filters.map(function(filter) {
return Ox.extend({checked: filter.id == id}, filter);

View file

@ -6,7 +6,7 @@ pandora.ui.filterDialog = function(list) {
buttons: [
Ox.Button({
id: 'done',
title: 'Done'
title: Ox._('Done')
})
.bindEvent({
click: function() {
@ -49,12 +49,12 @@ pandora.ui.filterDialog = function(list) {
height: 264,
// keys: {enter: 'save', escape: 'cancel'},
removeOnClose: true,
title: list ? 'Smart List - ' + list.name : 'Advanced Find',
title: list ? Ox._('Smart List - {0}', [list.name]) : Ox._('Advanced Find'),
width: 648 + Ox.UI.SCROLLBAR_SIZE
}),
$updateCheckbox = Ox.Checkbox({
title: 'Update Results in the Background',
title: Ox._('Update Results in the Background'),
value: pandora.user.ui.updateAdvancedFindResults
})
.css({float: 'left', margin: '4px'})

View file

@ -17,6 +17,7 @@ pandora.ui.filterForm = function(list) {
that.$filter = Ox.Filter({
findKeys: pandora.site.itemKeys.map(function(itemKey) {
var key = Ox.clone(itemKey, true);
key.title = Ox._(key.title);
key.type = key.type == 'layer'
? Ox.getObjectById(pandora.site.layers, key.id).type
: key.type;
@ -26,7 +27,7 @@ pandora.ui.filterForm = function(list) {
return key;
}).concat([{
id: 'list',
title: 'List',
title: Ox._('List'),
type: 'list',
values: result.data.items.map(function(item) {
return item.id;

View file

@ -10,8 +10,8 @@ pandora.ui.findElement = function() {
elements: [].concat(pandora.user.ui._list ? [
pandora.$ui.findListSelect = Ox.Select({
items: [
{id: 'all', title: 'Find: All ' + pandora.site.itemName.plural},
{id: 'list', title: 'Find: This List'}
{id: 'all', title: Ox._('Find: All {0}', [Ox._(pandora.site.itemName.plural)])},
{id: 'list', title: Ox._('Find: This List')}
],
overlap: 'right',
type: 'image',
@ -34,12 +34,12 @@ pandora.ui.findElement = function() {
}).map(function(key) {
return {
id: key.id,
title: 'Find: ' + key.title
title: Ox._('Find: {0}', [Ox._(key.title)])
};
}),
[{}, {
id: 'advanced',
title: 'Find: Advanced...'
title: Ox._('Find: Advanced...')
}]
),
overlap: 'right',
@ -70,7 +70,7 @@ pandora.ui.findElement = function() {
autocompleteSelectSubmit: true,
clear: true,
id: 'input',
placeholder: findKey == 'advanced' ? 'Edit Query...' : '',
placeholder: findKey == 'advanced' ? Ox._('Edit Query...') : '',
value: findValue,
width: 192
})
@ -146,7 +146,7 @@ pandora.ui.findElement = function() {
pandora.$ui.findSelect.value(findState.key);
pandora.$ui.findInput.options(
findState.key == 'advanced'
? {placeholder: 'Edit Query...', value: ''}
? {placeholder: Ox._('Edit Query...'), value: ''}
: {
autocomplete: autocompleteFunction(),
placeholder: '',

View file

@ -11,8 +11,8 @@ pandora.ui.folderBrowserBar = function(id) {
elements: [
pandora.$ui.findListSelect[id] = Ox.Select({
items: [
{id: 'user', title: 'Find: User'},
{id: 'name', title: 'Find: ' + folderItem}
{id: 'user', title: Ox._('Find: User')},
{id: 'name', title: Ox._('Find: {0}', [folderItem])}
],
overlap: 'right',
type: 'image'
@ -30,7 +30,7 @@ pandora.ui.folderBrowserBar = function(id) {
pandora.$ui.findListInput[id] = Ox.Input({
changeOnKeypress: true,
clear: true,
placeholder: 'Find: User',
placeholder: Ox._('Find: User'),
width: pandora.getFoldersWidth() - 24
})
.bindEvent({

View file

@ -45,7 +45,7 @@ pandora.ui.folderBrowserList = function(id) {
},
id: 'user',
operator: '+',
title: 'User',
title: Ox._('User'),
visible: true,
width: Math.floor(columnWidth)
},
@ -55,7 +55,7 @@ pandora.ui.folderBrowserList = function(id) {
},
id: 'name',
operator: '+',
title: folderItem,
title: Ox._(folderItem),
visible: true,
width: Math.ceil(columnWidth)
},
@ -64,7 +64,7 @@ pandora.ui.folderBrowserList = function(id) {
id: 'items',
format: {type: 'number'},
operator: '-',
title: 'Items',
title: Ox._('Items'),
visible: ui.section == 'items',
width: 48
},
@ -96,10 +96,10 @@ pandora.ui.folderBrowserList = function(id) {
titleImage: 'edit',
tooltip: function(data) {
return data.type == 'static'
? (data.user == pandora.user.username ? 'Edit Default View' : 'Default View: ...')
? (data.user == pandora.user.username ? Ox._('Edit Default View') : Ox._('Default View: ...'))
: data.type == 'smart'
? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query')
: data.type.toUpperCase();
? (data.user == pandora.user.username ? Ox._('Edit Query') : Ox._('Show Query'))
: Ox._(data.type.toUpperCase());
},
visible: true,
width: 16
@ -127,8 +127,8 @@ pandora.ui.folderBrowserList = function(id) {
titleImage: id == 'favorite' ? 'like' : 'star',
tooltip: function(data) {
var checked = id == 'favorite' ? data.subscribed : data.status == 'featured';
return (checked ? 'Remove from' : 'Add to')
+ ' ' + Ox.toTitleCase(id) + ' ' + folderItems;
return Ox._((checked ? 'Remove from' : 'Add to')
+ ' ' + Ox.toTitleCase(id) + ' ' + folderItems);
},
visible: true,
width: 16

View file

@ -30,7 +30,7 @@ pandora.ui.folderList = function(id) {
tooltip: function(data) {
return data.user == pandora.user.username
|| (id == 'featured' && canEditFeatured)
? 'Edit Icon'
? Ox._('Edit Icon')
: '';
},
visible: true,
@ -59,7 +59,7 @@ pandora.ui.folderList = function(id) {
autovalidate: pandora.ui.autovalidateListname
},
operator: '+',
tooltip: id == 'personal' ? 'Edit Title' : '',
tooltip: id == 'personal' ? Ox._('Edit Title') : '',
unformat: function(value) {
return Ox.decodeHTMLEntities(value);
},
@ -101,9 +101,9 @@ pandora.ui.folderList = function(id) {
operator: '+',
tooltip: function(data) {
return data.type == 'static'
? (data.user == pandora.user.username ? 'Edit Default View' : 'Default View: ...')
? (data.user == pandora.user.username ? Ox._('Edit Default View') : Ox._('Default View: ...'))
: data.type == 'smart'
? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query')
? (data.user == pandora.user.username ? Ox._('Edit Query') : Ox._('Show Query'))
: data.type.toUpperCase();
},
visible: true,
@ -129,7 +129,7 @@ pandora.ui.folderList = function(id) {
id: 'status',
operator: '+',
tooltip: id == 'personal' ? function(data) {
return data.status == 'private' ? 'Make Public' : 'Make Private';
return data.status == 'private' ? Ox._('Make Public') : Ox._('Make Private');
} : null,
visible: true,
width: 16
@ -177,7 +177,7 @@ pandora.ui.folderList = function(id) {
editable: true,
id: 'name',
operator: '+',
tooltip: 'Edit Title',
tooltip: Ox._('Edit Title'),
visible: true,
width: ui.sidebarWidth - 96
},
@ -207,7 +207,7 @@ pandora.ui.folderList = function(id) {
id: 'path',
operator: '+',
tooltip: function(data) {
return data.mounted ? 'Scan Volume' : 'Edit Path';
return data.mounted ? Ox._('Scan Volume') : Ox._('Edit Path');
},
visible: true,
width: 16
@ -229,7 +229,7 @@ pandora.ui.folderList = function(id) {
id: 'mounted',
operator: '+',
tooltip: function(data) {
return data.mounted ? 'Unmount Volume' : 'Mount Volume';
return data.mounted ? Ox._('Unmount Volume') : Ox._('Mount Volume');
},
visible: true,
width: 16

View file

@ -25,26 +25,26 @@ pandora.ui.folders = function() {
if (folder.id == 'personal') {
if (pandora.user.level == 'guest') {
extras = [
infoButton('Personal ' + folderItems, 'To create and share your own ' + (ui.section == 'items'
? 'lists of ' + pandora.site.itemName.plural.toLowerCase()
: ui.section) + ', please sign up or sign in.')
infoButton(Ox._('Personal {0}', [Ox._(folderItems)]),
Ox._('To create and share your own list of {0} please sign up or sign in.', [Ox._(pandora.site.itemName.plural.toLowerCase())]),
Ox._('To create and share your own {0} please sign up or sign in.', [ui.section]))
];
} else {
if (ui.section == 'items') {
extras = [
pandora.$ui.personalListsMenu = Ox.MenuButton({
items: [
{ id: 'newlist', title: 'New List' },
{ id: 'newlistfromselection', title: 'New List from Selection', disabled: ui.listSelection.length == 0 },
{ id: 'newsmartlist', title: 'New Smart List' },
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results' },
{ id: 'newlist', title: Ox._('New List') },
{ id: 'newlistfromselection', title: Ox._('New List from Selection'), disabled: ui.listSelection.length == 0 },
{ id: 'newsmartlist', title: Ox._('New Smart List') },
{ id: 'newsmartlistfromresults', title: Ox._('New Smart List from Results') },
{},
{ id: 'duplicatelist', title: 'Duplicate Selected List', disabled: !pandora.user.ui._list },
{ id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list },
{ id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list }
{ id: 'duplicatelist', title: Ox._('Duplicate Selected List'), disabled: !pandora.user.ui._list },
{ id: 'editlist', title: Ox._('Edit Selected List...'), disabled: !pandora.user.ui._list },
{ id: 'deletelist', title: Ox._('Delete Selected List...'), disabled: !pandora.user.ui._list }
],
title: 'edit',
tooltip: 'Manage Personal Lists',
tooltip: Ox._('Manage Personal Lists'),
type: 'image'
})
.bindEvent({
@ -86,13 +86,13 @@ pandora.ui.folders = function() {
extras = [
pandora.$ui.personalListsMenu = Ox.MenuButton({
items: [
{ id: 'newtext', title: 'New Text' },
{ id: 'newpdf', title: 'New PDF' },
{ id: 'newtext', title: Ox._('New Text') },
{ id: 'newpdf', title: Ox._('New PDF') },
{},
{ id: 'deletetext', title: 'Delete Selected Text...', disabled: !ui.text }
{ id: 'deletetext', title: Ox._('Delete Selected Text...'), disabled: !ui.text }
],
title: 'edit',
tooltip: 'Manage Personal Texts',
tooltip: Ox._('Manage Personal Texts'),
type: 'image'
})
.bindEvent({
@ -119,14 +119,14 @@ pandora.ui.folders = function() {
}
} else if (folder.id == 'favorite') {
if (pandora.user.level == 'guest') {
extras = [infoButton('Favorite ' + folderItems,
'To browse and subscribe to shared ' + folderItems.toLowerCase() + ' from other users, please sign up or sign in.')];
extras = [infoButton(Ox._('Favorite ', folderItems),
Ox._('To browse and subscribe to shared {0} from other users, please sign up or sign in.', [Ox._(folderItems.toLowerCase())]))];
} else {
extras = [pandora.$ui.manageListsButton['favorite'] = Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
tooltip: 'Manage Favorite ' + folderItems,
title: Ox._('Edit'),
tooltip: Ox._('Manage Favorite {0}', [Ox._(folderItems)]),
type: 'image'
})
.bindEvent({
@ -134,7 +134,7 @@ pandora.ui.folders = function() {
var listData;
Ox.Request.clearCache(); // fixme: remove
pandora.site.sectionFolders[ui.section][i].showBrowser = !pandora.site.sectionFolders[ui.section][i].showBrowser;
this.options({tooltip: data.value ? 'Done' : 'Manage Favorite ' + folderItems});
this.options({tooltip: data.value ? Ox._('Done') : Ox._('Manage Favorite {0}', [Ox._(folderItems)])});
if (pandora.site.sectionFolders[ui.section][i].showBrowser) {
pandora.$ui.folderList.favorite.replaceWith(
pandora.$ui.folderBrowser.favorite = pandora.ui.folderBrowser('favorite')
@ -167,13 +167,15 @@ pandora.ui.folders = function() {
}
} else if (folder.id == 'featured') {
if (pandora.user.level != 'admin') {
extras = [infoButton('Featured ' + folderItems, 'Featured ' + folderItems.toLowerCase() + ' are selected public ' + folderItems.toLowerCase() + ', picked by the ' + pandora.site.site.name + ' staff.')];
extras = [infoButton(Ox._('Featured {0}', [Ox._(folderItems)]),
Ox._('Featured {0} are selected public {0}, picked by the {1} staff.',
[Ox._(folderItems.toLowerCase()), pandora.site.site.name]))];
} else {
extras = [pandora.$ui.manageListsButton['featured'] = Ox.Button({
selectable: true,
style: 'symbol',
title: 'Edit',
tooltip: 'Manage Featured ' + folderItems,
title: Ox._('Edit'),
tooltip: Ox._('Manage Featured {0}', [Ox._(folderItems)]),
type: 'image'
})
.bindEvent({
@ -181,7 +183,7 @@ pandora.ui.folders = function() {
var listData;
Ox.Request.clearCache(); // fixme: remove
pandora.site.sectionFolders[ui.section][i].showBrowser = !pandora.site.sectionFolders[ui.section][i].showBrowser;
this.options({tooltip: data.value ? 'Done' : 'Manage Favorite ' + folderItems});
this.options({tooltip: data.value ? Ox._('Done') : Ox._('Manage Favorite {0}', [Ox._(folderItems)])});
if (pandora.site.sectionFolders[ui.section][i].showBrowser) {
pandora.$ui.folderList.featured.replaceWith(
pandora.$ui.folderBrowser.featured = pandora.ui.folderBrowser('featured')
@ -221,18 +223,20 @@ pandora.ui.folders = function() {
}
} else if (folder.id == 'volumes') {
if (pandora.user.level == 'guest') {
extras = [infoButton('Local Volumes', 'To import movies from a local disk, please sign up or sign in.')];
extras = [infoButton(Ox._('Local Volumes'), Ox._('To import {0} from a local disk, please sign up or sign in.',
[Ox._(pandora.site.itemName.plural.toLocaleLowerCase())]))];
} else {
extras = [Ox.MenuButton({
items: [
{ id: 'add', title: 'Add Volume...', disabled: true },
{ id: 'scan', title: 'Scan Selected Volume...', disabled: true },
{ id: 'remove', title: 'Remove Selected Volume...', disabled: true },
{ id: 'add', title: Ox._('Add Volume...'), disabled: true },
{ id: 'scan', title: Ox._('Scan Selected Volume...'), disabled: true },
{ id: 'remove', title: Ox._('Remove Selected Volume...'), disabled: true },
{},
{ id: 'import', title: 'Import Movies...', disabled: true }
{ id: 'import', title: Ox._('Import {0}...',
[Ox._(pandora.site.itemName.plural.toLocaleLowerCase())]), disabled: true }
],
title: 'edit',
tooltip: 'Manage Volumes',
tooltip: Ox._('Manage Volumes'),
type: 'image'
})
.bindEvent({
@ -315,27 +319,27 @@ pandora.ui.folders = function() {
}).bindEvent({
click: function() {
var $dialog = pandora.ui.iconDialog({
buttons: title != 'Featured Lists' ? [
Ox.Button({title: 'Sign Up...'}).bindEvent({
buttons: title != Ox._('Featured Lists') ? [
Ox.Button({title: Ox._('Sign Up...')}).bindEvent({
click: function() {
$dialog.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signup').open();
}
}),
Ox.Button({title: 'Sign In...'}).bindEvent({
Ox.Button({title: Ox._('Sign In...')}).bindEvent({
click: function() {
$dialog.close();
pandora.$ui.accountDialog = pandora.ui.accountDialog('signin').open();
}
}),
{},
Ox.Button({title: 'Not Now'}).bindEvent({
Ox.Button({title: Ox._('Not Now')}).bindEvent({
click: function() {
$dialog.close();
}
})
] : [
Ox.Button({title: 'Close'}).bindEvent({
Ox.Button({title: Ox._('Close')}).bindEvent({
click: function() {
$dialog.close();
}

View file

@ -11,7 +11,7 @@ pandora.ui.helpDialog = function() {
buttons: [
Ox.Button({
id: 'switch',
title: 'API Documentation...'
title: Ox._('API Documentation...')
}).bindEvent({
click: function() {
pandora.UI.set({page: 'api', 'hash.anchor': ''});
@ -20,7 +20,7 @@ pandora.ui.helpDialog = function() {
{},
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
@ -35,7 +35,7 @@ pandora.ui.helpDialog = function() {
minHeight: 256,
minWidth: 544 + 2 * Ox.UI.SCROLLBAR_SIZE,
removeOnClose: true,
title: 'Help',
title: Ox._('Help'),
width: 672 + 2 * Ox.UI.SCROLLBAR_SIZE
})
.bindEvent({
@ -56,19 +56,19 @@ pandora.ui.helpDialog = function() {
strings = Ox.clone(pandora.site, true);
strings.addAnnotationShortcuts = strings.layers.map(function(layer, index) {
return '<tr><td>' + index + '</td><td>Add ' + layer.item.toLowerCase() + '</td></tr>';
return '<tr><td>' + index + '</td><td>' + Ox._('Add {0}', [layer.item.toLowerCase()]) + '</td></tr>';
}).join('\n');
strings.itemName = Ox.map(strings.itemName, function(v) {
return v.toLowerCase();
});
strings.signup = pandora.user.level == 'guest'
? '<a href="/signup">sign up</a>' : 'sign up';
? '<a href="/signup">' + Ox._('sign up') + '</a>' : Ox._('sign up');
$html.html(Ox.formatString(html, strings));
pandora.site.help.forEach(function(section) {
var html = $html.find('#' + section.id).html();
text[section.id] = '<h1><b>' + section.title + '</b></h1>\n' + html;
text[section.id] = '<h1><b>' + Ox._(section.title) + '</b></h1>\n' + html;
});
$list = Ox.TableList({

View file

@ -91,7 +91,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$findButton = Ox.Button({
title: 'Find',
title: Ox._('Find'),
width: 74
})
.css({
@ -124,7 +124,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$browseButton = Ox.Button({
title: 'Browse',
title: Ox._('Browse'),
width: 74
})
.css({
@ -146,7 +146,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$signupButton = Ox.Button({
title: 'Sign Up',
title: Ox._('Sign Up'),
width: 74
})
.css({
@ -165,7 +165,7 @@ pandora.ui.home = function() {
}
}),
$signinButton = Ox.Button({
title: 'Sign In',
title: Ox._('Sign In'),
width: 74
})
.css({
@ -184,7 +184,7 @@ pandora.ui.home = function() {
}
}),
$preferencesButton = Ox.Button({
title: 'Preferences',
title: Ox._('Preferences'),
width: 156
})
.css({
@ -203,7 +203,7 @@ pandora.ui.home = function() {
}
}),
$aboutButton = Ox.Button({
title: 'About ' + pandora.site.site.name,
title: Ox._('About {0}', [pandora.site.site.name]),
width: 156
})
.css({
@ -223,12 +223,10 @@ pandora.ui.home = function() {
})
.appendTo(that),
$text = $('<div>')
.html(
'A Movie Database. \u2620 2007-'
+ Ox.formatDate(new Date(), '%Y')
+ ' 0x2620. All Open Source.'
)
.css({
.html(Ox._(
'A Movie Database. \u2620 2007-{0} 0x2620. All Open Source.',
[Ox.formatDate(new Date(), '%Y')]
)).css({
position: 'absolute',
left: 0,
top: '176px',

View file

@ -135,7 +135,7 @@ pandora.ui.home = function() {
.appendTo($box),
$findButton = Ox.Button({
title: 'Find',
title: Ox._('Find'),
width: 122
})
.css({
@ -169,7 +169,7 @@ pandora.ui.home = function() {
.appendTo($box),
$browseButton = Ox.Button({
title: 'Browse',
title: Ox._('Browse'),
width: 122
})
.css({
@ -192,7 +192,7 @@ pandora.ui.home = function() {
.appendTo($box),
$signupButton = Ox.Button({
title: 'Sign Up',
title: Ox._('Sign Up'),
width: 122
})
.css({
@ -212,7 +212,7 @@ pandora.ui.home = function() {
}),
$signinButton = Ox.Button({
title: 'Sign In',
title: Ox._('Sign In'),
width: 122
})
.css({
@ -232,7 +232,7 @@ pandora.ui.home = function() {
}),
$preferencesButton = Ox.Button({
title: 'Preferences',
title: Ox._('Preferences'),
width: 252
})
.css({
@ -252,7 +252,7 @@ pandora.ui.home = function() {
}),
$aboutButton = Ox.Button({
title: 'About ' + pandora.site.site.name,
title: Ox._('About {0}', [pandora.site.site.name]),
width: 252
})
.css({
@ -336,13 +336,13 @@ pandora.ui.home = function() {
if (items.length) {
$label = Ox.Label({
textAlign: 'center',
title: '<b>Featured ' + (
title: '<b>' + Ox._('Featured ' + (
lists == 1 && texts == 0 ? 'List'
: lists == 0 && texts == 1 ? 'Text'
: texts == 0 ? 'Lists'
: lists == 0 ? 'Texts'
: 'Lists and Texts'
) + '</b>',
)) + '</b>',
width: 512
})
.css({
@ -519,7 +519,7 @@ pandora.ui.home = function() {
.appendTo($featuresContent);
$featureIcon[i] = Ox.Element({
element: '<img>',
tooltip: (lists && texts ? Ox.toTitleCase(item.type) + ': ' : '')
tooltip: (lists && texts ? Ox._(Ox.toTitleCase(item.type)) + ': ' : '')
+ Ox.encodeHTMLEntities(item.name)
})
.attr({
@ -576,7 +576,7 @@ pandora.ui.home = function() {
function getHTML(item) {
return '<b>'
+ (lists && texts ? Ox.toTitleCase(item.type) + ': ' : '')
+ (lists && texts ? Ox._(Ox.toTitleCase(item.type)) + ': ' : '')
+ Ox.encodeHTMLEntities(item.name) + '</b><br><br>'
+ item.description;
}
@ -587,7 +587,7 @@ pandora.ui.home = function() {
}
function getTooltip(item) {
return 'View ' + Ox.toTitleCase(item.type)
return Ox._('View {0}', [Ox._(Ox.toTitleCase(item.type))])
}
function openItem(i) {

View file

@ -91,7 +91,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$findButton = Ox.Button({
title: 'Find',
title: Ox._('Find'),
width: 74
})
.css({
@ -124,7 +124,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$browseButton = Ox.Button({
title: 'Browse',
title: Ox._('Browse'),
width: 74
})
.css({
@ -146,7 +146,7 @@ pandora.ui.home = function() {
})
.appendTo(that),
$signupButton = Ox.Button({
title: 'Sign Up',
title: Ox._('Sign Up'),
width: 74
})
.css({
@ -165,7 +165,7 @@ pandora.ui.home = function() {
}
}),
$signinButton = Ox.Button({
title: 'Sign In',
title: Ox._('Sign In'),
width: 74
})
.css({
@ -184,7 +184,7 @@ pandora.ui.home = function() {
}
}),
$preferencesButton = Ox.Button({
title: 'Preferences',
title: Ox._('Preferences'),
width: 156
})
.css({
@ -203,7 +203,7 @@ pandora.ui.home = function() {
}
}),
$aboutButton = Ox.Button({
title: 'About ' + pandora.site.site.name,
title: Ox._('About {0}', [pandora.site.site.name]),
width: 156
})
.css({
@ -223,12 +223,10 @@ pandora.ui.home = function() {
})
.appendTo(that),
$text = $('<div>')
.html(
'pan.do/ra. \u2620 2007-'
+ Ox.formatDate(new Date(), '%Y')
+ ' 0x2620. All Open Source.'
)
.css({
.html(Ox._(
'pan.do/ra. \u2620 2007-{0} 0x2620. All Open Source.',
[Ox.formatDate(new Date(), '%Y')]
)).css({
position: 'absolute',
left: 0,
top: '176px',

View file

@ -54,7 +54,7 @@ pandora.ui.home = function() {
.appendTo($box),
$logo = Ox.Element({
element: '<img>',
tooltip: 'Enter ' + pandora.site.site.name
tooltip: Ox._('Enter {0}', [pandora.site.site.name])
})
.attr({
id: 'logo',
@ -101,7 +101,7 @@ pandora.ui.home = function() {
})
.appendTo($box),
$findButton = Ox.Button({
title: 'Find',
title: Ox._('Find'),
width: 122
})
.css({
@ -134,7 +134,7 @@ pandora.ui.home = function() {
})
.appendTo($box),
$browseButton = Ox.Button({
title: 'Browse',
title: Ox._('Browse'),
width: 122
})
.css({
@ -156,7 +156,7 @@ pandora.ui.home = function() {
})
.appendTo($box),
$signupButton = Ox.Button({
title: 'Sign Up',
title: Ox._('Sign Up'),
width: 122
})
.css({
@ -175,7 +175,7 @@ pandora.ui.home = function() {
}
}),
$signinButton = Ox.Button({
title: 'Sign In',
title: Ox._('Sign In'),
width: 122
})
.css({
@ -194,7 +194,7 @@ pandora.ui.home = function() {
}
}),
$preferencesButton = Ox.Button({
title: 'Preferences',
title: Ox._('Preferences'),
width: 252
})
.css({
@ -213,7 +213,7 @@ pandora.ui.home = function() {
}
}),
$aboutButton = Ox.Button({
title: 'About ' + pandora.site.site.name,
title: Ox._('About {0}', [pandora.site.site.name]),
width: 252
})
.css({
@ -276,7 +276,7 @@ pandora.ui.home = function() {
if (lists.length) {
$label = Ox.Label({
textAlign: 'center',
title: '<b>Featured List' + (lists.length > 1 ? 's' : '') + '</b>',
title: '<b>' + Ox.formatCount(lists, 'Featured List') + '</b>',
width: 512
})
.css({
@ -313,7 +313,7 @@ pandora.ui.home = function() {
pandora.createLinks($text);
$icon = Ox.Element({
element: '<img>',
tooltip: 'View List'
tooltip: Ox._('View List')
})
.attr({
src: '/list/' + lists[selected].user + ':'

View file

@ -40,11 +40,11 @@ pandora.ui.homePage = function() {
items: [].concat(pandora.site.findKeys.map(function(key) {
return {
id: key.id,
title: 'Find: ' + key.title
title: Ox._('Find: {0}', [Ox._(key.title)])
};
}), [{}, {
id: 'advanced',
title: 'Find: Advanced'
title: Ox._('Find: Advanced')
}]),
overlap: 'right',
width: 112

View file

@ -19,7 +19,7 @@ pandora.ui.idDialog = function(data) {
Ox.Button({
distabled: true,
id: 'switch',
title: 'Update Metadata...'
title: Ox._('Update Metadata...')
})
.bindEvent({
click: function() {
@ -30,7 +30,7 @@ pandora.ui.idDialog = function(data) {
{},
Ox.Button({
id: 'cancel',
title: 'Don\'t Update'
title: Ox._('Don\'t Update')
})
.bindEvent({
click: function() {
@ -40,7 +40,7 @@ pandora.ui.idDialog = function(data) {
Ox.Button({
disabled: true,
id: 'update',
title: 'Update IMDb ID'
title: Ox._('Update IMDb ID')
})
.bindEvent({
click: updateId
@ -53,7 +53,7 @@ pandora.ui.idDialog = function(data) {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
title: 'Update IMDb ID',
title: Ox._('Update IMDb ID'),
width: dialogWidth
})
.bindEvent({
@ -154,7 +154,7 @@ pandora.ui.idDialog = function(data) {
if (checkbox.id != 'none') {
Ox.Button({
title: 'arrowRight',
tooltip: 'View on IMDb',
tooltip: Ox._('View on IMDb'),
type: 'image'
})
.css({
@ -249,4 +249,4 @@ pandora.ui.idDialog = function(data) {
return that;
};
};

View file

@ -18,7 +18,7 @@ pandora.ui.importAnnotations = function(data) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
@ -27,7 +27,7 @@ pandora.ui.importAnnotations = function(data) {
importButton = Ox.Button({
disabled: true,
id: 'import',
title: 'Import'
title: Ox._('Import')
}).bindEvent({
click: function() {
importButton.hide();
@ -43,7 +43,7 @@ pandora.ui.importAnnotations = function(data) {
height: 128,
removeOnClose: true,
width: 368,
title: 'Import Annotations'
title: Ox._('Import Annotations')
})
.bindEvent({
close: function(data) {
@ -55,11 +55,11 @@ pandora.ui.importAnnotations = function(data) {
paddingBottom: '8px'
}).appendTo(content);
setStatus('Please select layer and .srt file')
setStatus(Ox._('Please select layer and .srt file'))
function addAnnotations() {
var annotations, task;
if (srt.length > 0) {
setStatus('Loading...');
setStatus(Ox._('Loading...'));
var annotations = srt.filter(function(data) {
return !Ox.isUndefined(data['in']) && !Ox.isUndefined(data.out) && data.text;
@ -80,21 +80,21 @@ pandora.ui.importAnnotations = function(data) {
}, function(result) {
if (result.data.taskId) {
$status.html('').append(Ox.LoadingScreen({
text: 'Importing ' + srt.length + ' annotations...'
text: Ox._('Importing {0} annotations...', [srt.length])
}));
pandora.wait(result.data.taskId, function(result) {
if(result.data.status == 'SUCCESS') {
setStatus(annotations.length + ' annotations imported.');
setStatus(Ox._('{0} annotations imported.', [annotations.length]));
Ox.Request.clearCache(pandora.user.ui.item);
pandora.$ui.contentPanel.replaceElement(
1, pandora.$ui.item = pandora.ui.item()
);
} else {
setStatus('Importing annotations failed.');
setStatus(Ox._('Importing annotations failed.'));
}
});
} else {
setStatus('Importing annotations failed.');
setStatus(Ox._('Importing annotations failed.'));
}
});
}
@ -120,7 +120,7 @@ pandora.ui.importAnnotations = function(data) {
selectLayer = Ox.Select({
items: layers,
title: 'Select Layer',
title: Ox._('Select Layer'),
})
.css({
margin: '4px 2px 4px 4px'
@ -139,7 +139,7 @@ pandora.ui.importAnnotations = function(data) {
selectFile = Ox.FileButton({
image: 'upload',
lbael: 'File',
title: 'Select SRT...',
title: Ox._('Select SRT...'),
width: 156
})
.css({
@ -158,8 +158,8 @@ pandora.ui.importAnnotations = function(data) {
selectFile.hide();
}
setStatus(
'File contains ' + total + ' annotation'
+ (total == 1 ? '' : 's') + '.'
Ox._('File contains {0} annotation'
+ (total == 1 ? '' : 's') + '.', [total])
);
};
reader.readAsText(data.files[0]);

View file

@ -105,12 +105,9 @@ pandora.ui.info = function() {
return (
pandora.user.ui.item
&& ['timeline', 'player', 'editor'].indexOf(pandora.user.ui.itemView) > -1
) ? 'Go to Position' : (
pandora.user.ui.item ? 'Switch to ' : 'Open in '
) + Ox.getObjectById(
pandora.site.itemViews,
pandora.user.ui.videoView
).title + ' View';
) ? Ox._('Go to Position') : (
Ox._(pandora.user.ui.item ? 'Switch to {0} View' : 'Open in {0} Vew',
[Ox._(Ox.getObjectById(pandora.site.itemViews, pandora.user.ui.videoView).title)]));
},
width: ui.sidebarSize
})
@ -209,7 +206,7 @@ pandora.ui.listInfo = function() {
|| (item.status == 'featured' && canEditFeaturedLists);
if (editable) {
$icon.options({
tooltip: 'Doubleclick to edit icon'
tooltip: Ox._('Doubleclick to edit icon')
}).bindEvent({
doubleclick: editIcon
});
@ -266,7 +263,7 @@ pandora.ui.listInfo = function() {
editable: editable,
height: pandora.user.ui.sidebarSize - 32,
placeholder: editable
? '<div class="OxLight" style="text-align: center">No description</span>'
? '<div class="OxLight" style="text-align: center">' + Ox._('No description') + '</span>'
: '',
tooltip: editable ? pandora.getEditTooltip('description') : '',
type: 'textarea',

View file

@ -55,8 +55,8 @@ pandora.ui.infoView = function(data) {
element: '<img>',
tooltip: canEdit ? (
!ui.showIconBrowser
? 'Doubleclick to edit icon'
: 'Doubleclick to hide icons'
? Ox._('Doubleclick to edit icon')
: Ox._('Doubleclick to hide icons')
) : ''
})
.attr({
@ -189,7 +189,7 @@ pandora.ui.infoView = function(data) {
format: function(value) {
return formatValue(value.split(', '), 'name');
},
placeholder: formatLight('Unknown Director'),
placeholder: formatLight(Ox._('Unknown Director')),
tooltip: isEditable ? pandora.getEditTooltip() : '',
value: data.director ? data.director.join(', ') : ''
})
@ -263,7 +263,7 @@ pandora.ui.infoView = function(data) {
data.alternativeTitles && $('<div>')
.css(css)
.html(
formatKey('Alternative Title' + (data.alternativeTitles.length == 1 ? '' : 's'))
formatKey(Ox.formatCount(data.alternativeTitles, 'Alternative Title'))
+ data.alternativeTitles.map(function(value) {
return value[0] + (
canSeeAllMetadata && Ox.isArray(value[1])
@ -389,7 +389,7 @@ pandora.ui.infoView = function(data) {
data.filmingLocations && $('<div>')
.css(css)
.html(
formatKey('Filming Locations') + data.filmingLocations.map(function(location) {
formatKey(Ox._('Filming Locations')) + data.filmingLocations.map(function(location) {
return '<a href="/map/@' + location + '">' + location + '</a>'
}).join(', ')
)
@ -398,7 +398,7 @@ pandora.ui.infoView = function(data) {
data.releasedate && $('<div>')
.css(css)
.html(
formatKey('Release Date') + Ox.formatDate(data.releasedate, '%A, %B %e, %Y')
formatKey(Ox._('Release Date')) + Ox.formatDate(data.releasedate, '%A, %B %e, %Y')
)
.appendTo($text);
@ -561,7 +561,7 @@ pandora.ui.infoView = function(data) {
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
placeholder: formatLight('No notes'),
placeholder: formatLight(Ox._('No notes')),
tooltip: pandora.getEditTooltip(),
type: 'textarea',
value: data.notes || '',
@ -626,8 +626,8 @@ pandora.ui.infoView = function(data) {
function formatKey(key, isStatistics) {
return isStatistics
? $('<div>').css({marginBottom: '4px', fontWeight: 'bold'})
.html(Ox.toTitleCase(key).replace(' Per ', ' per '))
: '<span style="font-weight: bold">' + Ox.toTitleCase(key) + ':</span> ';
.html(Ox._(Ox.toTitleCase(key).replace(' Per ', ' per ')))
: '<span style="font-weight: bold">' + Ox._(Ox.toTitleCase(key)) + ':</span> ';
}
function formatLight(str) {
@ -763,7 +763,7 @@ pandora.ui.infoView = function(data) {
if (!canEdit) {
Ox.Button({
title: 'Help',
tooltip: 'About Rights',
tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})

View file

@ -279,7 +279,7 @@ pandora.ui.infoView = function(data) {
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
placeholder: formatLight('No Summary'),
placeholder: formatLight(Ox._('No Summary')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data.summary || ''
@ -312,25 +312,25 @@ pandora.ui.infoView = function(data) {
items: [
{
id: 'imdb',
title: 'Update IMDb ID...'
title: Ox._('Update IMDb ID...')
},
{
id: 'metadata',
title: 'Update Metadata...'
title: Ox._('Update Metadata...')
},
{},
{
id: 'upload',
title: 'Upload Video...'
title: Ox._('Upload Video...')
},
{},
{
id: 'delete',
title: 'Delete ' + pandora.site.itemName.singular + '...',
title: Ox._('Delete {0}...', [pandora.site.itemName.singular]),
disabled: !canRemove
}
],
title: 'Edit...',
title: Ox._('Edit...'),
width: 128
})
.css({marginBottom: '4px'})
@ -418,21 +418,20 @@ pandora.ui.infoView = function(data) {
.css({marginBottom: '4px'})
.append(
formatKey('Comments', 'statistics').options({
tooltip: 'Only '
+ Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) {
tooltip: Ox._('Only {0} can see and edit these comments', [
Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) {
return (
i == 0 ? ''
: i < Ox.len(pandora.site.capabilities.canEditMetadata) - 1 ? ', '
: ' and '
: ' ' + Ox._('and') + ' '
) + Ox.toTitleCase(level)
}).join('')
+ ' can see and edit these comments'
}).join('')])
})
)
.append(
Ox.EditableContent({
clickLink: pandora.clickLink,
placeholder: formatLight('No comments'),
placeholder: formatLight(Ox._('No comments')),
tooltip: pandora.getEditTooltip(),
type: 'textarea',
value: data.comments || '',
@ -518,7 +517,7 @@ pandora.ui.infoView = function(data) {
function formatKey(key, mode) {
var item = Ox.getObjectById(pandora.site.itemKeys, key);
key = item ? item.title : key;
key = Ox._(item ? item.title : key);
mode = mode || 'text'
if (key == 'alternativeTitles') {
key = 'alternative title' + (
@ -762,8 +761,8 @@ pandora.ui.infoView = function(data) {
});
if (!canEdit) {
Ox.Button({
title: 'Help',
tooltip: 'About Rights',
title: Ox._('Help'),
tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})
@ -782,7 +781,7 @@ pandora.ui.infoView = function(data) {
['studios', 'names'].forEach(function(key) {
descriptions[key].forEach(function(value) {
if (canEdit || value.description) {
var filmography = key == 'studios' ? 'Films' : 'Filmography',
var filmography = key == 'studios' ? Ox._('Films') : Ox._('Filmography'),
$name = Ox.Element()
.css(css)
.css({marginTop: '12px', fontWeight: 'bold'})
@ -798,25 +797,25 @@ pandora.ui.infoView = function(data) {
$link = $('<span>')
.addClass('OxLink')
.css({fontWeight: 'bold'})
.html('Show ' + filmography)
.html(Ox._('Show {0}', [filmography]))
.one({
click: function() {
$link.removeClass('OxLink')
.html('Loading ' + filmography + '...');
.html(Ox._('Loading {0}...', [filmography]));
getFilmography(
key == 'studios' ? 'productionCompany' : 'name',
value.name,
value.keys,
function($element) {
$link.addClass('OxLink')
.html('Hide ' + filmography)
.html(Ox._('Hide {0}', [filmography]))
.on({
click: function() {
if (Ox.startsWith($link.html(), 'Show')) {
$link.html('Hide ' + filmography);
if (Ox.startsWith($link.html(), Ox._('Show'))) {
$link.html(Ox._('Hide {0}', [filmography]));
$text.show();
} else {
$link.html('Show ' + filmography);
$link.html(Ox._('Show {0}', [filmography]));
$text.hide();
}
}
@ -841,7 +840,7 @@ pandora.ui.infoView = function(data) {
'<img style="max-width: 256px; max-height: 256px; margin: 0 16px 16px 0; float: left;" '
);
},
placeholder: formatLight('No Description'),
placeholder: formatLight(Ox._('No Description')),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: value.description || ''
@ -930,8 +929,8 @@ pandora.ui.infoView = function(data) {
return {
id: i,
title: rightsLevel.name,
disabled: !isCopyrighted && rightsLevel.name == 'Under Copyright'
|| isCopyrighted && rightsLevel.name == 'Out of Copyright'
disabled: !isCopyrighted && rightsLevel.name == Ox._('Under Copyright')
|| isCopyrighted && rightsLevel.name == Ox._('Out of Copyright')
};
}),
width: 128,
@ -1015,7 +1014,7 @@ pandora.ui.infoView = function(data) {
'&nbsp;(<a href="/imdbId=' + data.imdbId + '">'
+ result.data.items + ' '
+ pandora.site.itemName.plural.toLowerCase()
+ '</a> with the same IMDb ID</a>)'
+ '</a>' + Ox._('with the same IMDb ID') + '</a>)'
);
}
});

View file

@ -182,7 +182,7 @@ pandora.ui.infoView = function(data) {
return formatValue(listKeys.indexOf(key) >= 0
? value.split(', ') : value, key);
},
placeholder: formatLight('unknown'),
placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ')
@ -222,7 +222,7 @@ pandora.ui.infoView = function(data) {
format: function(value) {
return formatValue(value.split(', '), 'name');
},
placeholder: formatLight('unknown'),
placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ')
@ -538,8 +538,8 @@ pandora.ui.infoView = function(data) {
});
if (!canEdit) {
Ox.Button({
title: 'Help',
tooltip: 'About Rights',
title: Ox._('Help'),
tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})

View file

@ -193,7 +193,7 @@ pandora.ui.infoView = function(data) {
'<img style="float: left; max-width: 256px; max-height: 256px; margin: 0 16px 16px 0" src='
);
},
placeholder: formatLight(Ox._('No ' + Ox.toTitleCase(key) + ' Description')),
placeholder: formatLight(Ox._('No {0} Description', [Ox._(Ox.toTitleCase(key))])),
tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea',
value: data[key + 'description'] || ''
@ -377,7 +377,7 @@ pandora.ui.infoView = function(data) {
var $rightsLevel = $('<div>');
$('<div>')
.css({marginBottom: '4px'})
.append(formatKey('Rights Level', true))
.append(formatKey(Ox._('Rights Level'), true))
.append($rightsLevel)
.appendTo($right);
renderRightsLevel();

View file

@ -17,7 +17,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
buttons: [
Ox.Button({
id: 'cancel',
title: 'Cancel',
title: Ox._('Cancel'),
width: 64
})
.bindEvent({
@ -27,7 +27,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
}),
Ox.Button({
id: 'insert',
title: 'Insert',
title: Ox._('Insert'),
width: 64
})
.bindEvent({
@ -42,7 +42,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
height: dialogHeight,
keys: {enter: 'insert', escape: 'cancel'},
removeOnClose: true,
title: 'Insert Embed',
title: Ox._('Insert Embed'),
width: dialogWidth
}),
$input = {},
@ -76,8 +76,8 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return getForm(id);
},
tabs: [
{id: 'basic', title: 'Basic', selected: !advanced},
{id: 'advanced', title: 'Advanced', selected: advanced}
{id: 'basic', title: Ox._('Basic'), selected: !advanced},
{id: 'advanced', title: Ox._('Advanced'), selected: advanced}
]
});
} else {
@ -86,9 +86,9 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return $content;
},
tabs: [
{id: 'video', title: 'Video', selected: true},
{id: 'map', title: 'Map', disabled: true},
{id: 'calendar', title: 'Calendar', disabled: true}
{id: 'video', title: Ox._('Video'), selected: true},
{id: 'map', title: Ox._('Map'), disabled: true},
{id: 'calendar', title: Ox._('Calendar'), disabled: true}
]
});
@ -107,7 +107,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.css({padding: '16px', overflowY: 'auto'});
$input.url = Ox.Input({
label: 'URL',
label: Ox._('URL'),
labelWidth: 128,
width: formWidth,
value: url
@ -127,7 +127,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
{id: 'http', title: 'http'},
{id: 'https', title: 'https', disabled: !pandora.site.site.https}
],
label: 'Protocol',
label: Ox._('Protocol'),
labelWidth: 128,
value: pandora.site.site.https ? 'https' : 'http',
width: formWidth
@ -141,8 +141,8 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.site = Ox.SelectInput({
inputWidth: 128,
items: sites.concat([{id: 'other', title: 'Other...'}]),
label: 'Site',
items: sites.concat([{id: 'other', title: Ox._('Other...')}]),
label: Ox._('Site'),
labelWidth: 128,
placeholder: 'example.com',
max: 1,
@ -193,12 +193,12 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.link = Ox.Select({
items: [
{id: 'default', title: 'Default'},
{id: 'player', title: 'Player'},
{id: 'editor', title: 'Editor'},
{id: 'timeline', title: 'Timeline'}
{id: 'default', title: Ox._('Default')},
{id: 'player', title: Ox._('Player')},
{id: 'editor', title: Ox._('Editor')},
{id: 'timeline', title: Ox._('Timeline')}
],
label: 'Link',
label: Ox._('Link'),
labelWidth: 128,
value: 'default',
width: formWidth
@ -211,7 +211,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.position = Ox.Input({
label: 'Position',
label: Ox._('Position'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@ -237,7 +237,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input['in'] = Ox.Input({
label: 'In Point',
label: Ox._('In Point'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@ -265,7 +265,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.out = Ox.Input({
label: 'Out Point',
label: Ox._('Out Point'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@ -293,7 +293,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.annotation = Ox.Input({
label: 'Annotation',
label: Ox._('Annotation'),
labelWidth: 128,
width: formWidth
})
@ -311,7 +311,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
space().appendTo($form);
$input.title = Ox.Input({
label: 'Title',
label: Ox._('Title'),
labelWidth: 128,
width: formWidth
})
@ -323,7 +323,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.showTimeline = Ox.Checkbox({
label: 'Show Large Timeline',
label: Ox._('Show Large Timeline'),
labelWidth: 128,
value: false,
width: formWidth
@ -340,11 +340,11 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.timeline = Ox.Select({
items: [
{id: 'default', title: 'Default'}
{id: 'default', title: Ox._('Default')}
].concat(
pandora.site.timelines
),
label: 'Timeline',
label: Ox._('Timeline'),
labelWidth: 128,
value: 'default',
width: formWidth
@ -357,7 +357,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.showAnnotations = Ox.Checkbox({
label: 'Show Annotations',
label: Ox._('Show Annotations'),
labelWidth: 128,
value: false,
width: formWidth
@ -373,7 +373,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
var $showLayersLabel = Ox.Label({
title: 'Show Layers',
title: Ox._('Show Layers'),
width: formWidth
})
.addClass('advanced')
@ -553,4 +553,4 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return that;
};
};

View file

@ -50,12 +50,12 @@ pandora.ui.item = function() {
Ox.Element()
.css({marginTop: '32px', fontSize: '12px', textAlign: 'center'})
.html(
'Sorry, <i>' + result.data.title
+ '</i> currently doesn\'t have '
Ox._('Sorry, <i>{0}</i>'
+ ' currently doesn\'t have '
+ (['a', 'e', 'i', 'o'].indexOf(
pandora.user.ui.itemView.slice(0, 1)
) > -1 ? 'an': 'a') + ' '
+ pandora.user.ui.itemView + ' view.'
+'{1} view.', [result.data.title, Ox._(pandora.user.ui.itemView)])
)
);

View file

@ -49,7 +49,7 @@ pandora.ui.list = function() {
},
id: 'posterRatio',
resizable: false,
title: 'Icon',
title: Ox._('Icon'),
titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon',
visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1,
width: 16
@ -68,7 +68,7 @@ pandora.ui.list = function() {
operator: pandora.getSortOperator(key.id),
position: position,
removable: !key.columnRequired,
title: key.title,
title: Ox._(key.title),
type: key.type,
visible: position > -1,
width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth

View file

@ -7,15 +7,15 @@ pandora.ui.listDialog = function(section) {
section = section || 'general';
var listData = pandora.getListData(),
tabs = [].concat([
{id: 'general', title: 'General'},
{id: 'icon', title: 'Icon'}
{id: 'general', title: Ox._('General')},
{id: 'icon', title: Ox._('Icon')}
], listData.type == 'smart'
? [{id: 'query', title: 'Query'}]
? [{id: 'query', title: Ox._('Query')}]
: []
),
ui = pandora.user.ui,
width = getWidth(section),
folderItems = ui.section == 'items' ? 'Lists' : Ox.toTitleCase(ui.section),
folderItems = ui.section == 'items' ? Ox._('Lists') : Ox.toTitleCase(ui.section),
folderItem = folderItems.slice(0, -1);
Ox.getObjectById(tabs, section).selected = true;
@ -61,7 +61,7 @@ pandora.ui.listDialog = function(section) {
elements: [
pandora.$ui.findIconItemSelect = Ox.Select({
items: pandora.site.findKeys.map(function(findKey) {
return {id: findKey.id, title: 'Find: ' + findKey.title};
return {id: findKey.id, title: Ox._('Find: {0}', [Ox._(findKey.title)])};
}),
overlap: 'right',
type: 'image'
@ -101,7 +101,7 @@ pandora.ui.listDialog = function(section) {
buttons: [
Ox.Button({
id: 'done',
title: 'Done'
title: Ox._('Done')
})
.bindEvent({
click: function() {
@ -128,7 +128,7 @@ pandora.ui.listDialog = function(section) {
}),
$updateCheckbox = Ox.Checkbox({
title: 'Update Results in the Background',
title: Ox._('Update Results in the Background'),
value: pandora.user.ui.updateAdvancedFindResults
})
.css({float: 'left', margin: '4px'})
@ -236,8 +236,8 @@ pandora.ui.listGeneralPanel = function(listData) {
.appendTo(that)
: Ox.Select({
items: [
{id: 'private', title: 'Private'},
{id: 'public', title: 'Public'}
{id: 'private', title: Ox._('Private')},
{id: 'public', title: Ox._('Public')}
],
label: 'Status',
labelWidth: 80,

View file

@ -9,10 +9,10 @@ pandora.ui.logsDialog = function() {
$findSelect = Ox.Select({
items: [
{id: 'all', title: 'Find: All'},
{id: 'user', title: 'Find: User'},
{id: 'url', title: 'Find: URL'},
{id: 'text', title: 'Find: Text'}
{id: 'all', title: Ox._('Find: All')},
{id: 'user', title: Ox._('Find: User')},
{id: 'url', title: Ox._('Find: URL')},
{id: 'text', title: Ox._('Find: Text')}
],
overlap: 'right',
type: 'image',
@ -55,7 +55,7 @@ pandora.ui.logsDialog = function() {
columns: [
{
id: 'id',
title: 'ID',
title: Ox._('ID'),
visible: false
},
{
@ -64,7 +64,7 @@ pandora.ui.logsDialog = function() {
},
id: 'user',
operator: '+',
title: 'User',
title: Ox._('User'),
visible: true,
width: 72
},
@ -75,7 +75,7 @@ pandora.ui.logsDialog = function() {
},
id: 'created',
operator: '-',
title: 'Date',
title: Ox._('Date'),
visible: true,
width: 144
},
@ -85,7 +85,7 @@ pandora.ui.logsDialog = function() {
},
id: 'url',
operator: '+',
title: 'URL',
title: Ox._('URL'),
visible: true,
width: 320
},
@ -95,7 +95,7 @@ pandora.ui.logsDialog = function() {
},
id: 'text',
operator: '+',
title: 'Text',
title: Ox._('Text'),
visible: true,
width: 640
},
@ -131,7 +131,7 @@ pandora.ui.logsDialog = function() {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -161,7 +161,7 @@ pandora.ui.logsDialog = function() {
buttons: [
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -192,7 +192,7 @@ pandora.ui.logsDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
title: 'Error Logs',
title: Ox._('Error Logs'),
width: width
}),

View file

@ -3,7 +3,6 @@
'use strict';
pandora.ui.mainMenu = function() {
var isGuest = pandora.user.level == 'guest',
ui = pandora.user.ui,
findState = pandora.getFindState(ui.find),
@ -19,154 +18,194 @@ pandora.ui.mainMenu = function() {
[
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [].concat(
[
{ id: 'home', title: 'Home' },
{ id: 'home', title: Ox._('Home') },
{}
],
Ox.clone(pandora.site.sitePages, true),
Ox.clone(pandora.site.sitePages, true).map(function(page) {
page.title = Ox._(page.title);
return page;
}),
[
{},
{ id: 'software', title: 'Software' }
{ id: 'software', title: Ox._('Software') }
]
) },
{ id: 'userMenu', title: 'User', items: [
{ id: 'username', title: 'User: ' + (isGuest ? 'not signed in' : Ox.encodeHTMLEntities(pandora.user.username)), disabled: true },
{ id: 'userMenu', title: Ox._('User'), items: [
{ id: 'username', title: Ox._('User: {0}', [isGuest ? 'not signed in' : Ox.encodeHTMLEntities(pandora.user.username)]), disabled: true },
{},
{ id: 'preferences', title: 'Preferences...', disabled: isGuest, keyboard: 'control ,' },
{ id: 'archives', title: 'Archives...', disabled: /*isGuest*/ true },
{ id: 'preferences', title: Ox._('Preferences...'), disabled: isGuest, keyboard: 'control ,' },
{ id: 'archives', title: Ox._('Archives...'), disabled: /*isGuest*/ true },
{},
{ id: 'signup', title: 'Sign Up...', disabled: !isGuest },
isGuest ? { id: 'signin', title: 'Sign In...' }
: { id: 'signout', title: 'Sign Out...'}
{ id: 'signup', title: Ox._('Sign Up...'), disabled: !isGuest },
isGuest ? { id: 'signin', title: Ox._('Sign In...')}
: { id: 'signout', title: Ox._('Sign Out...')}
] },
getListMenu(),
{ id: 'editMenu', title: 'Edit', items: [
{ id: 'add', title: 'Add ' + pandora.site.itemName.singular, disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] },
{ id: 'upload', title: 'Upload Video...', disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] },
{ id: 'editMenu', title: Ox._('Edit'), items: [
{ id: 'add', title: Ox._('Add {0}', [Ox._(pandora.site.itemName.singular)]), disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] },
{ id: 'upload', title: Ox._('Upload Video...'), disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] },
{},
{ id: 'undo', title: 'Undo', disabled: true, keyboard: 'control z' },
{ id: 'redo', title: 'Redo', disabled: true, keyboard: 'shift control z' },
{ id: 'undo', title: Ox._('Undo'), disabled: true, keyboard: 'control z' },
{ id: 'redo', title: Ox._('Redo'), disabled: true, keyboard: 'shift control z' },
{},
{ id: 'cut', title: 'Cut', disabled: true, keyboard: 'control x' },
{ id: 'copy', title: 'Copy', disabled: true, keyboard: 'control c' },
{ id: 'paste', title: 'Paste', disabled: true, keyboard: 'control v' },
{ id: 'delete', title: 'Delete', disabled: true, keyboard: 'delete' },
{ id: 'cut', title: Ox._('Cut{control_x}', {control_x:''}), disabled: true, keyboard: 'control x' },
{ id: 'copy', title: Ox._('Copy'), disabled: true, keyboard: 'control c' },
{ id: 'paste', title: Ox._('Paste'), disabled: true, keyboard: 'control v' },
{ id: 'delete', title: Ox._('Delete'), disabled: true, keyboard: 'delete' },
{},
{ id: 'selectall', title: 'Select All', disabled: true, keyboard: 'control a' },
{ id: 'selectnone', title: 'Select None', disabled: true, keyboard: 'shift control a' },
{ id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' }
{ id: 'selectall', title: Ox._('Select All'), disabled: true, keyboard: 'control a' },
{ id: 'selectnone', title: Ox._('Select None'), disabled: true, keyboard: 'shift control a' },
{ id: 'invertselection', title: Ox._('Invert Selection'), disabled: true, keyboard: 'alt control a' }
] },
{ id: 'viewMenu', title: 'View', items: [
{ id: 'items', title: 'View ' + pandora.site.itemName.plural, items: [
{ id: 'viewMenu', title: Ox._('View'), items: [
{ id: 'items', title: Ox._('View {0}', [Ox._(pandora.site.itemName.plural)]), items: [
{ group: 'listview', min: 1, max: 1, items: pandora.site.listViews.map(function(view) {
return Ox.extend({
checked: ui.listView == view.id
}, view);
}, view, {
title: Ox._(view.title)
});
}) },
]},
{ id: 'icons', title: 'Icons', items: [].concat([
{ id: 'icons', title: Ox._('Icons'), items: [].concat([
{ group: 'viewicons', min: 1, max: 1, items: ['posters', 'frames'].map(function(icons) {
return {id: icons, title: Ox.toTitleCase(icons), checked: ui.icons == icons};
return {id: icons, title: Ox._(Ox.toTitleCase(icons)), checked: ui.icons == icons};
}) },
{},
], pandora.site.media.importPosters ? [
{ id: 'showsiteposters', title: 'Always Show ' + pandora.site.site.name + ' Poster', checked: ui.showSitePosters },
{ id: 'showsiteposters', title: Ox._('Always Show {0} Poster', [pandora.site.site.name]), checked: ui.showSitePosters },
{}
] : [], [
{ id: 'showreflections', title: 'Show Reflections', checked: true, disabled: true }
{ id: 'showreflections', title: Ox._('Show Reflections'), checked: true, disabled: true }
]
) },
{ id: 'timelines', title: 'Timelines', items: [
{ id: 'timelines', title: Ox._('Timelines'), items: [
{ group: 'viewtimelines', min: 1, max: 1, items: pandora.site.timelines.map(function(mode) {
return {id: mode.id, title: mode.title, checked: ui.videoTimeline == mode.id};
return {id: mode.id, title: Ox._(mode.title), checked: ui.videoTimeline == mode.id};
}) }
]},
{ id: 'columns', title: 'Columns', items: [
{ id: 'loadcolumns', title: 'Load Layout...', disabled: true },
{ id: 'savecolumns', title: 'Save Layout...', disabled: true },
{ id: 'columns', title: Ox._('Columns'), items: [
{ id: 'loadcolumns', title: Ox._('Load Layout...'), disabled: true },
{ id: 'savecolumns', title: Ox._('Save Layout...'), disabled: true },
{},
{ id: 'resetcolumns', title: 'Reset Layout', disabled: true }
{ id: 'resetcolumns', title: Ox._('Reset Layout'), disabled: true }
] },
{},
{ id: 'item', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], items: [
{ id: 'item', title: [
Ox._('Open {0}', [Ox._(pandora.site.itemName.singular)]),
Ox._('Open {0}', [Ox._(pandora.site.itemName.plural)])
], items: [
{ group: 'itemview', min: 1, max: 1, items: pandora.site.itemViews.map(function(view) {
return Ox.extend({
checked: ui.itemView == view.id
}, view);
}) },
] },
{ id: 'clips', title: 'Open Clips', items: [
{ id: 'clips', title: Ox._('Open Clips'), items: [
{ group: 'videoview', min: 1, max: 1, items: ['player', 'editor', 'timeline'].map(function(view) {
return {id: view, title: Ox.toTitleCase(view), checked: ui.videoView == view};
return {id: view, title: Ox._(Ox.toTitleCase(view)), checked: ui.videoView == view};
}) }
] },
{},
{ id: 'filters', title: 'Filters', items: [
{ id: 'filters', title: Ox._('Filters'), items: [
{ group: 'filters', min: 5, max: 5, items: pandora.site.filters.map(function(filter) {
return Ox.extend({
checked: Ox.getIndexById(ui.filters, filter.id) > -1
}, filter);
}, filter, {
title: Ox._(filter.title)
});
}) },
{},
{ id: 'resetfilters', title: 'Reset Filters' }
{ id: 'resetfilters', title: Ox._('Reset Filters') }
] },
{},
{ id: 'showsidebar', title: (ui.showSidebar ? 'Hide' : 'Show') + ' Sidebar', keyboard: 'shift s' },
{ id: 'showinfo', title: (ui.showInfo ? 'Hide' : 'Show') + ' Info', disabled: !ui.showSidebar, keyboard: 'shift i' },
{ id: 'showfilters', title: (ui.showFilters ? 'Hide' : 'Show') + ' Filters', disabled: !!ui.item, keyboard: 'shift f' },
{ id: 'showbrowser', title: (ui.showBrowser ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser', disabled: !ui.item, keyboard: 'shift b' },
{ id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'player', 'editor'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
{ id: 'showtimeline', title: (ui.showTimeline ? 'Hide' : 'Show') + ' Timeline', disabled: !ui.item || ui.itemView != 'player', keyboard: 'shift t' },
{
id: 'showsidebar',
title: Ox._((ui.showSidebar ? 'Hide' : 'Show') + ' Sidebar'),
keyboard: 'shift s' },
{
id: 'showinfo',
title: Ox._((ui.showInfo ? 'Hide' : 'Show') + ' Info'),
disabled: !ui.showSidebar, keyboard: 'shift i' },
{
id: 'showfilters',
title: Ox._((ui.showFilters ? 'Hide' : 'Show') + ' Filters'),
disabled: !!ui.item, keyboard: 'shift f' },
{
id: 'showbrowser',
title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]),
disabled: !ui.item, keyboard: 'shift b' },
{
id: 'showannotations',
title: Ox._((ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations'),
disabled: !ui.item || ['timeline', 'player', 'editor'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
{
id: 'showtimeline',
title: Ox._((ui.showTimeline ? 'Hide' : 'Show') + ' Timeline'),
disabled: !ui.item || ui.itemView != 'player', keyboard: 'shift t' },
{},
{ id: 'togglefullscreen', title: (fullscreenState ? 'Exit' : 'Enter') + ' Fullscreen', disabled: fullscreenState === void 0, keyboard: 'shift alt control f' },
{ id: 'entervideofullscreen', title: 'Enter Video Fullscreen', disabled: !ui.item || ui.itemView != 'player' },
{
id: 'togglefullscreen',
title: Ox._((fullscreenState ? 'Exit' : 'Enter') + ' Fullscreen'),
disabled: fullscreenState === void 0, keyboard: 'shift alt control f' },
{
id: 'entervideofullscreen',
title: Ox._('Enter Video Fullscreen'),
disabled: !ui.item || ui.itemView != 'player' },
{},
{ id: 'theme', title: 'Theme', items: [
{ id: 'theme', title: Ox._('Theme'), items: [
{ group: 'settheme', min: 1, max: 1, items: pandora.site.themes.map(function(theme) {
return {id: theme, title: Ox.Theme.getThemeData(theme).themeName, checked: ui.theme == theme}
}) }
] },
{},
{ id: 'locale', title: Ox._('Language'), items: [
{ group: 'setlocale', min: 1, max: 1, items: Object.keys(Ox.LOCALES).map(function(locale) {
return {id: locale, title: Ox.LOCALES[locale], checked: ui.locale == locale}
}) }
] }
]},
getSortMenu(),
{ id: 'findMenu', title: 'Find', items: [
{ id: 'find', title: 'Find', items: [
{ id: 'findMenu', title: Ox._('Find'), items: [
{ id: 'find', title: Ox._('Find'), items: [
{ group: 'find', min: 0, max: 1, items: pandora.site.findKeys.map(function(key, i) {
return Ox.extend({
checked: key.id == findState.key
}, key);
}) }
] },
{ id: 'advancedfind', title: 'Advanced Find...', keyboard: 'shift control f' },
{ id: 'advancedfind', title: Ox._('Advanced Find...'), keyboard: 'shift control f' },
{},
{ id: 'findsimilar', title: 'Find Similar Clips...', keyboard: 'alt control f', disabled: !pandora.getItemIdAndPosition() }
{ id: 'findsimilar', title: Ox._('Find Similar Clips...'), keyboard: 'alt control f', disabled: !pandora.getItemIdAndPosition() }
] },
{ id: 'dataMenu', title: 'Data', items: [
{ id: 'files', title: 'Manage Files...', disabled: !pandora.site.capabilities.canManageFiles[pandora.user.level] },
{ id: 'dataMenu', title: Ox._('Data'), items: [
{ id: 'files', title: Ox._('Manage Files...'), disabled: !pandora.site.capabilities.canManageFiles[pandora.user.level] },
{},
{ id: 'titles', title: 'Manage Titles...', disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{ id: 'names', title: 'Manage Names...', disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{ id: 'titles', title: Ox._('Manage Titles...'), disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{ id: 'names', title: Ox._('Manage Names...'), disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{},
{ id: 'places', title: 'Manage Places...', disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{ id: 'events', title: 'Manage Events...', disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{ id: 'places', title: Ox._('Manage Places...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{ id: 'events', title: Ox._('Manage Events...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{},
{ id: 'users', title: 'Manage Users...', disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
{ id: 'statistics', title: 'Statistics...', disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }
{ id: 'users', title: Ox._('Manage Users...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
{ id: 'statistics', title: Ox._('Statistics...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }
] },
{ id: 'helpMenu', title: 'Help', items: [
{ id: 'help', title: 'Help...', keyboard: 'control ?' },
{ id: 'api', title: 'API Documentation...' }
{ id: 'helpMenu', title: Ox._('Help'), items: [
{ id: 'help', title: Ox._('Help...'), keyboard: 'control ?' },
{ id: 'api', title: Ox._('API Documentation...') }
] }
],
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
? [
{ id: 'debugMenu', title: 'Debug', items: [
{ id: 'clearcache', title: 'Clear Cache'},
{ id: 'reloadapplication', title: 'Reload Application'},
{ id: 'debugMenu', title: Ox._('Debug'), items: [
{ id: 'clearcache', title: Ox._('Clear Cache')},
{ id: 'reloadapplication', title: Ox._('Reload Application')},
{},
{ id: 'debugmode', title: (pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode' },
{ id: 'eventlogging', title: (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'},
{ id: 'debugmode', title: Ox._((pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode') },
{ id: 'eventlogging', title: Ox._((pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging')},
{},
{ id: 'errorlogs', title: 'View Error Logs...'},
{ id: 'tests', title: 'Run Tests'}
{ id: 'errorlogs', title: Ox._('View Error Logs...')},
{ id: 'tests', title: Ox._('Run Tests')}
] }
]
: []
@ -231,6 +270,11 @@ pandora.ui.mainMenu = function() {
});
filters[index].sort[0].operator = operator;
pandora.UI.set({filters: filters});
} else if (data.id == 'setlocale') {
pandora.UI.set('locale', value);
pandora.setLocale(value, function() {
pandora.$ui.appPanel.reload();
});
} else if (data.id == 'settheme') {
var iframe, src;
Ox.Theme(value);
@ -379,7 +423,7 @@ pandora.ui.mainMenu = function() {
pandora.localStorage('enableEventLogging', true);
}
Ox.Event[pandora.localStorage('enableEventLogging') ? 'bind' : 'unbind'](pandora.logEvent);
that.setItemTitle('eventlogging', (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging');
that.setItemTitle('eventlogging', Ox._((pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'));
} else if (data.id == 'errorlogs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'tests') {
@ -569,23 +613,23 @@ pandora.ui.mainMenu = function() {
]('findsimilar');
},
pandora_showannotations: function(data) {
that.setItemTitle('showannotations', (data.value ? 'Hide' : 'Show') + ' Annotations');
that.setItemTitle('showannotations', Ox._((data.value ? 'Hide' : 'Show') + ' Annotations'));
},
pandora_showbrowser: function(data) {
that.setItemTitle('showbrowser', (data.value ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser');
that.setItemTitle('showbrowser', Ox._((data.value ? 'Hide' : 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]));
},
pandora_showfilters: function(data) {
that.setItemTitle('showfilters', (data.value ? 'Hide' : 'Show') + ' Filters');
that.setItemTitle('showfilters', Ox._((data.value ? 'Hide' : 'Show') + ' Filters'));
},
pandora_showinfo: function(data) {
that.setItemTitle('showinfo', (data.value ? 'Hide' : 'Show') + ' Info');
that.setItemTitle('showinfo', Ox._((data.value ? 'Hide' : 'Show') + ' Info'));
},
pandora_showsidebar: function(data) {
that.setItemTitle('showsidebar', (data.value ? 'Hide' : 'Show') + ' Sidebar');
that.setItemTitle('showsidebar', Ox._((data.value ? 'Hide' : 'Show') + ' Sidebar'));
that[data.value ? 'enableItem' : 'disableItem']('showinfo');
},
pandora_showtimeline: function(data) {
that.setItemTitle('showtimeline', (data.value ? 'Hide' : 'Show') + ' Timeline');
that.setItemTitle('showtimeline', Ox._((data.value ? 'Hide' : 'Show') + ' Timeline'));
},
pandora_videotimeline: function(data) {
that.checkItem('viewMenu_timelines_' + data.value);
@ -593,7 +637,7 @@ pandora.ui.mainMenu = function() {
});
Ox.Fullscreen.bind('change', function(state) {
that.setItemTitle('togglefullscreen', (state ? 'Exit' : 'Enter') + ' Fullscreen');
that.setItemTitle('togglefullscreen', Ox._((state ? 'Exit' : 'Enter') + ' Fullscreen'));
});
function changeFocus(direction) {
@ -648,16 +692,16 @@ pandora.ui.mainMenu = function() {
}
function getListMenu(lists) {
return { id: 'listMenu', title: 'List', items: [].concat(
{ id: 'allitems', title: 'All ' + pandora.site.itemName.plural, checked: !ui.item && !ui._list, keyboard: 'shift control w' },
return { id: 'listMenu', title: Ox._('List'), items: [].concat(
{ id: 'allitems', title: Ox._('All {0}', [Ox._(pandora.site.itemName.plural)]), checked: !ui.item && !ui._list, keyboard: 'shift control w' },
['personal', 'favorite', 'featured'].map(function(folder) {
return {
id: folder + 'lists',
title: Ox.toTitleCase(folder) + ' Lists',
title: Ox._('{0} Lists', [Ox._(Ox.toTitleCase(folder))]),
items: Ox.isUndefined(lists)
? [{id: 'loading', title: 'Loading...', disabled: true}]
? [{id: 'loading', title: Ox._('Loading...'), disabled: true}]
: lists[folder].length == 0
? [{id: 'nolists', title: 'No ' + Ox.toTitleCase(folder) + ' Lists', disabled: true}]
? [{id: 'nolists', title: Ox._('No {0} Lists', [Ox._(Ox.toTitleCase(folder))]), disabled: true}]
: lists[folder].map(function(list) {
return {
id: 'viewlist' + list.id,
@ -671,17 +715,17 @@ pandora.ui.mainMenu = function() {
}),
[
{},
{ id: 'newlist', title: 'New List', disabled: isGuest, keyboard: 'control n' },
{ id: 'newlistfromselection', title: 'New List from Selection', disabled: isGuest || ui.listSelection.length == 0, keyboard: 'shift control n' },
{ id: 'newsmartlist', title: 'New Smart List', disabled: isGuest, keyboard: 'alt control n' },
{ id: 'newsmartlistfromresults', title: 'New Smart List from Results', disabled: isGuest, keyboard: 'shift alt control n' },
{ id: 'newlist', title: Ox._('New List'), disabled: isGuest, keyboard: 'control n' },
{ id: 'newlistfromselection', title: Ox._('New List from Selection'), disabled: isGuest || ui.listSelection.length == 0, keyboard: 'shift control n' },
{ id: 'newsmartlist', title: Ox._('New Smart List'), disabled: isGuest, keyboard: 'alt control n' },
{ id: 'newsmartlistfromresults', title: Ox._('New Smart List from Results'), disabled: isGuest, keyboard: 'shift alt control n' },
{},
{ id: 'duplicatelist', title: 'Duplicate Selected List', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control d' },
{ id: 'editlist', title: 'Edit Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control e' },
{ id: 'deletelist', title: 'Delete Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
{ id: 'duplicatelist', title: Ox._('Duplicate Selected List'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'control d' },
{ id: 'editlist', title: Ox._('Edit Selected List...'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'control e' },
{ id: 'deletelist', title: Ox._('Delete Selected List...'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
{},
{ id: 'print', title: 'Print', keyboard: 'control p' },
{ id: 'tv', title: 'TV', keyboard: 'control space' }
{ id: 'print', title: Ox._('Print'), keyboard: 'control p' },
{ id: 'tv', title: Ox._('TV'), keyboard: 'control space' }
]
)};
};
@ -692,58 +736,68 @@ pandora.ui.mainMenu = function() {
clipItems = (isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
checked: ui.listSort[0].key == key.id,
title: (!ui.item ? 'Clip ' : '') + key.title
title: (!ui.item ? Ox._('Clip') + ' ' : '') + Ox._(key.title)
});
}) : []).concat(!ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend({
checked: ui.listSort[0].key == key.id
}, key);
}) : []);
return { id: 'sortMenu', title: 'Sort', items: [
{ id: 'sortitems', title: 'Sort ' + pandora.site.itemName.plural + ' by', disabled: !ui.item && isClipView, items: [
return { id: 'sortMenu', title: Ox._('Sort'), items: [
{ id: 'sortitems', title: Ox._('Sort {0} by', [Ox._(pandora.site.itemName.plural)]), disabled: !ui.item && isClipView, items: [
{ group: 'itemsort', min: 1, max: 1, items: pandora.site.sortKeys.map(function(key) {
return Ox.extend({
checked: ui.listSort[0].key == key.id
}, key);
}, key, {
title: Ox._(key.title)
});
}) }
] },
{ id: 'orderitems', title: 'Order ' + pandora.site.itemName.plural, disabled: !ui.item && isClipView, items: [
{ id: 'orderitems', title: Ox._('Order {0}', [Ox._(pandora.site.itemName.plural)]), disabled: !ui.item && isClipView, items: [
{ group: 'itemorder', min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
{ id: 'descending', title: 'Descending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
{ id: 'ascending', title: Ox._('Ascending'), checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
{ id: 'descending', title: Ox._('Descending'), checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
]}
] },
{ id: 'sortclips', title: 'Sort Clips by', disabled: !isClipView, items: [
{ id: 'sortclips', title: Ox._('Sort Clips by'), disabled: !isClipView, items: [
{ group: 'clipsort', min: 1, max: 1, items: clipItems }
] },
{ id: 'orderclips', title: 'Order Clips', disabled: !isClipView, items: [
{ id: 'orderclips', title: Ox._('Order Clips'), disabled: !isClipView, items: [
{ group: 'cliporder', min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
{ id: 'descending', title: 'Descending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
{
id: 'ascending',
title: Ox._('Ascending'),
checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+'
},
{
id: 'descending',
title: Ox._('Descending'),
checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-'
}
]}
] },
{ id: 'advancedsort', title: 'Advanced Sort...', keyboard: 'shift control s', disabled: true },
{ id: 'advancedsort', title: Ox._('Advanced Sort...'), keyboard: 'shift control s', disabled: true },
{},
{ id: 'sortfilters', title: 'Sort Filters', items: pandora.user.ui.filters.map(function(filter) {
{ id: 'sortfilters', title: Ox._('Sort Filters'), items: pandora.user.ui.filters.map(function(filter) {
return {
id: 'sortfilter' + filter.id,
title: 'Sort ' + Ox.getObjectById(pandora.site.filters, filter.id).title + ' Filter by',
title: Ox._('Sort {0} Filter by', [Ox._(Ox.getObjectById(pandora.site.filters, filter.id).title)]),
items: [
{ group: 'sortfilter' + filter.id, min: 1, max: 1, items: [
{ id: 'name', title: 'Name', checked: filter.sort[0].key == 'name' },
{ id: 'items', title: 'Items', checked: filter.sort[0].key == 'items' }
{ id: 'name', title: Ox._('Name'), checked: filter.sort[0].key == 'name' },
{ id: 'items', title: Ox._('Items'), checked: filter.sort[0].key == 'items' }
] }
]
}
}) },
{ id: 'orderfilters', title: 'Order Filters', items: pandora.user.ui.filters.map(function(filter) {
{ id: 'orderfilters', title: Ox._('Order Filters'), items: pandora.user.ui.filters.map(function(filter) {
return {
id: 'orderfilter' + filter.id,
title: 'Order ' + Ox.getObjectById(pandora.site.filters, filter.id).title + ' Filter',
title: Ox._('Order {0} Filter', [Ox._(Ox.getObjectById(pandora.site.filters, filter.id).title)]),
items: [
{ group: 'orderfilter' + filter.id, min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', checked: filter.sort[0].operator == '+' },
{ id: 'descending', title: 'Descending', checked: filter.sort[0].operator == '-' }
{ id: 'ascending', title: Ox._('Ascending'), checked: filter.sort[0].operator == '+' },
{ id: 'descending', title: Ox._('Descending'), checked: filter.sort[0].operator == '-' }
] }
]
}

View file

@ -6,7 +6,7 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
buttons: [
Ox.Button({
id: 'keep',
title: 'Keep List Public'
title: Ox._('Keep List Public')
}).bindEvent({
click: function() {
that.close();
@ -15,7 +15,7 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
}),
Ox.Button({
id: 'make',
title: 'Make List Private'
title: Ox._('Make List Private')
}).bindEvent({
click: function() {
that.close();
@ -24,13 +24,11 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
})
],
keys: {enter: 'make', escape: 'keep'},
text: 'Are you sure you want to make the list "'
+ name + '" private and lose its '
+ (subscribers == 1 ? 'subscriber' : subscribers + ' subscribers')
+ '?',
title: 'Make List Private'
text: Ox._('Are you sure you want to make the list "{0}" private and loose its {1}?',
[name, subscribers == 1 ? Ox._('subscriber') : Ox._('{0} subscribers', [subscribers])]),
title: Ox._('Make List Private')
});
return that;
};
};

View file

@ -31,7 +31,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'close',
title: 'Not Now'
title: Ox._('Not Now')
})
.bindEvent({
click: function() {
@ -41,7 +41,7 @@ pandora.ui.metadataDialog = function(data) {
Ox.Button({
distabled: true,
id: 'update',
title: 'Update IMDb Id...'
title: Ox._('Update IMDb ID...')
})
.bindEvent({
click: function() {
@ -51,10 +51,9 @@ pandora.ui.metadataDialog = function(data) {
})
],
keyboard: {enter: 'update', escape: 'close'},
text: 'To update the metadata for this '
+ pandora.site.itemName.singular.toLowerCase()
+ ', please enter its IMDb ID.',
title: 'Update Metadata'
text: Ox._('To update the metadata for this {0}, please enter its IMDb ID.',
[pandora.site.itemName.singular.toLowerCase()]),
title: Ox._('Update Metadata')
});
}
@ -63,7 +62,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'switch',
title: 'Update IMDb Id...'
title: Ox._('Update IMDb ID...')
})
.bindEvent({
click: function() {
@ -74,7 +73,7 @@ pandora.ui.metadataDialog = function(data) {
{},
Ox.Button({
id: 'cancel',
title: 'Don\'t Update'
title: Ox._('Don\'t Update')
})
.bindEvent({
click: function() {
@ -84,7 +83,8 @@ pandora.ui.metadataDialog = function(data) {
Ox.Button({
disabled: true,
id: 'update',
title: 'Update Metadata...'
title: Ox._('Update Metadata...')
})
.bindEvent({
click: function() {
@ -99,7 +99,7 @@ pandora.ui.metadataDialog = function(data) {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
title: 'Update Metadata',
title: Ox._('Update Metadata'),
width: dialogWidth
})
.bindEvent({
@ -112,7 +112,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'cancel',
title: 'Don\'t Update'
title: Ox._('Don\'t Update')
})
.bindEvent({
click: function() {
@ -121,7 +121,7 @@ pandora.ui.metadataDialog = function(data) {
}),
Ox.Button({
id: 'update',
title: 'Update'
title: Ox._('Update')
})
.bindEvent({
click: function() {
@ -132,16 +132,16 @@ pandora.ui.metadataDialog = function(data) {
],
height: 192,
keyboard: {enter: 'update', escape: 'cancel'},
text: 'Are you sure you want to update the value'
text: Ox._('Are you sure you want to update the value'
+ (updateKeys.length == 1 ? '' : 's')
+ ' for ' + updateKeys.map(function(key, index) {
+ ' for {0}?', [updateKeys.map(function(key, index) {
return (
index == 0 ? ''
: index < updateKeys.length - 1 ? ', '
: ' and '
: ' ' + Ox._('and') + ' '
) + getTitle(key)
}).join('') + '?',
title: 'Update Metadata'
}).join('')]),
title: Ox._('Update Metadata')
});
}
@ -175,7 +175,7 @@ pandora.ui.metadataDialog = function(data) {
orientation: 'vertical'
});
$selectNoneButton = Ox.Button({
title: 'Select No Updates',
title: Ox._('Select No Updates'),
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({
@ -185,7 +185,7 @@ pandora.ui.metadataDialog = function(data) {
})
.appendTo($bar),
$selectAllButton = Ox.Button({
title: 'Select All Updates',
title: Ox._('Select All Updates'),
})
.css({float: 'left', margin: '4px 2px 4px 2px'})
.bindEvent({
@ -265,8 +265,10 @@ pandora.ui.metadataDialog = function(data) {
}
function getTitle(key) {
return key == 'alternativeTitles' ? 'Alternative Titles'
: Ox.getObjectById(pandora.site.itemKeys, key).title;
return key == Ox._(
'alternativeTitles' ? 'Alternative Titles'
: Ox.getObjectById(pandora.site.itemKeys, key).title
);
}
function getUpdateKeys() {

View file

@ -34,7 +34,7 @@ pandora.ui.namesDialog = function() {
columns: [
{
id: 'id',
title: 'ID',
title: Ox._('ID'),
visible: false,
width: 0
},
@ -42,7 +42,7 @@ pandora.ui.namesDialog = function() {
id: 'name',
operator: '+',
removable: false,
title: 'Name',
title: Ox._('Name'),
visible: true,
width: 256
},
@ -50,8 +50,8 @@ pandora.ui.namesDialog = function() {
editable: true,
id: 'sortname',
operator: '+',
title: 'Sort Name',
tooltip: 'Edit Sort Name',
title: Ox._('Sort Name'),
tooltip: Ox._('Edit Sort Name'),
visible: true,
width: 256
},
@ -59,7 +59,7 @@ pandora.ui.namesDialog = function() {
id: 'numberofnames',
align: 'right',
operator: '-',
title: 'Names',
title: Ox._('Names'),
visible: true,
width: 64
},
@ -98,7 +98,7 @@ pandora.ui.namesDialog = function() {
$findButton = Ox.Button({
disabled: true,
title: 'Find',
title: Ox._('Find'),
width: 48
}).bindEvent({
click: function() {
@ -118,7 +118,7 @@ pandora.ui.namesDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Manage Titles...'
title: Ox._('Manage Titles...')
}).bindEvent({
click: function() {
that.close();
@ -130,7 +130,7 @@ pandora.ui.namesDialog = function() {
{},
$findButton,
Ox.Button({
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -160,7 +160,7 @@ pandora.ui.namesDialog = function() {
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Names',
title: Ox._('Manage Names'),
width: width
})
.bindEvent({

View file

@ -92,7 +92,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
resizable: true,
resize: listSizes,
size: listSize,
tooltip: 'clips'
tooltip: Ox._('clips')
}
],
orientation: 'horizontal'
@ -206,7 +206,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
function selectItem(data) {
var id = data.id || '';
if (id && id[0] != '_') {
$status.html('Loading...');
$status.html(Ox._('Loading...'));
$list.options({
items: function(data, callback) {
var itemsQuery;

View file

@ -29,7 +29,7 @@ pandora.ui.news = function(width, height) {
function addItem() {
pandora.api.addNews({
title: 'Untitled',
title: Ox._('Untitled'),
date: Ox.formatDate(new Date(), '%Y-%m-%d'),
text: ''
}, function(result) {
@ -136,7 +136,7 @@ pandora.ui.news = function(width, height) {
.css({height: '16px', marginBottom: '8px'})
.append(
Ox.Button({
title: 'Add',
title: Ox._('Add'),
width: 92
})
.css({float: 'left', margin: '0 4px 0 0'})
@ -146,7 +146,7 @@ pandora.ui.news = function(width, height) {
)
.append(
Ox.Button({
title: 'Remove',
title: Ox._('Remove'),
width: 92
})
.css({float: 'left', margin: '0 0 0 4px'})

View file

@ -9,9 +9,9 @@ pandora.ui.onloadDialog = function() {
$input = Ox.Input({
height: dialogHeight - 32,
id: 'onload',
placeholder: '/*\nAny JavaScript you paste here will run on load.\n'
placeholder: Ox._('/*\nAny JavaScript you paste here will run on load.\n'
+ 'If you ever need to manually change or remove it, '
+ 'you can do so by setting localStorage["pandora.onload"] in the console.\n*/',
+ 'you can do so by setting localStorage["pandora.onload"] in the console.\n*/'),
type: 'textarea',
value: localStorage['pandora.onload'] || '',
width: dialogWidth - 32
@ -20,7 +20,7 @@ pandora.ui.onloadDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Clear'
title: Ox._('Clear')
})
.css({margin: '4px 4px 4px 0'})
.bindEvent({
@ -30,7 +30,7 @@ pandora.ui.onloadDialog = function() {
}),
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -45,7 +45,7 @@ pandora.ui.onloadDialog = function() {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
title: 'Run Script on Load',
title: Ox._('Run Script on Load'),
width: dialogWidth
})
.bindEvent({

View file

@ -79,7 +79,7 @@ pandora.ui.placesDialog = function(options) {
buttons: [
Ox.Button({
id: 'manageEvents',
title: 'Manage Events...'
title: Ox._('Manage Events...')
}).bindEvent({
click: function() {
that.close();
@ -91,7 +91,7 @@ pandora.ui.placesDialog = function(options) {
{},
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -107,7 +107,7 @@ pandora.ui.placesDialog = function(options) {
minWidth: 512,
//keys: {enter: 'done', escape: 'done'},
padding: 0,
title: 'Manage Places',
title: Ox._('Manage Places'),
width: width
})
.bindEvent({

View file

@ -3,8 +3,8 @@
pandora.ui.preferencesDialog = function() {
var tabs = [
{id: 'account', title: 'Account', selected: true},
{id: 'advanced', title: 'Advanced'}
{id: 'account', title: Ox._('Account'), selected: true},
{id: 'advanced', title: Ox._('Advanced')}
],
$tabPanel = Ox.TabPanel({
content: function(id) {
@ -28,7 +28,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
disabled: true,
id: 'username',
label: 'Username',
label: Ox._('Username'),
labelWidth: 120,
value: pandora.user.username,
width: 320
@ -36,7 +36,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
autovalidate: /.+/,
id: 'password',
label: 'New Password',
label: Ox._('New Password'),
labelWidth: 120,
type: 'password',
validate: pandora.validateNewPassword,
@ -50,7 +50,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
autovalidate: pandora.autovalidateEmail,
id: 'email',
label: 'E-Mail Address',
label: Ox._('E-Mail Address'),
labelWidth: 120,
validate: pandora.validateNewEmail,
value: pandora.user.email,
@ -67,16 +67,16 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
disabled: true,
id: 'level',
label: 'Level',
label: Ox._('Level'),
labelWidth: 120,
value: Ox.toTitleCase(pandora.user.level),
width: 320
}),
Ox.Checkbox({
id: 'newsletter',
label: 'Newsletter',
label: Ox._('Newsletter'),
labelWidth: 120,
title: pandora.user.newsletter ? 'Subscribed' : 'Unsubscribed',
title: pandora.user.newsletter ? Ox._('Subscribed') : Ox._('Unsubscribed'),
value: pandora.user.newsletter,
width: 320
})
@ -84,7 +84,7 @@ pandora.ui.preferencesDialog = function() {
change: function(data) {
pandora.user.newsletter = data.value;
this.options({
title: pandora.user.newsletter ? 'Subscribed' : 'Unsubscribed'
title: pandora.user.newsletter ? Ox._('Subscribed') : Ox._('Unsubscribed')
});
pandora.api.editPreferences({
newsletter: pandora.user.newsletter
@ -99,7 +99,7 @@ pandora.ui.preferencesDialog = function() {
} else {
$content.append(
Ox.Button({
title: 'Reset UI Settings...',
title: Ox._('Reset UI Settings...'),
width: 160
})
.bindEvent({
@ -111,7 +111,7 @@ pandora.ui.preferencesDialog = function() {
);
$content.append(
Ox.Button({
title: 'Run Script on Load...',
title: Ox._('Run Script on Load...'),
width: 160
})
.bindEvent({
@ -130,7 +130,7 @@ pandora.ui.preferencesDialog = function() {
buttons: [
Ox.Button({
id: 'signout',
title: 'Sign Out...'
title: Ox._('Sign Out...')
}).bindEvent({
click: function() {
pandora.UI.set({page: 'signout'});
@ -139,7 +139,7 @@ pandora.ui.preferencesDialog = function() {
{},
Ox.Button({
id: 'done',
title: 'Done'
title: Ox._('Done')
}).bindEvent({
click: function() {
$dialog.close();
@ -151,7 +151,7 @@ pandora.ui.preferencesDialog = function() {
height: 192,
minHeight: 192,
minWidth: 432,
title: 'Preferences',
title: Ox._('Preferences'),
width: 432
})
.bindEvent({

View file

@ -5,7 +5,7 @@ pandora.ui.publicListsDialog = function() { // fixme: unused
buttons: [
Ox.Button({
id: 'done',
title: 'Done'
title: Ox._('Done')
}).bindEvent({
click: function() {
that.close();
@ -16,7 +16,7 @@ pandora.ui.publicListsDialog = function() { // fixme: unused
height: 320,
keys: {enter: 'close', escape: 'close'},
padding: 0,
title: 'Public Lists',
title: Ox._('Public Lists'),
width: 420
})
.css({

View file

@ -7,7 +7,7 @@ pandora.ui.resetUIDialog = function(data) {
buttons: [
Ox.Button({
id: 'cancel',
title: 'Don\'t Reset'
title: Ox._('Don\'t Reset')
})
.bindEvent({
click: function() {
@ -16,7 +16,7 @@ pandora.ui.resetUIDialog = function(data) {
}),
Ox.Button({
id: 'reset',
title: 'Reset'
title: Ox._('Reset')
}).bindEvent({
click: function() {
that.close();
@ -27,10 +27,10 @@ pandora.ui.resetUIDialog = function(data) {
})
],
keys: {enter: 'reset', escape: 'cancel'},
text: 'Are you sure you want to reset all UI settings?',
title: 'Reset UI Settings'
text: Ox._('Are you sure you want to reset all UI settings?'),
title: Ox._('Reset UI Settings')
});
return that;
};
};

View file

@ -4,8 +4,8 @@ pandora.ui.sectionButtons = function() {
var that = Ox.ButtonGroup({
buttons: [
{id: 'items', title: pandora.site.itemName.plural},
{id: 'edits', title: 'Edits', disabled: true},
{id: 'texts', title: 'Texts', disabled: pandora.user.level != 'admin'}
{id: 'edits', title: Ox._('Edits'), disabled: true},
{id: 'texts', title: Ox._('Texts'), disabled: pandora.user.level != 'admin'}
],
id: 'sectionButtons',
selectable: true,

View file

@ -6,8 +6,8 @@ pandora.ui.sectionSelect = function() {
id: 'sectionSelect',
items: [
{id: 'items', title: pandora.site.itemName.plural},
{id: 'edits', title: 'Edits', disabled: true},
{id: 'texts', title: 'Texts', disabled: true}
{id: 'edits', title: Ox._('Edits'), disabled: true},
{id: 'texts', title: Ox._('Texts'), disabled: true}
],
value: pandora.user.ui.section
}).css({

View file

@ -48,8 +48,8 @@ pandora.ui.sequencesDialog = function() {
$modeButtons = Ox.ButtonGroup({
buttons: [
{id: 'shape', title: 'Similar Shapes'},
{id: 'color', title: 'Similar Colors'}
{id: 'shape', title: Ox._('Similar Shapes')},
{id: 'color', title: Ox._('Similar Colors')}
],
selectable: true,
value: pandora.user.ui.sequenceMode
@ -89,9 +89,12 @@ pandora.ui.sequencesDialog = function() {
$sortSelect = Ox.Select({
items: ['title', 'director', 'position', 'duration'].map(function(id) {
var item = Ox.getObjectById(pandora.site.itemKeys, id)
|| Ox.getObjectById(pandora.site.clipKeys, id),
title = Ox._(item ? item.title : Ox.toTitleCase(id));
return {
id: id,
title: 'Sort by ' + Ox.toTitleCase(id)
title: Ox._('Sort by {0}', [title])
};
}),
value: pandora.user.ui.sequenceSort[0].key,
@ -124,14 +127,14 @@ pandora.ui.sequencesDialog = function() {
Ox.Button({
disabled: true,
id: 'open',
title: 'Open Selected Clip',
title: Ox._('Open Selected Clip'),
width: 128
}).bindEvent({
click: openClip
}),
Ox.Button({
id: 'close',
title: 'Close',
title: Ox._('Close'),
width: 64
}).bindEvent({
click: function() {
@ -146,7 +149,7 @@ pandora.ui.sequencesDialog = function() {
maximizeButton: true,
padding: 0,
removeOnClose: true,
title: 'Similar Clips',
title: Ox._('Similar Clips'),
width: dialogSize.width
})
.bindEvent({
@ -181,7 +184,7 @@ pandora.ui.sequencesDialog = function() {
fontSize: '9px',
textAlign: 'center'
})
.html('Loading...')
.html(Ox._('Loading...'))
.appendTo($statusbar);
getClips();
@ -196,7 +199,7 @@ pandora.ui.sequencesDialog = function() {
function getClips() {
$dialog && $dialog.disableButton('open');
$status && $status.html('Loading...');
$status && $status.html(Ox._('Loading...'));
pandora.api.get({
id: item.id,
keys: ['director', 'duration', 'title', 'videoRatio']

View file

@ -8,7 +8,7 @@ pandora.ui.siteDialog = function(section) {
dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
dialogWidth = Math.round(window.innerWidth * 0.75),
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: 'Software'}]);
tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: Ox._('Software')}]);
Ox.getObjectById(tabs, section).selected = true;
var $tabPanel = Ox.TabPanel({
content: function(id) {
@ -50,7 +50,7 @@ pandora.ui.siteDialog = function(section) {
editable: isEditable,
tooltip: isEditable ? pandora.getEditTooltip() : '',
type: 'textarea',
placeholder: isEditable ? 'Doubleclick to insert text' : '',
placeholder: isEditable ? Ox._('Doubleclick to insert text') : '',
value: result.data.text
})
.css(id == 'rights' ? {
@ -137,7 +137,7 @@ pandora.ui.siteDialog = function(section) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();

View file

@ -8,7 +8,7 @@ pandora.ui.siteDialog = function(section) {
dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
dialogWidth = Math.round(window.innerWidth * 0.75),
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: 'Software'}]);
tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: Ox._('Software')}]);
Ox.getObjectById(tabs, section).selected = true;
var $tabPanel = Ox.TabPanel({
content: function(id) {
@ -50,7 +50,7 @@ pandora.ui.siteDialog = function(section) {
editable: isEditable,
tooltip: isEditable ? pandora.getEditTooltip() : '',
type: 'textarea',
placeholder: isEditable ? 'Doubleclick to insert text' : '',
placeholder: isEditable ? Ox._('Doubleclick to insert text') : '',
value: result.data.text
})
.css({
@ -104,7 +104,7 @@ pandora.ui.siteDialog = function(section) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();

View file

@ -9,13 +9,13 @@ pandora.ui.sortElement = function(isNavigationView) {
items = (
isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
title: 'Sort by ' + (!pandora.user.ui.item ? 'Clip ' : '') + key.title
title: Ox._((!pandora.user.ui.item ? 'Sort by Clip {0}' : 'Sort by {0}'), [Ox._(key.title)])
});
}) : []
).concat(
!pandora.user.ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
title: 'Sort by ' + key.title
title: Ox._('Sort by {0}', [Ox._(key.title)])
});
}) : []
),
@ -62,11 +62,11 @@ pandora.ui.sortElement = function(isNavigationView) {
.bindEvent('pandora_' + sortKey.toLowerCase(), updateElement);
function getButtonTitle() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down';
return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down');
}
function getButtonTooltip() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending';
return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending');
}
function updateElement() {
@ -79,4 +79,4 @@ pandora.ui.sortElement = function(isNavigationView) {
return that;
};
};

View file

@ -12,16 +12,16 @@ pandora.ui.sortMenu = function() {
return Ox.extend(Ox.clone(key), {
checked: key.id == pandora.user.ui.itemSort[0].key,
id: key.id,
title: 'Sort by ' + key.title
title: Ox._('Sort by {0}', [key.title])
});
}),
[
{},
{id: 'ascending', title: 'Ascending', checked: pandora.user.ui.itemSort[0].operator == '+'},
{id: 'descending', title: 'Descending', checked: pandora.user.ui.itemSort[0].operator == '-'}
{id: 'ascending', title: Ox._('Ascending'), checked: pandora.user.ui.itemSort[0].operator == '+'},
{id: 'descending', title: Ox._('Descending'), checked: pandora.user.ui.itemSort[0].operator == '-'}
]
),
tooltip: 'Sort clips',
tooltip: Ox._('Sort clips'),
type: 'image'
})
.css({float: 'left', margin: '2px'})
@ -50,4 +50,4 @@ pandora.ui.sortMenu = function() {
return that;
};
};

View file

@ -36,16 +36,16 @@ pandora.ui.statisticsDialog = function() {
dialogHeight = Math.round((window.innerHeight - 48) * 0.9),
dialogWidth = Math.round(window.innerWidth * 0.9),
tabs = [
{id: 'seen', title: 'First Seen & Last Seen', selected: true},
{id: 'locations', title: 'Locations'},
{id: 'platforms', title: 'Platforms & Browsers'}
{id: 'seen', title: Ox._('First Seen & Last Seen'), selected: true},
{id: 'locations', title: Ox._('Locations')},
{id: 'platforms', title: Ox._('Platforms & Browsers')}
],
$dialog = Ox.Dialog({
buttons: [
Ox.Button({
id: 'manageUsers',
title: 'Manage Users...'
title: Ox._('Manage Users...')
}).bindEvent({
click: function() {
$dialog.close();
@ -55,7 +55,7 @@ pandora.ui.statisticsDialog = function() {
{},
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
$dialog.close();
@ -69,7 +69,7 @@ pandora.ui.statisticsDialog = function() {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
title: 'Statistics',
title: Ox._('Statistics'),
width: dialogWidth
})
.bindEvent({
@ -248,7 +248,7 @@ pandora.ui.statisticsDialog = function() {
});
$guestsCheckbox = Ox.Checkbox({
title: 'Include Guests',
title: Ox._('Include Guests'),
value: false
})
.css({float: 'left', margin: '4px'})

View file

@ -5,11 +5,11 @@
pandora.ui.statusbar = function() {
var $text = {
titleTotal: Ox.Element('<span>').html('Total: '),
titleTotal: Ox.Element('<span>').html(Ox._('Total: ')),
total: Ox.Element('<span>'),
titleSelected: Ox.Element('<span>').html(' &mdash; Selected: '),
titleSelected: Ox.Element('<span>').html(' &mdash; ' + Ox._('Selected: ')),
selected: Ox.Element('<span>'),
loading: Ox.Element('<span>').html('Loading...')
loading: Ox.Element('<span>').html(Ox._('Loading...'))
},
that = Ox.Bar({size: 16})

View file

@ -27,7 +27,7 @@ pandora.ui.textPanel = function() {
$find = Ox.Input({
clear: true,
placeholder: 'Find in Texts',
placeholder: Ox._('Find in Texts'),
value: pandora.user.ui.textFind,
width: 188
})
@ -45,7 +45,7 @@ pandora.ui.textPanel = function() {
$nextButton = Ox.Button({
disabled: embedURLs.length < 2,
title: 'arrowRight',
tooltip: 'Next Clip',
tooltip: Ox._('Next Clip'),
type: 'image'
})
.css({
@ -64,7 +64,7 @@ pandora.ui.textPanel = function() {
$currentButton = Ox.Button({
disabled: embedURLs.length < 1,
title: 'center',
tooltip: 'Current Reference',
tooltip: Ox._('Current Reference'),
type: 'image'
})
.css({
@ -76,7 +76,7 @@ pandora.ui.textPanel = function() {
$previousButton = Ox.Button({
disabled: embedURLs.length < 2,
title: 'arrowLeft',
tooltip: 'Previous Clip',
tooltip: Ox._('Previous Clip'),
type: 'image'
})
.css({
@ -116,11 +116,11 @@ pandora.ui.textPanel = function() {
if (text.type == 'html') {
$editMenu = Ox.MenuButton({
items: [
{id: 'insertHTML', title: 'Insert HTML...'},
{id: 'insertEmbed', title: 'Insert Embed...'}
{id: 'insertHTML', title: Ox._('Insert HTML...')},
{id: 'insertEmbed', title: Ox._('Insert Embed...')}
],
title: 'edit',
tooltip: 'Editing Options',
tooltip: Ox._('Editing Options'),
type: 'image'
})
.css({
@ -140,7 +140,7 @@ pandora.ui.textPanel = function() {
} else {
$uploadButton = Ox.FileButton({
image: 'upload',
tooltip: 'Upload PDF',
tooltip: Ox._('Upload PDF'),
type: 'image'
})
.css({
@ -222,9 +222,9 @@ pandora.ui.textHTML = function(text) {
$title = Ox.Editable({
editable: text.name ? text.editable : false,
height: 32,
placeholder: text.editable ? 'Doubleclick to edit title' : 'Untitled',
placeholder: text.editable ? Ox._('Doubleclick to edit title') : Ox._('Untitled'),
tooltip: text.editable ? pandora.getEditTooltip('title') : '',
value: text.name || pandora.site.site.name + ' Texts',
value: text.name || Ox._('{0} Texts', [pandora.site.site.name]),
width: width
})
.css({
@ -272,7 +272,7 @@ pandora.ui.textHTML = function(text) {
);
},
maxHeight: height - 1,
placeholder: text.editable ? 'Doubleclick to edit text' : '',
placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
tooltip: text.editable ? pandora.getEditTooltip('text') : '',
type: 'textarea',
width: width,

View file

@ -32,14 +32,14 @@ pandora.ui.titlesDialog = function() {
columns: [
{
id: 'id',
title: 'ID',
title: Ox._('ID'),
visible: false
},
{
id: 'title',
operator: '+',
removable: false,
title: 'Title',
title: Ox._('Title'),
visible: true,
width: 256
},
@ -47,7 +47,7 @@ pandora.ui.titlesDialog = function() {
editable: true,
id: 'sorttitle',
operator: '+',
title: 'Sort Title',
title: Ox._('Sort Title'),
visible: true,
width: 256
},
@ -87,7 +87,7 @@ pandora.ui.titlesDialog = function() {
$findButton = Ox.Button({
disabled: true,
title: 'Find',
title: Ox._('Find'),
width: 48
}).bindEvent({
click: function() {
@ -107,7 +107,7 @@ pandora.ui.titlesDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Manage Names...'
title: Ox._('Manage Names...')
}).bindEvent({
click: function() {
that.close();
@ -119,7 +119,7 @@ pandora.ui.titlesDialog = function() {
{},
$findButton,
Ox.Button({
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -149,7 +149,7 @@ pandora.ui.titlesDialog = function() {
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Titles',
title: Ox._('Manage Titles'),
width: width
})
.bindEvent({

View file

@ -72,7 +72,7 @@ pandora.ui.toolbar = function() {
function getListName(listId) {
return '<b>' + (
listId == ''
? 'All ' + pandora.site.itemName.plural
? Ox._('All {0}', [pandora.site.itemName.plural])
: Ox.encodeHTMLEntities(listId.slice(listId.indexOf(':') + 1))
) + '</b>';
}

View file

@ -61,9 +61,9 @@ pandora.ui.tv = function() {
'volume', 'scale', 'timeline', 'position', 'settings'
],
controlsTooltips: {
open: 'Open in ' + Ox.getObjectById(
open: Ox._('Open in {0} View', [Ox._(Ox.getObjectById(
pandora.site.itemViews, pandora.user.ui.videoView
).title + ' View'
).title)])
},
controlsTop: ['close', 'title', 'open'],
duration: result.data.duration,
@ -78,7 +78,7 @@ pandora.ui.tv = function() {
tooltips: true,
timeline: '/' + result.data.item + '/timeline16p.jpg',
title: pandora.site.site.name + ' &mdash; ' + (
list || 'All ' + pandora.site.itemName.plural
list || Ox._('All {0}', [Ox._(pandora.site.itemName.plural)])
) + ' &mdash; '
+ result.data.title
+ (

View file

@ -11,23 +11,23 @@ pandora.ui.uploadDialog = function(data) {
$closeButton,
$content = Ox.Element().css({margin: '16px'}),
$info = $('<div>').css({padding: '4px'})
.html('Please select the video file you want to upload.'),
.html(Ox._('Please select the video file you want to upload.')),
$progress,
$status = $('<div>').css({padding: '4px', paddingTop: '8px'}),
that = Ox.Dialog({
buttons: [
$closeButton = Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).css({
float: 'left'
}).bindEvent({
click: function() {
if ($closeButton.options('title') == 'Cancel') {
if ($closeButton.options('title') == Ox._('Cancel')) {
cancelled = true;
pandora.firefogg && pandora.firefogg.cancel();
pandora.$ui.upload && pandora.$ui.upload.abort();
$closeButton.options('title', 'Close');
$closeButton.options('title', Ox._('Close'));
$actionButton.show();
} else {
that.triggerEvent('close');
@ -36,35 +36,35 @@ pandora.ui.uploadDialog = function(data) {
}),
$actionButton = hasFirefogg ? Ox.Button({
id: 'action',
title: 'Select Video'
title: Ox._('Select Video')
}).bindEvent({
click: function() {
if ($actionButton.options('title') == 'Select Video') {
if ($actionButton.options('title') == Ox._('Select Video')) {
if (selectVideo()) {
$actionButton.options('title', 'Upload');
$actionButton.options('title', Ox._('Upload'));
}
} else if ($actionButton.options('title') == 'Cancel') {
} else if ($actionButton.options('title') == Ox._('Cancel')) {
cancelled = true;
pandora.firefogg && pandora.firefogg.cancel();
pandora.$ui.upload && pandora.$ui.upload.abort();
$actionButton.options('title', 'Select Video');
$actionButton.options('title', Ox._('Select Video'));
$closeButton.show();
} else {
$closeButton.options('title', 'Cancel');
$actionButton.hide().options('title', 'Select Video');
$closeButton.options('title', Ox._('Cancel'));
$actionButton.hide().options('title', Ox._('Select Video'));
encode();
}
}
}) : Ox.FileButton({
id: 'action',
title: 'Select Video',
title: Ox._('Select Video'),
maxFiles: 1,
width: 96
}).bindEvent({
click: function(data) {
if(data.files.length) {
$actionButton.hide();
$closeButton.options('title', 'Cancel');
$closeButton.options('title', Ox._('Cancel'));
upload(data.files[0]);
}
}
@ -74,7 +74,7 @@ pandora.ui.uploadDialog = function(data) {
height: 128,
removeOnClose: true,
width: 368,
title: 'Upload Video',
title: Ox._('Upload Video'),
})
.bindEvent({
close: function(data) {
@ -87,13 +87,12 @@ pandora.ui.uploadDialog = function(data) {
});
if (!pandora.site.itemRequiresVideo && !pandora.user.ui.item) {
$info.html(
'You can only upload a video to an existing '
+ pandora.site.itemName.singular.toLowerCase()
+ '. Please check if an entry for the '
+ pandora.site.itemName.singular.toLowerCase()
+ ' you want to upload exists and create otherwise.'
);
$info.html(Ox._(
'You can only upload a video to an existing {0}.'
+ ' Please check if an entry for the {0}'
+ ' you want to upload exists and create otherwise.',
[pandora.site.itemName.singular.toLowerCase()]
));
$actionButton.hide();
}
$content.append($info);
@ -136,7 +135,7 @@ pandora.ui.uploadDialog = function(data) {
info = JSON.parse(pandora.firefogg.sourceInfo),
item,
oshash = info.oshash;
$info.html('<b>' + filename + '</b><br>encoding...');
$info.html('<b>' + filename + '</b><br>' + Ox._('encoding...'));
resetProgress();
pandora.api.addMedia({
filename: filename,
@ -150,12 +149,12 @@ pandora.ui.uploadDialog = function(data) {
function(result, file) {
result = JSON.parse(result);
if (result.progress != 1) {
$status.html(cancelled ? 'Encoding cancelled.' : 'Encoding failed.');
$status.html(cancelled ? Ox._('Encoding cancelled.') : Ox._('Encoding failed.'));
delete pandora.firefogg;
return;
}
setTimeout(function() {
$info.html('<b>' + filename + '</b><br>uploading...');
$info.html('<b>' + filename + '</b><br>' + Ox._('uploading...'));
uploadStream(item, oshash, file);
});
},
@ -189,7 +188,7 @@ pandora.ui.uploadDialog = function(data) {
delete pandora.firefogg;
that.close();
} else {
$status.html('Upload Failed.');
$status.html(Ox._('Upload Failed.'));
pandora.api.log({
text: data.responseText,
url: '/' + item,
@ -205,7 +204,7 @@ pandora.ui.uploadDialog = function(data) {
function upload(file) {
resetProgress();
$info.html('Uploading ' + file.name);
$info.html(Ox._('Uploading {0}', [file.name]));
Ox.oshash(file, function(oshash) {
pandora.api.addMedia({
filename: file.name,
@ -233,7 +232,7 @@ pandora.ui.uploadDialog = function(data) {
}
that.close();
} else {
$status.html(cancelled ? 'Upload cancelled.' : 'Upload failed.');
$status.html(cancelled ? Ox._('Upload cancelled.') : Ox._('Upload failed.'));
!cancelled && pandora.api.log({
text: data.responseText,
url: '/' + item,
@ -397,8 +396,8 @@ pandora.ui.uploadDialog = function(data) {
$info.html(formatInfo(info));
$status.html(
options.passthrough
? 'Your video will be uploaded directly.'
: 'Your video will be transcoded before upload.'
? Ox._('Your video will be uploaded directly.')
: Ox._('Your video will be transcoded before upload.')
);
} else {
pandora.api.find({

View file

@ -19,7 +19,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
$content = Ox.Element().css({margin: '16px'}),
$text = $('<div>')
.html('Uploading ' + file.name)
.html(Ox._('Uploading {0}', [file.name]))
.appendTo($content),
$progress = Ox.Progressbar({
@ -37,14 +37,14 @@ pandora.ui.uploadFileDialog = function(file, callback) {
buttons: [
Ox.Button({
id: 'close',
title: 'Cancel Upload'
title: Ox._('Cancel Upload')
}).bindEvent({
click: function() {
var title = this.options('title');
$uploadDialog.close();
if (title == 'Cancel Upload') {
if (title == Ox._('Cancel Upload')) {
upload.abort();
} else if (title == 'Done') {
} else if (title == Ox._('Done')) {
callback({
id: id
});
@ -56,7 +56,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
height: 112,
keys: {escape: 'close'},
width: 288,
title: 'Upload File'
title: Ox._('Upload File')
})
.bindEvent({
open: function() {
@ -70,11 +70,11 @@ pandora.ui.uploadFileDialog = function(file, callback) {
.bindEvent({
done: function(data) {
if (data.progress == 1) {
$uploadDialog.options('buttons')[0].options({title: 'Done'});
$uploadDialog.options('buttons')[0].options({title: Ox._('Done')});
Ox.print('SUCCEEDED');
} else {
$message.html('Upload failed.')
$uploadDialog.options('buttons')[0].options({title: 'Close'});
$message.html(Ox._('Upload failed.'))
$uploadDialog.options('buttons')[0].options({title: Ox._('Close')});
Ox.print('FAILED');
}
},
@ -86,7 +86,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
});
if (!Ox.contains(extensions, extension)) {
return errorDialog('Supported file types are GIF, JPG, PNG and PDF.');
return errorDialog(Ox._('Supported file types are GIF, JPG, PNG and PDF.'));
} else {
Ox.oshash(file, function(oshash) {
pandora.api.findFiles({
@ -99,12 +99,9 @@ pandora.ui.uploadFileDialog = function(file, callback) {
sort: [{key: 'name', operator: '+'}]
}, function(result) {
if (result.data.items.length) {
errorDialog(
'The file ' + id + ' already exists' + (
filename == result.data.items[0].id
? ''
: ' as ' + result.data.items[0].id
) + '.'
errorDialog(filename == result.data.items[0].id
? Ox._('The file {0} already exists', [filename])
: Ox._('The file {0} already exists as {1}', [filename, result.data.items[0].id])
).open();
} else {
$uploadDialog.open();
@ -119,7 +116,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -127,7 +124,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
}
})
],
title: 'Upload File',
title: Ox._('Upload File'),
text: text
});
}

View file

@ -15,7 +15,7 @@ pandora.ui.uploadPDFDialog = function(options) {
buttons: [
$closeButton = Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
}).bindEvent({
click: function() {
that.triggerEvent('close');
@ -23,7 +23,7 @@ pandora.ui.uploadPDFDialog = function(options) {
}),
$cancelButton = Ox.Button({
id: 'cancel',
title: 'Cancel',
title: Ox._('Cancel'),
disabled: true
}).bindEvent({
click: function(data) {
@ -39,7 +39,7 @@ pandora.ui.uploadPDFDialog = function(options) {
height: 128,
removeOnClose: true,
width: 368,
title: 'Upload PDF',
title: Ox._('Upload PDF'),
})
.bindEvent({
close: function(data) {

View file

@ -24,7 +24,7 @@ pandora.ui.usersDialog = function() {
$reloadButton = Ox.Button({
disabled: true,
title: 'redo',
tooltip: 'Reload',
tooltip: Ox._('Reload'),
type: 'image'
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
@ -37,7 +37,7 @@ pandora.ui.usersDialog = function() {
}),
$guestsCheckbox = Ox.Checkbox({
title: 'Include Guests',
title: Ox._('Include Guests'),
value: false
})
.css({float: 'left', margin: '4px 2px'})
@ -51,7 +51,7 @@ pandora.ui.usersDialog = function() {
}),
$robotsCheckbox = Ox.Checkbox({
title: 'Include Robots',
title: Ox._('Include Robots'),
value: false
})
.css({float: 'left', margin: '4px 2px'})
@ -62,9 +62,9 @@ pandora.ui.usersDialog = function() {
$findSelect = Ox.Select({
items: [
{id: 'all', title: 'Find: All'},
{id: 'username', title: 'Find: Username'},
{id: 'email', title: 'Find: E-Mail-Address'}
{id: 'all', title: Ox._('Find: All')},
{id: 'username', title: Ox._('Find: Username')},
{id: 'email', title: Ox._('Find: E-Mail-Address')}
],
overlap: 'right',
type: 'image'
@ -113,7 +113,7 @@ pandora.ui.usersDialog = function() {
},
id: 'disabled',
operator: '-',
title: 'Enabled',
title: Ox._('Enabled'),
titleImage: 'check',
visible: true,
width: 16
@ -132,7 +132,7 @@ pandora.ui.usersDialog = function() {
});
},
id: 'newsletter',
title: 'Newsletter',
title: Ox._('Newsletter'),
titleImage: 'mail',
operator: '-',
visible: true,
@ -147,7 +147,7 @@ pandora.ui.usersDialog = function() {
id: 'username',
operator: '+',
removable: false,
title: 'Username',
title: Ox._('Username'),
visible: true,
width: 128
},
@ -159,7 +159,7 @@ pandora.ui.usersDialog = function() {
},
id: 'email',
operator: '+',
title: 'E-Mail Address',
title: Ox._('E-Mail Address'),
visible: true,
width: 192
},
@ -174,7 +174,7 @@ pandora.ui.usersDialog = function() {
},
id: 'level',
operator: '-',
title: 'Level',
title: Ox._('Level'),
type: 'label',
visible: true,
width: 64
@ -198,7 +198,7 @@ pandora.ui.usersDialog = function() {
},
id: 'location',
operator: '+',
title: 'Location',
title: Ox._('Location'),
titleImage: 'flag',
visible: true,
width: 16
@ -233,7 +233,7 @@ pandora.ui.usersDialog = function() {
},
id: 'system',
operator: '+',
title: 'System',
title: Ox._('System'),
titleImage: 'square',
visible: true,
width: 16
@ -264,7 +264,7 @@ pandora.ui.usersDialog = function() {
},
id: 'browser',
operator: '+',
title: 'Browser',
title: Ox._('Browser'),
titleImage: 'circle',
visible: true,
width: 16
@ -276,7 +276,7 @@ pandora.ui.usersDialog = function() {
},
id: 'timesseen',
operator: '-',
title: 'Times Seen',
title: Ox._('Times Seen'),
visible: true,
width: 80
},
@ -287,7 +287,7 @@ pandora.ui.usersDialog = function() {
},
id: 'firstseen',
operator: '-',
title: 'First Seen',
title: Ox._('First Seen'),
visible: true,
width: 144
},
@ -298,7 +298,7 @@ pandora.ui.usersDialog = function() {
},
id: 'lastseen',
operator: '-',
title: 'Last Seen',
title: Ox._('Last Seen'),
visible: true,
width: 144
},
@ -310,14 +310,14 @@ pandora.ui.usersDialog = function() {
},
id: 'numberoflists',
operator: '-',
title: 'Lists',
title: Ox._('Lists'),
visible: true,
width: 64
},
{
id: 'groups',
operator: '+',
title: 'Groups',
title: Ox._('Groups'),
visible: true,
width: 64
},
@ -325,7 +325,7 @@ pandora.ui.usersDialog = function() {
id: 'screensize',
align: 'right',
operator: '-',
title: 'Screen Size',
title: Ox._('Screen Size'),
visible: true,
width: 80
},
@ -333,7 +333,7 @@ pandora.ui.usersDialog = function() {
align: 'right',
id: 'windowsize',
operator: '-',
title: 'Window Size',
title: Ox._('Window Size'),
visible: true,
width: 80
},
@ -341,14 +341,14 @@ pandora.ui.usersDialog = function() {
align: 'right',
id: 'ip',
operator: '+',
title: 'IP Address',
title: Ox._('IP Address'),
visible: true,
width: 128
},
{
id: 'useragent',
operator: '+',
title: 'User Agent',
title: Ox._('User Agent'),
visible: true,
width: 768
}
@ -395,7 +395,7 @@ pandora.ui.usersDialog = function() {
$formLabel = Ox.Label({
textAlign: 'center',
title: 'No user selected',
title: Ox._('No user selected'),
width: 212
})
.css({float: 'left', margin: '4px 2px 4px 4px'}),
@ -406,12 +406,12 @@ pandora.ui.usersDialog = function() {
id: 'edit',
selected: true,
title: 'edit',
tooltip: 'Edit'
tooltip: Ox._('Edit')
},
{
id: 'mail',
title: 'mail',
tooltip: 'Mail'
tooltip: Ox._('Mail')
}
],
selectable: true,
@ -429,7 +429,7 @@ pandora.ui.usersDialog = function() {
$sendButton = Ox.Button({
disabled: true,
id: 'send',
title: 'Send',
title: Ox._('Send'),
width: 64
})
.bindEvent({
@ -488,7 +488,7 @@ pandora.ui.usersDialog = function() {
buttons: [
Ox.Button({
id: 'statistics',
title: 'Statistics...'
title: Ox._('Statistics...')
}).bindEvent({
click: function() {
that.close();
@ -497,7 +497,7 @@ pandora.ui.usersDialog = function() {
}),
{},
Ox.Button({
title: 'Export E-Mail Addresses'
title: Ox._('Export E-Mail Addresses')
})
.css({margin: '4px 4px 4px 0'})
.bindEvent({
@ -511,7 +511,7 @@ pandora.ui.usersDialog = function() {
var $dialog = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -531,7 +531,7 @@ pandora.ui.usersDialog = function() {
}).join(', ')
),
removeOnClose: true,
title: 'E-Mail Addresses'
title: Ox._('E-Mail Addresses')
})
.open();
});
@ -539,7 +539,7 @@ pandora.ui.usersDialog = function() {
}),
Ox.Button({
id: 'done',
title: 'Done',
title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@ -555,7 +555,7 @@ pandora.ui.usersDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
title: 'Manage Users',
title: Ox._('Manage Users'),
width: dialogWidth
})
.bindEvent({
@ -751,8 +751,8 @@ pandora.ui.usersDialog = function() {
Ox.Select({
id: 'include',
items: [
{id: 'users', title: 'All users'},
{id: 'subscribers', title: 'Subscribers only'},
{id: 'users', title: Ox._('All users')},
{id: 'subscribers', title: Ox._('Subscribers only')},
],
label: 'Include',
labelWidth: 80,
@ -788,10 +788,10 @@ pandora.ui.usersDialog = function() {
Ox.MenuButton({
id: 'insert',
items: [
{id: 'username', title: 'Username'},
{id: 'email', title: 'E-Mail address'},
{id: 'username', title: Ox._('Username')},
{id: 'email', title: Ox._('E-Mail address')},
],
title: 'Insert...',
title: Ox._('Insert...'),
width: formWidth - 16
})
.bindEvent({
@ -809,7 +809,7 @@ pandora.ui.usersDialog = function() {
}),
Ox.Checkbox({
id: 'receipt',
title: 'Send a receipt to ' + pandora.user.email,
title: Ox._('Send a receipt to {0}', [pandora.user.email]),
value: false,
width: formWidth - 16
}),
@ -857,7 +857,7 @@ pandora.ui.usersDialog = function() {
}
function sendMail() {
$sendButton.options({title: 'Sending', disabled: true});
$sendButton.options({title: Ox._('Sending'), disabled: true});
pandora.api.mail({
to: getTo(),
subject: getFormItemById('subject').value(),
@ -868,7 +868,7 @@ pandora.ui.usersDialog = function() {
buttons: [
Ox.Button({
id: 'close',
title: 'Close'
title: Ox._('Close')
})
.bindEvent({
click: function() {
@ -878,13 +878,13 @@ pandora.ui.usersDialog = function() {
],
keys: {enter: 'close', escape: 'close'},
text: result.status.code == 200
? 'Your message has been sent.'
: 'Your message could not be sent. Please try again.',
? Ox._('Your message has been sent.')
: Ox._('Your message could not be sent. Please try again.'),
title: result.status.code == 200
? 'Message Sent'
: 'Application Error'
? Ox._('Message Sent')
: Ox._('Application Error')
}).open();
$sendButton.options({title: 'Send', disabled: false});
$sendButton.options({title: Ox._('Send'), disabled: false});
});
}
@ -901,20 +901,20 @@ pandora.ui.usersDialog = function() {
var users = $list.options('selected').map(function(id) {
return $list.value(id);
}),
title = users.length == 0 ? 'No user selected'
title = users.length == 0 ? Ox._('No user selected')
: users.length == 1 ? (
['guest', 'robot'].indexOf(users[0].level) > -1
? Ox.toTitleCase(users[0].level)
: Ox.encodeHTMLEntities(users[0].username)
+ ' &lt;' + users[0].email + '&gt;'
)
: users.length + ' users selected';
: Ox._('{0} users selected', [users.length]);
$formLabel.options({title: title});
}
function setSend() {
getFormItemById('send').options({
disabled: getFormItemById('to').value() == 'No recipients'
disabled: getFormItemById('to').value() == Ox._('No recipients')
|| getFormItemById('subject').value() === ''
|| getFormItemById('message').value() === ''
});
@ -923,7 +923,7 @@ pandora.ui.usersDialog = function() {
function setTo() {
var recipients = getTo().length;
$mailForm.values({
to: (recipients || 'No') + ' recipient' + (recipients == 1 ? '' : 's')
to: (recipients || Ox._('No')) + (recipients == 1 ? Ox._('recipient') : Ox._('recipients'))
});
}

View file

@ -433,33 +433,33 @@ pandora.enableDragAndDrop = function($list, canMove) {
function getTitle() {
var image, text;
if (drag.action == 'move' && drag.source.user != pandora.user.username) {
image = 'symbolClose'
text = 'You can only remove ' + pandora.site.itemName.plural.toLowerCase()
+ '<br/>from your own lists.';
image = 'symbolClose';
text = Ox._('You can only remove {0}<br/>from your own lists.',
[pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.action == 'move' && drag.source.type == 'smart') {
image = 'symbolClose';
text = 'You can\'t remove ' + pandora.site.itemName.plural.toLowerCase()
+ '<br/>from smart lists.';
text = Ox._('You can\'t remove {0}<br/>from smart lists.',
[pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.user != pandora.user.username) {
image = 'symbolClose'
text = 'You can only ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase()
+ '<br/>to your own lists';
image = 'symbolClose';
text = Ox._('You can only {0} {1}<br/>to your own lists',
[drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.type == 'smart') {
image = 'symbolClose'
text = 'You can\'t ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase()
+ '<br/>to smart lists';
image = 'symbolClose';
text = Ox._('You can\'t {0} {1}<br/>to smart lists',
[drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else {
image = drag.action == 'copy' ? 'symbolAdd' : 'symbolRemove';
text = Ox.toTitleCase(drag.action) + ' ' + (
text = Ox._(Ox.toTitleCase(drag.action)) + ' ' + (
Ox.isString(drag.item)
? '"' + drag.item + '"'
: drag.item + ' ' + pandora.site.itemName[
drag.item == 1 ? 'singular' : 'plural'
].toLowerCase()
) + '</br> to ' + (
) + '<br/>' + (
drag.target && !drag.target.selected
? 'the list "' + Ox.encodeHTMLEntities(drag.target.name) + '"'
: (pandora.user.ui._list ? 'another' : 'a') + ' list'
? Ox._('to the list "{0}"', [Ox.encodeHTMLEntities(drag.target.name)])
: Ox._('to ' + (pandora.user.ui._list ? 'another' : 'a') + ' list')
);
}
return $('<div>')
@ -584,14 +584,14 @@ pandora.getClipsQuery = function() {
var parts = [pandora.site.site.name];
if (pandora.user.ui.section == 'items') {
if (!pandora.user.ui.item) {
pandora.user.ui._list && parts.push('List ' + pandora.user.ui._list);
parts.push(Ox.toTitleCase(pandora.user.ui.listView) + ' View');
pandora.user.ui._list && parts.push(Ox._('List {0}', [pandora.user.ui._list]));
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View'));
} else {
parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item);
parts.push(Ox.toTitleCase(pandora.user.ui.itemView) + ' View');
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.itemView) + ' View'));
}
} else if (pandora.user.ui.section == 'texts') {
parts.push(pandora.user.ui.text ? pandora.user.ui.text : 'Texts');
parts.push(pandora.user.ui.text ? pandora.user.ui.text : Ox._('Texts'));
}
return parts.join(' - ');
};
@ -602,7 +602,7 @@ pandora.getEditTooltip = function(title) {
var $target = $(e.target);
return (
$target.is('a') || $target.parents('a').length
? 'Shift+doubleclick to edit' : 'Doubleclick to edit'
? Ox._('Shift+doubleclick to edit') : Ox._('Doubleclick to edit')
) + (title ? ' ' + title : '');
}
};
@ -903,15 +903,15 @@ pandora.getListData = function(list) {
pandora.getPageTitle = function(stateOrURL) {
var pages = [
{id: '', title: ''},
{id: 'api', title: 'API Documentation'},
{id: 'help', title: 'Help'},
{id: 'api', title: Ox._('API Documentation')},
{id: 'help', title: Ox._('Help')},
{id: 'home', title: ''},
{id: 'preferences', title: 'Preferences'},
{id: 'signin', title: 'Sign In'},
{id: 'signout', title: 'Sign Out'},
{id: 'signup', title: 'Sign Up'},
{id: 'software', title: 'Software'},
{id: 'tv', title: 'TV'}
{id: 'preferences', title: Ox._('Preferences')},
{id: 'signin', title: Ox._('Sign In')},
{id: 'signout', title: Ox._('Sign Out')},
{id: 'signup', title: Ox._('Sign Up')},
{id: 'software', title: Ox._('Software')},
{id: 'tv', title: Ox._('TV')}
].concat(pandora.site.sitePages),
page = Ox.getObjectById(
pages,
@ -1046,7 +1046,7 @@ pandora.getStatusText = function(data) {
canSeeFiles = pandora.site.capabilities.canSeeFiles[pandora.user.level],
canSeeSize = pandora.site.capabilities.canSeeSize[pandora.user.level],
itemName = ui.listView == 'clip'
? (data.items == 1 ? 'Clip' : 'Clips')
? (data.items == 1 ? Ox._('Clip') : Ox._('Clips'))
: (pandora.site.itemName[data.items == 1 ? 'singular' : 'plural']),
parts = [];
parts.push(Ox.formatNumber(data.items) + ' '+ itemName);
@ -1057,7 +1057,7 @@ pandora.getStatusText = function(data) {
}
if (canSeeFiles) {
data.files && parts.push(
Ox.formatNumber(data.files) + ' file' + (data.files == 1 ? '' : 's')
Ox.formatCount(data.files, 'file')
);
data.duration && parts.push(Ox.formatDuration(data.duration));
}
@ -1462,9 +1462,17 @@ pandora.selectList = function() {
}
};
pandora.setLocale = function(locale, callback) {
Ox.setLocale(locale, locale && locale != 'en'
? '/static/json/locale.' + locale + '.json'
: void 0, function(result) {
callback(result);
});
}
pandora.beforeunloadWindow = function() {
if (pandora.firefogg)
return "Encoding is currently running\nDo you want to leave this page?";
return Ox._("Encoding is currently running\nDo you want to leave this page?");
//prevent error dialogs on unload
pandora.isUnloading = true;
};

View file

@ -9,7 +9,7 @@ pandora.ui.viewSelect = function() {
items = pandora.site[viewKey + 's'].filter(function(view) {
return view.id != 'data' && view.id != 'files';
}).map(function(view) {
return {id: view.id, title: 'View ' + view.title};
return {id: view.id, title: Ox._('View {0}', [Ox._(view.title)])};
}),
that;
if (
@ -18,8 +18,8 @@ pandora.ui.viewSelect = function() {
) {
items = items.concat([
{},
{id: 'data', title: 'View Data'},
{id: 'files', title: 'View Files'}
{id: 'data', title: Ox._('View Data')},
{id: 'files', title: Ox._('View Files')}
]);
}
that = Ox.Select({

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,2 @@
{
}