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 config.jsonc
./local ./local
./static/js/pandora.min.js.gz ./static/js/pandora.min.js.gz
./static/json/pandora.json.gz ./static/json/*.json.gz
./static/json/locale.??.json
./static/oxjs ./static/oxjs
./static/admin ./static/admin
./data ./data

View file

@ -7,6 +7,7 @@ import sys
import shutil import shutil
import time import time
import thread import thread
from glob import glob
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -192,6 +193,20 @@ def update_static():
shutil.copyfile(site, image) shutil.copyfile(site, image)
else: else:
shutil.copyfile(pandora, image) 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 #download geo data
update_geoip() update_geoip()

View file

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

View file

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

View file

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

View file

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

View file

@ -310,56 +310,55 @@ appPanel
}); });
// set up url controller // set up url controller
pandora.setLocale(pandora.user.ui.locale, function() {
pandora.URL.init().parse(function() { pandora.URL.init().parse(function() {
if (data.browserSupported) {
if (data.browserSupported) { stopAnimation();
stopAnimation(); $('#loadingScreen').remove();
$('#loadingScreen').remove(); } else {
} else { loadBrowserMessage();
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) {}
} }
}
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' resetAndSignin: 'Sign In'
}, },
dialogText = { dialogText = {
signin: 'To sign in to your account, please enter your username and password.', signin: Ox._('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.', signup: Ox._('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.', reset: Ox._('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.' 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 = { dialogTitle = {
signin: 'Sign In', signin: Ox._('Sign In'),
signup: 'Sign Up', signup: Ox._('Sign Up'),
reset: 'Reset Password', reset: Ox._('Reset Password'),
resetAndSignin: 'Reset Password' resetAndSignin: Ox._('Reset Password')
}; };
function button(type) { function button(type) {
if (type == 'cancel') { if (type == 'cancel') {
return Ox.Button({ return Ox.Button({
id: 'cancel' + Ox.toTitleCase(action), id: 'cancel' + Ox.toTitleCase(action),
title: 'Cancel' title: Ox._('Cancel')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
pandora.$ui.accountDialog.close(); pandora.$ui.accountDialog.close();
@ -66,7 +66,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
return Ox.Button({ return Ox.Button({
disabled: true, disabled: true,
id: 'submit' + Ox.toTitleCase(action), id: 'submit' + Ox.toTitleCase(action),
title: buttonTitle[action] title: Ox._(buttonTitle[action])
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
pandora.$ui.accountForm.submit(); pandora.$ui.accountForm.submit();
@ -75,7 +75,7 @@ pandora.ui.accountDialogOptions = function(action, value) {
} else { } else {
return Ox.Button({ return Ox.Button({
id: type, id: type,
title: buttonTitle[type] + '...' title: Ox._(buttonTitle[type] + '...')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
if (['signin', 'signup'].indexOf(type) > -1 && type != pandora.user.ui.page) { 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); pandora.signin(result.data);
} else { } else {
pandora.$ui.accountDialog.enableButtons(); pandora.$ui.accountDialog.enableButtons();
that.setMessages([{id: 'password', message: 'Incorrect password'}]); that.setMessages([{id: 'password', message: Ox._('Incorrect password')}]);
} }
}); });
} else if (action == 'signup') { } else if (action == 'signup') {
@ -176,7 +176,7 @@ pandora.ui.accountForm = function(action, value) {
pandora.$ui.accountDialog.enableButtons(); pandora.$ui.accountDialog.enableButtons();
} else { } else {
pandora.$ui.accountDialog.enableButtons(); 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') { } else if (action == 'resetAndSignin') {
@ -186,7 +186,7 @@ pandora.ui.accountForm = function(action, value) {
pandora.signin(result.data); pandora.signin(result.data);
} else { } else {
pandora.$ui.accountDialog.enableButtons(); 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({ return Ox.Input({
autovalidate: pandora.autovalidateCode, autovalidate: pandora.autovalidateCode,
id: 'code', id: 'code',
label: 'Code', label: Ox._('Code'),
labelWidth: 120, labelWidth: 120,
validate: pandora.validateCode, validate: pandora.validateCode,
width: 320 width: 320
@ -213,7 +213,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
autovalidate: pandora.autovalidateEmail, autovalidate: pandora.autovalidateEmail,
id: 'email', id: 'email',
label: 'E-Mail Address', label: Ox._('E-Mail Address'),
labelWidth: 120, labelWidth: 120,
type: 'email', // fixme: ?? type: 'email', // fixme: ??
validate: pandora.validateUser('email'), validate: pandora.validateUser('email'),
@ -223,7 +223,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
autovalidate: /.+/, autovalidate: /.+/,
id: 'password', id: 'password',
label: 'New Password', label: Ox._('New Password'),
labelWidth: 120, labelWidth: 120,
type: 'password', type: 'password',
validate: pandora.validateNewPassword, validate: pandora.validateNewPassword,
@ -233,7 +233,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
autovalidate: pandora.autovalidateUsername, autovalidate: pandora.autovalidateUsername,
id: 'username', id: 'username',
label: 'Username', label: Ox._('Username'),
labelWidth: 120, labelWidth: 120,
validate: pandora.validateUser('username'), validate: pandora.validateUser('username'),
width: 320 width: 320
@ -242,7 +242,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
disabled: true, disabled: true,
id: 'username', id: 'username',
label: 'Username', label: Ox._('Username'),
labelWidth: 120, labelWidth: 120,
value: value, value: value,
width: 320 width: 320
@ -251,7 +251,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
autovalidate: /.+/, autovalidate: /.+/,
id: 'password', id: 'password',
label: 'Password', label: Ox._('Password'),
labelWidth: 120, labelWidth: 120,
type: 'password', type: 'password',
validate: pandora.validatePassword, validate: pandora.validatePassword,
@ -261,7 +261,7 @@ pandora.ui.accountForm = function(action, value) {
return Ox.Input({ return Ox.Input({
autovalidate: pandora.autovalidateUsername, autovalidate: pandora.autovalidateUsername,
id: 'username', id: 'username',
label: 'Username', label: Ox._('Username'),
labelWidth: 120, labelWidth: 120,
validate: pandora.validateUser('username', true), validate: pandora.validateUser('username', true),
width: 320 width: 320
@ -273,8 +273,8 @@ pandora.ui.accountForm = function(action, value) {
pandora.$ui.usernameOrEmailSelect = Ox.Select({ pandora.$ui.usernameOrEmailSelect = Ox.Select({
id: 'usernameOrEmailSelect', id: 'usernameOrEmailSelect',
items: [ items: [
{id: 'username', title: 'Username'}, {id: 'username', title: Ox._('Username')},
{id: 'email', title: 'E-Mail Address'}, {id: 'email', title: Ox._('E-Mail Address')},
], ],
overlap: 'right', overlap: 'right',
width: 128 width: 128
@ -315,7 +315,7 @@ pandora.ui.accountSignoutDialog = function() {
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'stay', id: 'stay',
title: 'Stay Signed In' title: Ox._('Stay Signed In')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -324,7 +324,7 @@ pandora.ui.accountSignoutDialog = function() {
}), }),
Ox.Button({ Ox.Button({
id: 'signout', id: 'signout',
title: 'Sign Out' title: Ox._('Sign Out')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -350,7 +350,7 @@ pandora.ui.accountSignoutDialog = function() {
height: 128, height: 128,
keys: {enter: 'signout', escape: 'stay'}, keys: {enter: 'signout', escape: 'stay'},
removeOnClose: true, removeOnClose: true,
title: 'Sign Out', title: Ox._('Sign Out'),
width: 304 width: 304
}); });
return that; return that;
@ -361,7 +361,7 @@ pandora.ui.accountWelcomeDialog = function() {
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'preferences', id: 'preferences',
title: 'Preferences...' title: Ox._('Preferences...')
}).bindEvent('click', function() { }).bindEvent('click', function() {
that.close(); that.close();
pandora.$ui.preferencesDialog = pandora.ui.preferencesDialog().open(); pandora.$ui.preferencesDialog = pandora.ui.preferencesDialog().open();
@ -369,7 +369,7 @@ pandora.ui.accountWelcomeDialog = function() {
{}, {},
Ox.Button({ Ox.Button({
id: 'close', id: 'close',
title: 'Close' title: Ox._('Close')
}).bindEvent('click', function() { }).bindEvent('click', function() {
that.close(); that.close();
}) })
@ -392,7 +392,7 @@ pandora.ui.accountWelcomeDialog = function() {
height: 128, height: 128,
keys: {enter: 'close', escape: 'close'}, keys: {enter: 'close', escape: 'close'},
removeOnClose: true, removeOnClose: true,
title: 'Welcome to ' + pandora.site.site.name, title: Ox._('Welcome to {0}', [pandora.site.site.name]),
width: 304 width: 304
}); });
return that; return that;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -55,8 +55,8 @@ pandora.ui.infoView = function(data) {
element: '<img>', element: '<img>',
tooltip: canEdit ? ( tooltip: canEdit ? (
!ui.showIconBrowser !ui.showIconBrowser
? 'Doubleclick to edit icon' ? Ox._('Doubleclick to edit icon')
: 'Doubleclick to hide icons' : Ox._('Doubleclick to hide icons')
) : '' ) : ''
}) })
.attr({ .attr({
@ -189,7 +189,7 @@ pandora.ui.infoView = function(data) {
format: function(value) { format: function(value) {
return formatValue(value.split(', '), 'name'); return formatValue(value.split(', '), 'name');
}, },
placeholder: formatLight('Unknown Director'), placeholder: formatLight(Ox._('Unknown Director')),
tooltip: isEditable ? pandora.getEditTooltip() : '', tooltip: isEditable ? pandora.getEditTooltip() : '',
value: data.director ? data.director.join(', ') : '' value: data.director ? data.director.join(', ') : ''
}) })
@ -263,7 +263,7 @@ pandora.ui.infoView = function(data) {
data.alternativeTitles && $('<div>') data.alternativeTitles && $('<div>')
.css(css) .css(css)
.html( .html(
formatKey('Alternative Title' + (data.alternativeTitles.length == 1 ? '' : 's')) formatKey(Ox.formatCount(data.alternativeTitles, 'Alternative Title'))
+ data.alternativeTitles.map(function(value) { + data.alternativeTitles.map(function(value) {
return value[0] + ( return value[0] + (
canSeeAllMetadata && Ox.isArray(value[1]) canSeeAllMetadata && Ox.isArray(value[1])
@ -389,7 +389,7 @@ pandora.ui.infoView = function(data) {
data.filmingLocations && $('<div>') data.filmingLocations && $('<div>')
.css(css) .css(css)
.html( .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>' return '<a href="/map/@' + location + '">' + location + '</a>'
}).join(', ') }).join(', ')
) )
@ -398,7 +398,7 @@ pandora.ui.infoView = function(data) {
data.releasedate && $('<div>') data.releasedate && $('<div>')
.css(css) .css(css)
.html( .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); .appendTo($text);
@ -561,7 +561,7 @@ pandora.ui.infoView = function(data) {
.append( .append(
Ox.EditableContent({ Ox.EditableContent({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
placeholder: formatLight('No notes'), placeholder: formatLight(Ox._('No notes')),
tooltip: pandora.getEditTooltip(), tooltip: pandora.getEditTooltip(),
type: 'textarea', type: 'textarea',
value: data.notes || '', value: data.notes || '',
@ -626,8 +626,8 @@ pandora.ui.infoView = function(data) {
function formatKey(key, isStatistics) { function formatKey(key, isStatistics) {
return isStatistics return isStatistics
? $('<div>').css({marginBottom: '4px', fontWeight: 'bold'}) ? $('<div>').css({marginBottom: '4px', fontWeight: 'bold'})
.html(Ox.toTitleCase(key).replace(' Per ', ' per ')) .html(Ox._(Ox.toTitleCase(key).replace(' Per ', ' per ')))
: '<span style="font-weight: bold">' + Ox.toTitleCase(key) + ':</span> '; : '<span style="font-weight: bold">' + Ox._(Ox.toTitleCase(key)) + ':</span> ';
} }
function formatLight(str) { function formatLight(str) {
@ -763,7 +763,7 @@ pandora.ui.infoView = function(data) {
if (!canEdit) { if (!canEdit) {
Ox.Button({ Ox.Button({
title: 'Help', title: 'Help',
tooltip: 'About Rights', tooltip: Ox._('About Rights'),
type: 'image' type: 'image'
}) })
.css({marginLeft: '52px'}) .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=' '<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() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea', type: 'textarea',
value: data.summary || '' value: data.summary || ''
@ -312,25 +312,25 @@ pandora.ui.infoView = function(data) {
items: [ items: [
{ {
id: 'imdb', id: 'imdb',
title: 'Update IMDb ID...' title: Ox._('Update IMDb ID...')
}, },
{ {
id: 'metadata', id: 'metadata',
title: 'Update Metadata...' title: Ox._('Update Metadata...')
}, },
{}, {},
{ {
id: 'upload', id: 'upload',
title: 'Upload Video...' title: Ox._('Upload Video...')
}, },
{}, {},
{ {
id: 'delete', id: 'delete',
title: 'Delete ' + pandora.site.itemName.singular + '...', title: Ox._('Delete {0}...', [pandora.site.itemName.singular]),
disabled: !canRemove disabled: !canRemove
} }
], ],
title: 'Edit...', title: Ox._('Edit...'),
width: 128 width: 128
}) })
.css({marginBottom: '4px'}) .css({marginBottom: '4px'})
@ -418,21 +418,20 @@ pandora.ui.infoView = function(data) {
.css({marginBottom: '4px'}) .css({marginBottom: '4px'})
.append( .append(
formatKey('Comments', 'statistics').options({ formatKey('Comments', 'statistics').options({
tooltip: 'Only ' tooltip: Ox._('Only {0} can see and edit these comments', [
+ Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) { Object.keys(pandora.site.capabilities.canEditMetadata).map(function(level, i) {
return ( return (
i == 0 ? '' i == 0 ? ''
: i < Ox.len(pandora.site.capabilities.canEditMetadata) - 1 ? ', ' : i < Ox.len(pandora.site.capabilities.canEditMetadata) - 1 ? ', '
: ' and ' : ' ' + Ox._('and') + ' '
) + Ox.toTitleCase(level) ) + Ox.toTitleCase(level)
}).join('') }).join('')])
+ ' can see and edit these comments'
}) })
) )
.append( .append(
Ox.EditableContent({ Ox.EditableContent({
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
placeholder: formatLight('No comments'), placeholder: formatLight(Ox._('No comments')),
tooltip: pandora.getEditTooltip(), tooltip: pandora.getEditTooltip(),
type: 'textarea', type: 'textarea',
value: data.comments || '', value: data.comments || '',
@ -518,7 +517,7 @@ pandora.ui.infoView = function(data) {
function formatKey(key, mode) { function formatKey(key, mode) {
var item = Ox.getObjectById(pandora.site.itemKeys, key); var item = Ox.getObjectById(pandora.site.itemKeys, key);
key = item ? item.title : key; key = Ox._(item ? item.title : key);
mode = mode || 'text' mode = mode || 'text'
if (key == 'alternativeTitles') { if (key == 'alternativeTitles') {
key = 'alternative title' + ( key = 'alternative title' + (
@ -762,8 +761,8 @@ pandora.ui.infoView = function(data) {
}); });
if (!canEdit) { if (!canEdit) {
Ox.Button({ Ox.Button({
title: 'Help', title: Ox._('Help'),
tooltip: 'About Rights', tooltip: Ox._('About Rights'),
type: 'image' type: 'image'
}) })
.css({marginLeft: '52px'}) .css({marginLeft: '52px'})
@ -782,7 +781,7 @@ pandora.ui.infoView = function(data) {
['studios', 'names'].forEach(function(key) { ['studios', 'names'].forEach(function(key) {
descriptions[key].forEach(function(value) { descriptions[key].forEach(function(value) {
if (canEdit || value.description) { if (canEdit || value.description) {
var filmography = key == 'studios' ? 'Films' : 'Filmography', var filmography = key == 'studios' ? Ox._('Films') : Ox._('Filmography'),
$name = Ox.Element() $name = Ox.Element()
.css(css) .css(css)
.css({marginTop: '12px', fontWeight: 'bold'}) .css({marginTop: '12px', fontWeight: 'bold'})
@ -798,25 +797,25 @@ pandora.ui.infoView = function(data) {
$link = $('<span>') $link = $('<span>')
.addClass('OxLink') .addClass('OxLink')
.css({fontWeight: 'bold'}) .css({fontWeight: 'bold'})
.html('Show ' + filmography) .html(Ox._('Show {0}', [filmography]))
.one({ .one({
click: function() { click: function() {
$link.removeClass('OxLink') $link.removeClass('OxLink')
.html('Loading ' + filmography + '...'); .html(Ox._('Loading {0}...', [filmography]));
getFilmography( getFilmography(
key == 'studios' ? 'productionCompany' : 'name', key == 'studios' ? 'productionCompany' : 'name',
value.name, value.name,
value.keys, value.keys,
function($element) { function($element) {
$link.addClass('OxLink') $link.addClass('OxLink')
.html('Hide ' + filmography) .html(Ox._('Hide {0}', [filmography]))
.on({ .on({
click: function() { click: function() {
if (Ox.startsWith($link.html(), 'Show')) { if (Ox.startsWith($link.html(), Ox._('Show'))) {
$link.html('Hide ' + filmography); $link.html(Ox._('Hide {0}', [filmography]));
$text.show(); $text.show();
} else { } else {
$link.html('Show ' + filmography); $link.html(Ox._('Show {0}', [filmography]));
$text.hide(); $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;" ' '<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() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea', type: 'textarea',
value: value.description || '' value: value.description || ''
@ -930,8 +929,8 @@ pandora.ui.infoView = function(data) {
return { return {
id: i, id: i,
title: rightsLevel.name, title: rightsLevel.name,
disabled: !isCopyrighted && rightsLevel.name == 'Under Copyright' disabled: !isCopyrighted && rightsLevel.name == Ox._('Under Copyright')
|| isCopyrighted && rightsLevel.name == 'Out of Copyright' || isCopyrighted && rightsLevel.name == Ox._('Out of Copyright')
}; };
}), }),
width: 128, width: 128,
@ -1015,7 +1014,7 @@ pandora.ui.infoView = function(data) {
'&nbsp;(<a href="/imdbId=' + data.imdbId + '">' '&nbsp;(<a href="/imdbId=' + data.imdbId + '">'
+ result.data.items + ' ' + result.data.items + ' '
+ pandora.site.itemName.plural.toLowerCase() + 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 return formatValue(listKeys.indexOf(key) >= 0
? value.split(', ') : value, key); ? value.split(', ') : value, key);
}, },
placeholder: formatLight('unknown'), placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(), tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0 value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ') ? (data[key] || []).join(', ')
@ -222,7 +222,7 @@ pandora.ui.infoView = function(data) {
format: function(value) { format: function(value) {
return formatValue(value.split(', '), 'name'); return formatValue(value.split(', '), 'name');
}, },
placeholder: formatLight('unknown'), placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(), tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0 value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ') ? (data[key] || []).join(', ')
@ -538,8 +538,8 @@ pandora.ui.infoView = function(data) {
}); });
if (!canEdit) { if (!canEdit) {
Ox.Button({ Ox.Button({
title: 'Help', title: Ox._('Help'),
tooltip: 'About Rights', tooltip: Ox._('About Rights'),
type: 'image' type: 'image'
}) })
.css({marginLeft: '52px'}) .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=' '<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() : '', tooltip: canEdit ? pandora.getEditTooltip() : '',
type: 'textarea', type: 'textarea',
value: data[key + 'description'] || '' value: data[key + 'description'] || ''
@ -377,7 +377,7 @@ pandora.ui.infoView = function(data) {
var $rightsLevel = $('<div>'); var $rightsLevel = $('<div>');
$('<div>') $('<div>')
.css({marginBottom: '4px'}) .css({marginBottom: '4px'})
.append(formatKey('Rights Level', true)) .append(formatKey(Ox._('Rights Level'), true))
.append($rightsLevel) .append($rightsLevel)
.appendTo($right); .appendTo($right);
renderRightsLevel(); renderRightsLevel();

View file

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

View file

@ -50,12 +50,12 @@ pandora.ui.item = function() {
Ox.Element() Ox.Element()
.css({marginTop: '32px', fontSize: '12px', textAlign: 'center'}) .css({marginTop: '32px', fontSize: '12px', textAlign: 'center'})
.html( .html(
'Sorry, <i>' + result.data.title Ox._('Sorry, <i>{0}</i>'
+ '</i> currently doesn\'t have ' + ' currently doesn\'t have '
+ (['a', 'e', 'i', 'o'].indexOf( + (['a', 'e', 'i', 'o'].indexOf(
pandora.user.ui.itemView.slice(0, 1) pandora.user.ui.itemView.slice(0, 1)
) > -1 ? 'an': 'a') + ' ' ) > -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', id: 'posterRatio',
resizable: false, resizable: false,
title: 'Icon', title: Ox._('Icon'),
titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon', titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon',
visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1, visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1,
width: 16 width: 16
@ -68,7 +68,7 @@ pandora.ui.list = function() {
operator: pandora.getSortOperator(key.id), operator: pandora.getSortOperator(key.id),
position: position, position: position,
removable: !key.columnRequired, removable: !key.columnRequired,
title: key.title, title: Ox._(key.title),
type: key.type, type: key.type,
visible: position > -1, visible: position > -1,
width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth

View file

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

View file

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

View file

@ -3,7 +3,6 @@
'use strict'; 'use strict';
pandora.ui.mainMenu = function() { pandora.ui.mainMenu = function() {
var isGuest = pandora.user.level == 'guest', var isGuest = pandora.user.level == 'guest',
ui = pandora.user.ui, ui = pandora.user.ui,
findState = pandora.getFindState(ui.find), 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: 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: 'userMenu', title: Ox._('User'), items: [
{ id: 'username', title: 'User: ' + (isGuest ? 'not signed in' : Ox.encodeHTMLEntities(pandora.user.username)), disabled: true }, { 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: 'preferences', title: Ox._('Preferences...'), disabled: isGuest, keyboard: 'control ,' },
{ id: 'archives', title: 'Archives...', disabled: /*isGuest*/ true }, { id: 'archives', title: Ox._('Archives...'), disabled: /*isGuest*/ true },
{}, {},
{ id: 'signup', title: 'Sign Up...', disabled: !isGuest }, { id: 'signup', title: Ox._('Sign Up...'), disabled: !isGuest },
isGuest ? { id: 'signin', title: 'Sign In...' } isGuest ? { id: 'signin', title: Ox._('Sign In...')}
: { id: 'signout', title: 'Sign Out...'} : { id: 'signout', title: Ox._('Sign Out...')}
] }, ] },
getListMenu(), getListMenu(),
{ id: 'editMenu', title: 'Edit', items: [ { id: 'editMenu', title: Ox._('Edit'), items: [
{ id: 'add', title: 'Add ' + pandora.site.itemName.singular, disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] }, { 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: 'Upload Video...', disabled: !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: 'undo', title: Ox._('Undo'), disabled: true, keyboard: 'control z' },
{ id: 'redo', title: 'Redo', disabled: true, keyboard: 'shift control z' }, { id: 'redo', title: Ox._('Redo'), disabled: true, keyboard: 'shift control z' },
{}, {},
{ id: 'cut', title: 'Cut', disabled: true, keyboard: 'control x' }, { id: 'cut', title: Ox._('Cut{control_x}', {control_x:''}), disabled: true, keyboard: 'control x' },
{ id: 'copy', title: 'Copy', disabled: true, keyboard: 'control c' }, { id: 'copy', title: Ox._('Copy'), disabled: true, keyboard: 'control c' },
{ id: 'paste', title: 'Paste', disabled: true, keyboard: 'control v' }, { id: 'paste', title: Ox._('Paste'), disabled: true, keyboard: 'control v' },
{ id: 'delete', title: 'Delete', disabled: true, keyboard: 'delete' }, { id: 'delete', title: Ox._('Delete'), disabled: true, keyboard: 'delete' },
{}, {},
{ id: 'selectall', title: 'Select All', disabled: true, keyboard: 'control a' }, { id: 'selectall', title: Ox._('Select All'), disabled: true, keyboard: 'control a' },
{ id: 'selectnone', title: 'Select None', disabled: true, keyboard: 'shift control a' }, { id: 'selectnone', title: Ox._('Select None'), disabled: true, keyboard: 'shift control a' },
{ id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' } { id: 'invertselection', title: Ox._('Invert Selection'), disabled: true, keyboard: 'alt control a' }
] }, ] },
{ id: 'viewMenu', title: 'View', items: [ { id: 'viewMenu', title: Ox._('View'), items: [
{ id: 'items', title: 'View ' + pandora.site.itemName.plural, 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) { { group: 'listview', min: 1, max: 1, items: pandora.site.listViews.map(function(view) {
return Ox.extend({ return Ox.extend({
checked: ui.listView == view.id 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) { { 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 ? [ ], 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) { { 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: 'columns', title: Ox._('Columns'), items: [
{ id: 'loadcolumns', title: 'Load Layout...', disabled: true }, { id: 'loadcolumns', title: Ox._('Load Layout...'), disabled: true },
{ id: 'savecolumns', title: 'Save 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) { { group: 'itemview', min: 1, max: 1, items: pandora.site.itemViews.map(function(view) {
return Ox.extend({ return Ox.extend({
checked: ui.itemView == view.id checked: ui.itemView == view.id
}, view); }, 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) { { 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) { { group: 'filters', min: 5, max: 5, items: pandora.site.filters.map(function(filter) {
return Ox.extend({ return Ox.extend({
checked: Ox.getIndexById(ui.filters, filter.id) > -1 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: 'showsidebar',
{ id: 'showfilters', title: (ui.showFilters ? 'Hide' : 'Show') + ' Filters', disabled: !!ui.item, keyboard: 'shift f' }, title: Ox._((ui.showSidebar ? 'Hide' : 'Show') + ' Sidebar'),
{ id: 'showbrowser', title: (ui.showBrowser ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser', disabled: !ui.item, keyboard: 'shift b' }, keyboard: 'shift s' },
{ 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: '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) { { 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} 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(), getSortMenu(),
{ id: 'findMenu', title: 'Find', items: [ { id: 'findMenu', title: Ox._('Find'), items: [
{ id: 'find', title: 'Find', items: [ { id: 'find', title: Ox._('Find'), items: [
{ group: 'find', min: 0, max: 1, items: pandora.site.findKeys.map(function(key, i) { { group: 'find', min: 0, max: 1, items: pandora.site.findKeys.map(function(key, i) {
return Ox.extend({ return Ox.extend({
checked: key.id == findState.key checked: key.id == findState.key
}, 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: 'dataMenu', title: Ox._('Data'), items: [
{ id: 'files', title: 'Manage Files...', disabled: !pandora.site.capabilities.canManageFiles[pandora.user.level] }, { 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: 'titles', title: Ox._('Manage Titles...'), disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{ id: 'names', title: 'Manage Names...', 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: 'places', title: Ox._('Manage Places...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{ id: 'events', title: 'Manage Events...', 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: 'users', title: Ox._('Manage Users...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
{ id: 'statistics', title: 'Statistics...', 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: 'helpMenu', title: Ox._('Help'), items: [
{ id: 'help', title: 'Help...', keyboard: 'control ?' }, { id: 'help', title: Ox._('Help...'), keyboard: 'control ?' },
{ id: 'api', title: 'API Documentation...' } { id: 'api', title: Ox._('API Documentation...') }
] } ] }
], ],
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level] pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
? [ ? [
{ id: 'debugMenu', title: 'Debug', items: [ { id: 'debugMenu', title: Ox._('Debug'), items: [
{ id: 'clearcache', title: 'Clear Cache'}, { id: 'clearcache', title: Ox._('Clear Cache')},
{ id: 'reloadapplication', title: 'Reload Application'}, { id: 'reloadapplication', title: Ox._('Reload Application')},
{}, {},
{ id: 'debugmode', title: (pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode' }, { id: 'debugmode', title: Ox._((pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode') },
{ id: 'eventlogging', title: (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'}, { id: 'eventlogging', title: Ox._((pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging')},
{}, {},
{ id: 'errorlogs', title: 'View Error Logs...'}, { id: 'errorlogs', title: Ox._('View Error Logs...')},
{ id: 'tests', title: 'Run Tests'} { id: 'tests', title: Ox._('Run Tests')}
] } ] }
] ]
: [] : []
@ -231,6 +270,11 @@ pandora.ui.mainMenu = function() {
}); });
filters[index].sort[0].operator = operator; filters[index].sort[0].operator = operator;
pandora.UI.set({filters: filters}); 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') { } else if (data.id == 'settheme') {
var iframe, src; var iframe, src;
Ox.Theme(value); Ox.Theme(value);
@ -379,7 +423,7 @@ pandora.ui.mainMenu = function() {
pandora.localStorage('enableEventLogging', true); pandora.localStorage('enableEventLogging', true);
} }
Ox.Event[pandora.localStorage('enableEventLogging') ? 'bind' : 'unbind'](pandora.logEvent); 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') { } else if (data.id == 'errorlogs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open(); pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'tests') { } else if (data.id == 'tests') {
@ -569,23 +613,23 @@ pandora.ui.mainMenu = function() {
]('findsimilar'); ]('findsimilar');
}, },
pandora_showannotations: function(data) { 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) { 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) { 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) { 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) { 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'); that[data.value ? 'enableItem' : 'disableItem']('showinfo');
}, },
pandora_showtimeline: function(data) { 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) { pandora_videotimeline: function(data) {
that.checkItem('viewMenu_timelines_' + data.value); that.checkItem('viewMenu_timelines_' + data.value);
@ -593,7 +637,7 @@ pandora.ui.mainMenu = function() {
}); });
Ox.Fullscreen.bind('change', function(state) { Ox.Fullscreen.bind('change', function(state) {
that.setItemTitle('togglefullscreen', (state ? 'Exit' : 'Enter') + ' Fullscreen'); that.setItemTitle('togglefullscreen', Ox._((state ? 'Exit' : 'Enter') + ' Fullscreen'));
}); });
function changeFocus(direction) { function changeFocus(direction) {
@ -648,16 +692,16 @@ pandora.ui.mainMenu = function() {
} }
function getListMenu(lists) { function getListMenu(lists) {
return { id: 'listMenu', title: 'List', items: [].concat( return { id: 'listMenu', title: Ox._('List'), items: [].concat(
{ id: 'allitems', title: 'All ' + pandora.site.itemName.plural, checked: !ui.item && !ui._list, keyboard: 'shift control w' }, { 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) { ['personal', 'favorite', 'featured'].map(function(folder) {
return { return {
id: folder + 'lists', id: folder + 'lists',
title: Ox.toTitleCase(folder) + ' Lists', title: Ox._('{0} Lists', [Ox._(Ox.toTitleCase(folder))]),
items: Ox.isUndefined(lists) items: Ox.isUndefined(lists)
? [{id: 'loading', title: 'Loading...', disabled: true}] ? [{id: 'loading', title: Ox._('Loading...'), disabled: true}]
: lists[folder].length == 0 : 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) { : lists[folder].map(function(list) {
return { return {
id: 'viewlist' + list.id, id: 'viewlist' + list.id,
@ -671,17 +715,17 @@ pandora.ui.mainMenu = function() {
}), }),
[ [
{}, {},
{ id: 'newlist', title: 'New List', disabled: isGuest, keyboard: 'control n' }, { id: 'newlist', title: Ox._('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: 'newlistfromselection', title: Ox._('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: 'newsmartlist', title: Ox._('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: '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: 'duplicatelist', title: Ox._('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: 'editlist', title: Ox._('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: 'deletelist', title: Ox._('Delete Selected List...'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
{}, {},
{ id: 'print', title: 'Print', keyboard: 'control p' }, { id: 'print', title: Ox._('Print'), keyboard: 'control p' },
{ id: 'tv', title: 'TV', keyboard: 'control space' } { id: 'tv', title: Ox._('TV'), keyboard: 'control space' }
] ]
)}; )};
}; };
@ -692,58 +736,68 @@ pandora.ui.mainMenu = function() {
clipItems = (isClipView ? pandora.site.clipKeys.map(function(key) { clipItems = (isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(key), { return Ox.extend(Ox.clone(key), {
checked: ui.listSort[0].key == key.id, 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) { }) : []).concat(!ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend({ return Ox.extend({
checked: ui.listSort[0].key == key.id checked: ui.listSort[0].key == key.id
}, key); }, key);
}) : []); }) : []);
return { id: 'sortMenu', title: 'Sort', items: [ return { id: 'sortMenu', title: Ox._('Sort'), items: [
{ id: 'sortitems', title: 'Sort ' + pandora.site.itemName.plural + ' by', disabled: !ui.item && isClipView, 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) { { group: 'itemsort', min: 1, max: 1, items: pandora.site.sortKeys.map(function(key) {
return Ox.extend({ return Ox.extend({
checked: ui.listSort[0].key == key.id 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: [ { group: 'itemorder', min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', 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: 'Descending', 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 } { 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: [ { 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 { return {
id: 'sortfilter' + filter.id, 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: [ items: [
{ group: 'sortfilter' + filter.id, min: 1, max: 1, items: [ { group: 'sortfilter' + filter.id, min: 1, max: 1, items: [
{ id: 'name', title: 'Name', checked: filter.sort[0].key == 'name' }, { id: 'name', title: Ox._('Name'), checked: filter.sort[0].key == 'name' },
{ id: 'items', title: 'Items', checked: filter.sort[0].key == 'items' } { 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 { return {
id: 'orderfilter' + filter.id, 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: [ items: [
{ group: 'orderfilter' + filter.id, min: 1, max: 1, items: [ { group: 'orderfilter' + filter.id, min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', checked: filter.sort[0].operator == '+' }, { id: 'ascending', title: Ox._('Ascending'), checked: filter.sort[0].operator == '+' },
{ id: 'descending', title: 'Descending', 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: [ buttons: [
Ox.Button({ Ox.Button({
id: 'keep', id: 'keep',
title: 'Keep List Public' title: Ox._('Keep List Public')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -15,7 +15,7 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
}), }),
Ox.Button({ Ox.Button({
id: 'make', id: 'make',
title: 'Make List Private' title: Ox._('Make List Private')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -24,11 +24,9 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
}) })
], ],
keys: {enter: 'make', escape: 'keep'}, keys: {enter: 'make', escape: 'keep'},
text: 'Are you sure you want to make the list "' text: Ox._('Are you sure you want to make the list "{0}" private and loose its {1}?',
+ name + '" private and lose its ' [name, subscribers == 1 ? Ox._('subscriber') : Ox._('{0} subscribers', [subscribers])]),
+ (subscribers == 1 ? 'subscriber' : subscribers + ' subscribers') title: Ox._('Make List Private')
+ '?',
title: 'Make List Private'
}); });
return that; return that;

View file

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

View file

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

View file

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

View file

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

View file

@ -9,9 +9,9 @@ pandora.ui.onloadDialog = function() {
$input = Ox.Input({ $input = Ox.Input({
height: dialogHeight - 32, height: dialogHeight - 32,
id: 'onload', 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, ' + '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', type: 'textarea',
value: localStorage['pandora.onload'] || '', value: localStorage['pandora.onload'] || '',
width: dialogWidth - 32 width: dialogWidth - 32
@ -20,7 +20,7 @@ pandora.ui.onloadDialog = function() {
that = Ox.Dialog({ that = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
title: 'Clear' title: Ox._('Clear')
}) })
.css({margin: '4px 4px 4px 0'}) .css({margin: '4px 4px 4px 0'})
.bindEvent({ .bindEvent({
@ -30,7 +30,7 @@ pandora.ui.onloadDialog = function() {
}), }),
Ox.Button({ Ox.Button({
id: 'done', id: 'done',
title: 'Done', title: Ox._('Done'),
width: 48 width: 48
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
@ -45,7 +45,7 @@ pandora.ui.onloadDialog = function() {
minHeight: 256, minHeight: 256,
minWidth: 512, minWidth: 512,
removeOnClose: true, removeOnClose: true,
title: 'Run Script on Load', title: Ox._('Run Script on Load'),
width: dialogWidth width: dialogWidth
}) })
.bindEvent({ .bindEvent({

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -9,13 +9,13 @@ pandora.ui.sortElement = function(isNavigationView) {
items = ( items = (
isClipView ? pandora.site.clipKeys.map(function(key) { isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(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( ).concat(
!pandora.user.ui.item ? pandora.site.sortKeys.map(function(key) { !pandora.user.ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend(Ox.clone(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); .bindEvent('pandora_' + sortKey.toLowerCase(), updateElement);
function getButtonTitle() { function getButtonTitle() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down'; return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down');
} }
function getButtonTooltip() { function getButtonTooltip() {
return pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending'; return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending');
} }
function updateElement() { function updateElement() {

View file

@ -12,16 +12,16 @@ pandora.ui.sortMenu = function() {
return Ox.extend(Ox.clone(key), { return Ox.extend(Ox.clone(key), {
checked: key.id == pandora.user.ui.itemSort[0].key, checked: key.id == pandora.user.ui.itemSort[0].key,
id: key.id, 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: 'ascending', title: Ox._('Ascending'), checked: pandora.user.ui.itemSort[0].operator == '+'},
{id: 'descending', title: 'Descending', 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' type: 'image'
}) })
.css({float: 'left', margin: '2px'}) .css({float: 'left', margin: '2px'})

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@ pandora.ui.usersDialog = function() {
$reloadButton = Ox.Button({ $reloadButton = Ox.Button({
disabled: true, disabled: true,
title: 'redo', title: 'redo',
tooltip: 'Reload', tooltip: Ox._('Reload'),
type: 'image' type: 'image'
}) })
.css({float: 'left', margin: '4px 2px 4px 4px'}) .css({float: 'left', margin: '4px 2px 4px 4px'})
@ -37,7 +37,7 @@ pandora.ui.usersDialog = function() {
}), }),
$guestsCheckbox = Ox.Checkbox({ $guestsCheckbox = Ox.Checkbox({
title: 'Include Guests', title: Ox._('Include Guests'),
value: false value: false
}) })
.css({float: 'left', margin: '4px 2px'}) .css({float: 'left', margin: '4px 2px'})
@ -51,7 +51,7 @@ pandora.ui.usersDialog = function() {
}), }),
$robotsCheckbox = Ox.Checkbox({ $robotsCheckbox = Ox.Checkbox({
title: 'Include Robots', title: Ox._('Include Robots'),
value: false value: false
}) })
.css({float: 'left', margin: '4px 2px'}) .css({float: 'left', margin: '4px 2px'})
@ -62,9 +62,9 @@ pandora.ui.usersDialog = function() {
$findSelect = Ox.Select({ $findSelect = Ox.Select({
items: [ items: [
{id: 'all', title: 'Find: All'}, {id: 'all', title: Ox._('Find: All')},
{id: 'username', title: 'Find: Username'}, {id: 'username', title: Ox._('Find: Username')},
{id: 'email', title: 'Find: E-Mail-Address'} {id: 'email', title: Ox._('Find: E-Mail-Address')}
], ],
overlap: 'right', overlap: 'right',
type: 'image' type: 'image'
@ -113,7 +113,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'disabled', id: 'disabled',
operator: '-', operator: '-',
title: 'Enabled', title: Ox._('Enabled'),
titleImage: 'check', titleImage: 'check',
visible: true, visible: true,
width: 16 width: 16
@ -132,7 +132,7 @@ pandora.ui.usersDialog = function() {
}); });
}, },
id: 'newsletter', id: 'newsletter',
title: 'Newsletter', title: Ox._('Newsletter'),
titleImage: 'mail', titleImage: 'mail',
operator: '-', operator: '-',
visible: true, visible: true,
@ -147,7 +147,7 @@ pandora.ui.usersDialog = function() {
id: 'username', id: 'username',
operator: '+', operator: '+',
removable: false, removable: false,
title: 'Username', title: Ox._('Username'),
visible: true, visible: true,
width: 128 width: 128
}, },
@ -159,7 +159,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'email', id: 'email',
operator: '+', operator: '+',
title: 'E-Mail Address', title: Ox._('E-Mail Address'),
visible: true, visible: true,
width: 192 width: 192
}, },
@ -174,7 +174,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'level', id: 'level',
operator: '-', operator: '-',
title: 'Level', title: Ox._('Level'),
type: 'label', type: 'label',
visible: true, visible: true,
width: 64 width: 64
@ -198,7 +198,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'location', id: 'location',
operator: '+', operator: '+',
title: 'Location', title: Ox._('Location'),
titleImage: 'flag', titleImage: 'flag',
visible: true, visible: true,
width: 16 width: 16
@ -233,7 +233,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'system', id: 'system',
operator: '+', operator: '+',
title: 'System', title: Ox._('System'),
titleImage: 'square', titleImage: 'square',
visible: true, visible: true,
width: 16 width: 16
@ -264,7 +264,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'browser', id: 'browser',
operator: '+', operator: '+',
title: 'Browser', title: Ox._('Browser'),
titleImage: 'circle', titleImage: 'circle',
visible: true, visible: true,
width: 16 width: 16
@ -276,7 +276,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'timesseen', id: 'timesseen',
operator: '-', operator: '-',
title: 'Times Seen', title: Ox._('Times Seen'),
visible: true, visible: true,
width: 80 width: 80
}, },
@ -287,7 +287,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'firstseen', id: 'firstseen',
operator: '-', operator: '-',
title: 'First Seen', title: Ox._('First Seen'),
visible: true, visible: true,
width: 144 width: 144
}, },
@ -298,7 +298,7 @@ pandora.ui.usersDialog = function() {
}, },
id: 'lastseen', id: 'lastseen',
operator: '-', operator: '-',
title: 'Last Seen', title: Ox._('Last Seen'),
visible: true, visible: true,
width: 144 width: 144
}, },
@ -310,14 +310,14 @@ pandora.ui.usersDialog = function() {
}, },
id: 'numberoflists', id: 'numberoflists',
operator: '-', operator: '-',
title: 'Lists', title: Ox._('Lists'),
visible: true, visible: true,
width: 64 width: 64
}, },
{ {
id: 'groups', id: 'groups',
operator: '+', operator: '+',
title: 'Groups', title: Ox._('Groups'),
visible: true, visible: true,
width: 64 width: 64
}, },
@ -325,7 +325,7 @@ pandora.ui.usersDialog = function() {
id: 'screensize', id: 'screensize',
align: 'right', align: 'right',
operator: '-', operator: '-',
title: 'Screen Size', title: Ox._('Screen Size'),
visible: true, visible: true,
width: 80 width: 80
}, },
@ -333,7 +333,7 @@ pandora.ui.usersDialog = function() {
align: 'right', align: 'right',
id: 'windowsize', id: 'windowsize',
operator: '-', operator: '-',
title: 'Window Size', title: Ox._('Window Size'),
visible: true, visible: true,
width: 80 width: 80
}, },
@ -341,14 +341,14 @@ pandora.ui.usersDialog = function() {
align: 'right', align: 'right',
id: 'ip', id: 'ip',
operator: '+', operator: '+',
title: 'IP Address', title: Ox._('IP Address'),
visible: true, visible: true,
width: 128 width: 128
}, },
{ {
id: 'useragent', id: 'useragent',
operator: '+', operator: '+',
title: 'User Agent', title: Ox._('User Agent'),
visible: true, visible: true,
width: 768 width: 768
} }
@ -395,7 +395,7 @@ pandora.ui.usersDialog = function() {
$formLabel = Ox.Label({ $formLabel = Ox.Label({
textAlign: 'center', textAlign: 'center',
title: 'No user selected', title: Ox._('No user selected'),
width: 212 width: 212
}) })
.css({float: 'left', margin: '4px 2px 4px 4px'}), .css({float: 'left', margin: '4px 2px 4px 4px'}),
@ -406,12 +406,12 @@ pandora.ui.usersDialog = function() {
id: 'edit', id: 'edit',
selected: true, selected: true,
title: 'edit', title: 'edit',
tooltip: 'Edit' tooltip: Ox._('Edit')
}, },
{ {
id: 'mail', id: 'mail',
title: 'mail', title: 'mail',
tooltip: 'Mail' tooltip: Ox._('Mail')
} }
], ],
selectable: true, selectable: true,
@ -429,7 +429,7 @@ pandora.ui.usersDialog = function() {
$sendButton = Ox.Button({ $sendButton = Ox.Button({
disabled: true, disabled: true,
id: 'send', id: 'send',
title: 'Send', title: Ox._('Send'),
width: 64 width: 64
}) })
.bindEvent({ .bindEvent({
@ -488,7 +488,7 @@ pandora.ui.usersDialog = function() {
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'statistics', id: 'statistics',
title: 'Statistics...' title: Ox._('Statistics...')
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -497,7 +497,7 @@ pandora.ui.usersDialog = function() {
}), }),
{}, {},
Ox.Button({ Ox.Button({
title: 'Export E-Mail Addresses' title: Ox._('Export E-Mail Addresses')
}) })
.css({margin: '4px 4px 4px 0'}) .css({margin: '4px 4px 4px 0'})
.bindEvent({ .bindEvent({
@ -511,7 +511,7 @@ pandora.ui.usersDialog = function() {
var $dialog = Ox.Dialog({ var $dialog = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
title: 'Close' title: Ox._('Close')
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -531,7 +531,7 @@ pandora.ui.usersDialog = function() {
}).join(', ') }).join(', ')
), ),
removeOnClose: true, removeOnClose: true,
title: 'E-Mail Addresses' title: Ox._('E-Mail Addresses')
}) })
.open(); .open();
}); });
@ -539,7 +539,7 @@ pandora.ui.usersDialog = function() {
}), }),
Ox.Button({ Ox.Button({
id: 'done', id: 'done',
title: 'Done', title: Ox._('Done'),
width: 48 width: 48
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
@ -555,7 +555,7 @@ pandora.ui.usersDialog = function() {
minWidth: 512, minWidth: 512,
padding: 0, padding: 0,
removeOnClose: true, removeOnClose: true,
title: 'Manage Users', title: Ox._('Manage Users'),
width: dialogWidth width: dialogWidth
}) })
.bindEvent({ .bindEvent({
@ -751,8 +751,8 @@ pandora.ui.usersDialog = function() {
Ox.Select({ Ox.Select({
id: 'include', id: 'include',
items: [ items: [
{id: 'users', title: 'All users'}, {id: 'users', title: Ox._('All users')},
{id: 'subscribers', title: 'Subscribers only'}, {id: 'subscribers', title: Ox._('Subscribers only')},
], ],
label: 'Include', label: 'Include',
labelWidth: 80, labelWidth: 80,
@ -788,10 +788,10 @@ pandora.ui.usersDialog = function() {
Ox.MenuButton({ Ox.MenuButton({
id: 'insert', id: 'insert',
items: [ items: [
{id: 'username', title: 'Username'}, {id: 'username', title: Ox._('Username')},
{id: 'email', title: 'E-Mail address'}, {id: 'email', title: Ox._('E-Mail address')},
], ],
title: 'Insert...', title: Ox._('Insert...'),
width: formWidth - 16 width: formWidth - 16
}) })
.bindEvent({ .bindEvent({
@ -809,7 +809,7 @@ pandora.ui.usersDialog = function() {
}), }),
Ox.Checkbox({ Ox.Checkbox({
id: 'receipt', id: 'receipt',
title: 'Send a receipt to ' + pandora.user.email, title: Ox._('Send a receipt to {0}', [pandora.user.email]),
value: false, value: false,
width: formWidth - 16 width: formWidth - 16
}), }),
@ -857,7 +857,7 @@ pandora.ui.usersDialog = function() {
} }
function sendMail() { function sendMail() {
$sendButton.options({title: 'Sending', disabled: true}); $sendButton.options({title: Ox._('Sending'), disabled: true});
pandora.api.mail({ pandora.api.mail({
to: getTo(), to: getTo(),
subject: getFormItemById('subject').value(), subject: getFormItemById('subject').value(),
@ -868,7 +868,7 @@ pandora.ui.usersDialog = function() {
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'close', id: 'close',
title: 'Close' title: Ox._('Close')
}) })
.bindEvent({ .bindEvent({
click: function() { click: function() {
@ -878,13 +878,13 @@ pandora.ui.usersDialog = function() {
], ],
keys: {enter: 'close', escape: 'close'}, keys: {enter: 'close', escape: 'close'},
text: result.status.code == 200 text: result.status.code == 200
? 'Your message has been sent.' ? Ox._('Your message has been sent.')
: 'Your message could not be sent. Please try again.', : Ox._('Your message could not be sent. Please try again.'),
title: result.status.code == 200 title: result.status.code == 200
? 'Message Sent' ? Ox._('Message Sent')
: 'Application Error' : Ox._('Application Error')
}).open(); }).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) { var users = $list.options('selected').map(function(id) {
return $list.value(id); return $list.value(id);
}), }),
title = users.length == 0 ? 'No user selected' title = users.length == 0 ? Ox._('No user selected')
: users.length == 1 ? ( : users.length == 1 ? (
['guest', 'robot'].indexOf(users[0].level) > -1 ['guest', 'robot'].indexOf(users[0].level) > -1
? Ox.toTitleCase(users[0].level) ? Ox.toTitleCase(users[0].level)
: Ox.encodeHTMLEntities(users[0].username) : Ox.encodeHTMLEntities(users[0].username)
+ ' &lt;' + users[0].email + '&gt;' + ' &lt;' + users[0].email + '&gt;'
) )
: users.length + ' users selected'; : Ox._('{0} users selected', [users.length]);
$formLabel.options({title: title}); $formLabel.options({title: title});
} }
function setSend() { function setSend() {
getFormItemById('send').options({ getFormItemById('send').options({
disabled: getFormItemById('to').value() == 'No recipients' disabled: getFormItemById('to').value() == Ox._('No recipients')
|| getFormItemById('subject').value() === '' || getFormItemById('subject').value() === ''
|| getFormItemById('message').value() === '' || getFormItemById('message').value() === ''
}); });
@ -923,7 +923,7 @@ pandora.ui.usersDialog = function() {
function setTo() { function setTo() {
var recipients = getTo().length; var recipients = getTo().length;
$mailForm.values({ $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() { function getTitle() {
var image, text; var image, text;
if (drag.action == 'move' && drag.source.user != pandora.user.username) { if (drag.action == 'move' && drag.source.user != pandora.user.username) {
image = 'symbolClose' image = 'symbolClose';
text = 'You can only remove ' + pandora.site.itemName.plural.toLowerCase() text = Ox._('You can only remove {0}<br/>from your own lists.',
+ '<br/>from your own lists.'; [pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.action == 'move' && drag.source.type == 'smart') { } else if (drag.action == 'move' && drag.source.type == 'smart') {
image = 'symbolClose'; image = 'symbolClose';
text = 'You can\'t remove ' + pandora.site.itemName.plural.toLowerCase() text = Ox._('You can\'t remove {0}<br/>from smart lists.',
+ '<br/>from smart lists.'; [pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.user != pandora.user.username) { } else if (drag.target && drag.target.user != pandora.user.username) {
image = 'symbolClose' image = 'symbolClose';
text = 'You can only ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase() text = Ox._('You can only {0} {1}<br/>to your own lists',
+ '<br/>to your own lists'; [drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.type == 'smart') { } else if (drag.target && drag.target.type == 'smart') {
image = 'symbolClose' image = 'symbolClose';
text = 'You can\'t ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase() text = Ox._('You can\'t {0} {1}<br/>to smart lists',
+ '<br/>to smart lists'; [drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else { } else {
image = drag.action == 'copy' ? 'symbolAdd' : 'symbolRemove'; image = drag.action == 'copy' ? 'symbolAdd' : 'symbolRemove';
text = Ox.toTitleCase(drag.action) + ' ' + ( text = Ox._(Ox.toTitleCase(drag.action)) + ' ' + (
Ox.isString(drag.item) Ox.isString(drag.item)
? '"' + drag.item + '"' ? '"' + drag.item + '"'
: drag.item + ' ' + pandora.site.itemName[ : drag.item + ' ' + pandora.site.itemName[
drag.item == 1 ? 'singular' : 'plural' drag.item == 1 ? 'singular' : 'plural'
].toLowerCase() ].toLowerCase()
) + '</br> to ' + ( ) + '<br/>' + (
drag.target && !drag.target.selected drag.target && !drag.target.selected
? 'the list "' + Ox.encodeHTMLEntities(drag.target.name) + '"' ? Ox._('to the list "{0}"', [Ox.encodeHTMLEntities(drag.target.name)])
: (pandora.user.ui._list ? 'another' : 'a') + ' list' : Ox._('to ' + (pandora.user.ui._list ? 'another' : 'a') + ' list')
); );
} }
return $('<div>') return $('<div>')
@ -584,14 +584,14 @@ pandora.getClipsQuery = function() {
var parts = [pandora.site.site.name]; var parts = [pandora.site.site.name];
if (pandora.user.ui.section == 'items') { if (pandora.user.ui.section == 'items') {
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
pandora.user.ui._list && parts.push('List ' + pandora.user.ui._list); pandora.user.ui._list && parts.push(Ox._('List {0}', [pandora.user.ui._list]));
parts.push(Ox.toTitleCase(pandora.user.ui.listView) + ' View'); parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View'));
} else { } else {
parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item); 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') { } 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(' - '); return parts.join(' - ');
}; };
@ -602,7 +602,7 @@ pandora.getEditTooltip = function(title) {
var $target = $(e.target); var $target = $(e.target);
return ( return (
$target.is('a') || $target.parents('a').length $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 : ''); ) + (title ? ' ' + title : '');
} }
}; };
@ -903,15 +903,15 @@ pandora.getListData = function(list) {
pandora.getPageTitle = function(stateOrURL) { pandora.getPageTitle = function(stateOrURL) {
var pages = [ var pages = [
{id: '', title: ''}, {id: '', title: ''},
{id: 'api', title: 'API Documentation'}, {id: 'api', title: Ox._('API Documentation')},
{id: 'help', title: 'Help'}, {id: 'help', title: Ox._('Help')},
{id: 'home', title: ''}, {id: 'home', title: ''},
{id: 'preferences', title: 'Preferences'}, {id: 'preferences', title: Ox._('Preferences')},
{id: 'signin', title: 'Sign In'}, {id: 'signin', title: Ox._('Sign In')},
{id: 'signout', title: 'Sign Out'}, {id: 'signout', title: Ox._('Sign Out')},
{id: 'signup', title: 'Sign Up'}, {id: 'signup', title: Ox._('Sign Up')},
{id: 'software', title: 'Software'}, {id: 'software', title: Ox._('Software')},
{id: 'tv', title: 'TV'} {id: 'tv', title: Ox._('TV')}
].concat(pandora.site.sitePages), ].concat(pandora.site.sitePages),
page = Ox.getObjectById( page = Ox.getObjectById(
pages, pages,
@ -1046,7 +1046,7 @@ pandora.getStatusText = function(data) {
canSeeFiles = pandora.site.capabilities.canSeeFiles[pandora.user.level], canSeeFiles = pandora.site.capabilities.canSeeFiles[pandora.user.level],
canSeeSize = pandora.site.capabilities.canSeeSize[pandora.user.level], canSeeSize = pandora.site.capabilities.canSeeSize[pandora.user.level],
itemName = ui.listView == 'clip' itemName = ui.listView == 'clip'
? (data.items == 1 ? 'Clip' : 'Clips') ? (data.items == 1 ? Ox._('Clip') : Ox._('Clips'))
: (pandora.site.itemName[data.items == 1 ? 'singular' : 'plural']), : (pandora.site.itemName[data.items == 1 ? 'singular' : 'plural']),
parts = []; parts = [];
parts.push(Ox.formatNumber(data.items) + ' '+ itemName); parts.push(Ox.formatNumber(data.items) + ' '+ itemName);
@ -1057,7 +1057,7 @@ pandora.getStatusText = function(data) {
} }
if (canSeeFiles) { if (canSeeFiles) {
data.files && parts.push( 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)); 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() { pandora.beforeunloadWindow = function() {
if (pandora.firefogg) 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 //prevent error dialogs on unload
pandora.isUnloading = true; pandora.isUnloading = true;
}; };

View file

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

View file

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

View file

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