').css({marginBottom: '4px', fontWeight: 'bold'})
- .html(Ox.toTitleCase(key).replace(' Per ', ' per '))
- : '
';
+ .html(Ox._(Ox.toTitleCase(key).replace(' Per ', ' per ')))
+ : '
';
}
function formatLight(str) {
@@ -763,7 +763,7 @@ pandora.ui.infoView = function(data) {
if (!canEdit) {
Ox.Button({
title: 'Help',
- tooltip: 'About Rights',
+ tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})
diff --git a/static/js/pandora/infoView.indiancinema.js b/static/js/pandora/infoView.indiancinema.js
index 77d0064c..d4292fa2 100644
--- a/static/js/pandora/infoView.indiancinema.js
+++ b/static/js/pandora/infoView.indiancinema.js
@@ -279,7 +279,7 @@ pandora.ui.infoView = function(data) {
'
')
.addClass('OxLink')
.css({fontWeight: 'bold'})
- .html('Show ' + filmography)
+ .html(Ox._('Show {0}', [filmography]))
.one({
click: function() {
$link.removeClass('OxLink')
- .html('Loading ' + filmography + '...');
+ .html(Ox._('Loading {0}...', [filmography]));
getFilmography(
key == 'studios' ? 'productionCompany' : 'name',
value.name,
value.keys,
function($element) {
$link.addClass('OxLink')
- .html('Hide ' + filmography)
+ .html(Ox._('Hide {0}', [filmography]))
.on({
click: function() {
- if (Ox.startsWith($link.html(), 'Show')) {
- $link.html('Hide ' + filmography);
+ if (Ox.startsWith($link.html(), Ox._('Show'))) {
+ $link.html(Ox._('Hide {0}', [filmography]));
$text.show();
} else {
- $link.html('Show ' + filmography);
+ $link.html(Ox._('Show {0}', [filmography]));
$text.hide();
}
}
@@ -841,7 +840,7 @@ pandora.ui.infoView = function(data) {
'
'
+ result.data.items + ' '
+ pandora.site.itemName.plural.toLowerCase()
- + ' with the same IMDb ID)'
+ + '' + Ox._('with the same IMDb ID') + ')'
);
}
});
diff --git a/static/js/pandora/infoView.js b/static/js/pandora/infoView.js
index ce37a179..99396dd8 100644
--- a/static/js/pandora/infoView.js
+++ b/static/js/pandora/infoView.js
@@ -182,7 +182,7 @@ pandora.ui.infoView = function(data) {
return formatValue(listKeys.indexOf(key) >= 0
? value.split(', ') : value, key);
},
- placeholder: formatLight('unknown'),
+ placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ')
@@ -222,7 +222,7 @@ pandora.ui.infoView = function(data) {
format: function(value) {
return formatValue(value.split(', '), 'name');
},
- placeholder: formatLight('unknown'),
+ placeholder: formatLight(Ox._('unknown')),
tooltip: pandora.getEditTooltip(),
value: listKeys.indexOf(key) >= 0
? (data[key] || []).join(', ')
@@ -538,8 +538,8 @@ pandora.ui.infoView = function(data) {
});
if (!canEdit) {
Ox.Button({
- title: 'Help',
- tooltip: 'About Rights',
+ title: Ox._('Help'),
+ tooltip: Ox._('About Rights'),
type: 'image'
})
.css({marginLeft: '52px'})
diff --git a/static/js/pandora/infoView.padma.js b/static/js/pandora/infoView.padma.js
index b365baa6..f567f971 100644
--- a/static/js/pandora/infoView.padma.js
+++ b/static/js/pandora/infoView.padma.js
@@ -193,7 +193,7 @@ pandora.ui.infoView = function(data) {
'
')
.css({marginBottom: '4px'})
- .append(formatKey('Rights Level', true))
+ .append(formatKey(Ox._('Rights Level'), true))
.append($rightsLevel)
.appendTo($right);
renderRightsLevel();
diff --git a/static/js/pandora/insertEmbedDialog.js b/static/js/pandora/insertEmbedDialog.js
index 2e6cd078..956b5481 100644
--- a/static/js/pandora/insertEmbedDialog.js
+++ b/static/js/pandora/insertEmbedDialog.js
@@ -17,7 +17,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
buttons: [
Ox.Button({
id: 'cancel',
- title: 'Cancel',
+ title: Ox._('Cancel'),
width: 64
})
.bindEvent({
@@ -27,7 +27,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
}),
Ox.Button({
id: 'insert',
- title: 'Insert',
+ title: Ox._('Insert'),
width: 64
})
.bindEvent({
@@ -42,7 +42,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
height: dialogHeight,
keys: {enter: 'insert', escape: 'cancel'},
removeOnClose: true,
- title: 'Insert Embed',
+ title: Ox._('Insert Embed'),
width: dialogWidth
}),
$input = {},
@@ -76,8 +76,8 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return getForm(id);
},
tabs: [
- {id: 'basic', title: 'Basic', selected: !advanced},
- {id: 'advanced', title: 'Advanced', selected: advanced}
+ {id: 'basic', title: Ox._('Basic'), selected: !advanced},
+ {id: 'advanced', title: Ox._('Advanced'), selected: advanced}
]
});
} else {
@@ -86,9 +86,9 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return $content;
},
tabs: [
- {id: 'video', title: 'Video', selected: true},
- {id: 'map', title: 'Map', disabled: true},
- {id: 'calendar', title: 'Calendar', disabled: true}
+ {id: 'video', title: Ox._('Video'), selected: true},
+ {id: 'map', title: Ox._('Map'), disabled: true},
+ {id: 'calendar', title: Ox._('Calendar'), disabled: true}
]
});
@@ -107,7 +107,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.css({padding: '16px', overflowY: 'auto'});
$input.url = Ox.Input({
- label: 'URL',
+ label: Ox._('URL'),
labelWidth: 128,
width: formWidth,
value: url
@@ -127,7 +127,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
{id: 'http', title: 'http'},
{id: 'https', title: 'https', disabled: !pandora.site.site.https}
],
- label: 'Protocol',
+ label: Ox._('Protocol'),
labelWidth: 128,
value: pandora.site.site.https ? 'https' : 'http',
width: formWidth
@@ -141,8 +141,8 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.site = Ox.SelectInput({
inputWidth: 128,
- items: sites.concat([{id: 'other', title: 'Other...'}]),
- label: 'Site',
+ items: sites.concat([{id: 'other', title: Ox._('Other...')}]),
+ label: Ox._('Site'),
labelWidth: 128,
placeholder: 'example.com',
max: 1,
@@ -193,12 +193,12 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.link = Ox.Select({
items: [
- {id: 'default', title: 'Default'},
- {id: 'player', title: 'Player'},
- {id: 'editor', title: 'Editor'},
- {id: 'timeline', title: 'Timeline'}
+ {id: 'default', title: Ox._('Default')},
+ {id: 'player', title: Ox._('Player')},
+ {id: 'editor', title: Ox._('Editor')},
+ {id: 'timeline', title: Ox._('Timeline')}
],
- label: 'Link',
+ label: Ox._('Link'),
labelWidth: 128,
value: 'default',
width: formWidth
@@ -211,7 +211,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.position = Ox.Input({
- label: 'Position',
+ label: Ox._('Position'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@@ -237,7 +237,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input['in'] = Ox.Input({
- label: 'In Point',
+ label: Ox._('In Point'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@@ -265,7 +265,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.out = Ox.Input({
- label: 'Out Point',
+ label: Ox._('Out Point'),
labelWidth: 128,
placeholder: '00:00:00.000',
width: formWidth
@@ -293,7 +293,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.annotation = Ox.Input({
- label: 'Annotation',
+ label: Ox._('Annotation'),
labelWidth: 128,
width: formWidth
})
@@ -311,7 +311,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
space().appendTo($form);
$input.title = Ox.Input({
- label: 'Title',
+ label: Ox._('Title'),
labelWidth: 128,
width: formWidth
})
@@ -323,7 +323,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.showTimeline = Ox.Checkbox({
- label: 'Show Large Timeline',
+ label: Ox._('Show Large Timeline'),
labelWidth: 128,
value: false,
width: formWidth
@@ -340,11 +340,11 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
$input.timeline = Ox.Select({
items: [
- {id: 'default', title: 'Default'}
+ {id: 'default', title: Ox._('Default')}
].concat(
pandora.site.timelines
),
- label: 'Timeline',
+ label: Ox._('Timeline'),
labelWidth: 128,
value: 'default',
width: formWidth
@@ -357,7 +357,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
$input.showAnnotations = Ox.Checkbox({
- label: 'Show Annotations',
+ label: Ox._('Show Annotations'),
labelWidth: 128,
value: false,
width: formWidth
@@ -373,7 +373,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
.appendTo($form);
var $showLayersLabel = Ox.Label({
- title: 'Show Layers',
+ title: Ox._('Show Layers'),
width: formWidth
})
.addClass('advanced')
@@ -553,4 +553,4 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) {
return that;
-};
\ No newline at end of file
+};
diff --git a/static/js/pandora/item.js b/static/js/pandora/item.js
index 019b6033..916420fd 100644
--- a/static/js/pandora/item.js
+++ b/static/js/pandora/item.js
@@ -50,12 +50,12 @@ pandora.ui.item = function() {
Ox.Element()
.css({marginTop: '32px', fontSize: '12px', textAlign: 'center'})
.html(
- 'Sorry,
' + result.data.title
- + ' currently doesn\'t have '
+ Ox._('Sorry,
{0}'
+ + ' currently doesn\'t have '
+ (['a', 'e', 'i', 'o'].indexOf(
pandora.user.ui.itemView.slice(0, 1)
) > -1 ? 'an': 'a') + ' '
- + pandora.user.ui.itemView + ' view.'
+ +'{1} view.', [result.data.title, Ox._(pandora.user.ui.itemView)])
)
);
diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js
index c9924572..6f75b626 100644
--- a/static/js/pandora/list.js
+++ b/static/js/pandora/list.js
@@ -49,7 +49,7 @@ pandora.ui.list = function() {
},
id: 'posterRatio',
resizable: false,
- title: 'Icon',
+ title: Ox._('Icon'),
titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon',
visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1,
width: 16
@@ -68,7 +68,7 @@ pandora.ui.list = function() {
operator: pandora.getSortOperator(key.id),
position: position,
removable: !key.columnRequired,
- title: key.title,
+ title: Ox._(key.title),
type: key.type,
visible: position > -1,
width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth
diff --git a/static/js/pandora/listDialog.js b/static/js/pandora/listDialog.js
index 0d3a26de..085fe371 100644
--- a/static/js/pandora/listDialog.js
+++ b/static/js/pandora/listDialog.js
@@ -7,15 +7,15 @@ pandora.ui.listDialog = function(section) {
section = section || 'general';
var listData = pandora.getListData(),
tabs = [].concat([
- {id: 'general', title: 'General'},
- {id: 'icon', title: 'Icon'}
+ {id: 'general', title: Ox._('General')},
+ {id: 'icon', title: Ox._('Icon')}
], listData.type == 'smart'
- ? [{id: 'query', title: 'Query'}]
+ ? [{id: 'query', title: Ox._('Query')}]
: []
),
ui = pandora.user.ui,
width = getWidth(section),
- folderItems = ui.section == 'items' ? 'Lists' : Ox.toTitleCase(ui.section),
+ folderItems = ui.section == 'items' ? Ox._('Lists') : Ox.toTitleCase(ui.section),
folderItem = folderItems.slice(0, -1);
Ox.getObjectById(tabs, section).selected = true;
@@ -61,7 +61,7 @@ pandora.ui.listDialog = function(section) {
elements: [
pandora.$ui.findIconItemSelect = Ox.Select({
items: pandora.site.findKeys.map(function(findKey) {
- return {id: findKey.id, title: 'Find: ' + findKey.title};
+ return {id: findKey.id, title: Ox._('Find: {0}', [Ox._(findKey.title)])};
}),
overlap: 'right',
type: 'image'
@@ -101,7 +101,7 @@ pandora.ui.listDialog = function(section) {
buttons: [
Ox.Button({
id: 'done',
- title: 'Done'
+ title: Ox._('Done')
})
.bindEvent({
click: function() {
@@ -128,7 +128,7 @@ pandora.ui.listDialog = function(section) {
}),
$updateCheckbox = Ox.Checkbox({
- title: 'Update Results in the Background',
+ title: Ox._('Update Results in the Background'),
value: pandora.user.ui.updateAdvancedFindResults
})
.css({float: 'left', margin: '4px'})
@@ -236,8 +236,8 @@ pandora.ui.listGeneralPanel = function(listData) {
.appendTo(that)
: Ox.Select({
items: [
- {id: 'private', title: 'Private'},
- {id: 'public', title: 'Public'}
+ {id: 'private', title: Ox._('Private')},
+ {id: 'public', title: Ox._('Public')}
],
label: 'Status',
labelWidth: 80,
diff --git a/static/js/pandora/logsDialog.js b/static/js/pandora/logsDialog.js
index 3299a270..10f6415b 100644
--- a/static/js/pandora/logsDialog.js
+++ b/static/js/pandora/logsDialog.js
@@ -9,10 +9,10 @@ pandora.ui.logsDialog = function() {
$findSelect = Ox.Select({
items: [
- {id: 'all', title: 'Find: All'},
- {id: 'user', title: 'Find: User'},
- {id: 'url', title: 'Find: URL'},
- {id: 'text', title: 'Find: Text'}
+ {id: 'all', title: Ox._('Find: All')},
+ {id: 'user', title: Ox._('Find: User')},
+ {id: 'url', title: Ox._('Find: URL')},
+ {id: 'text', title: Ox._('Find: Text')}
],
overlap: 'right',
type: 'image',
@@ -55,7 +55,7 @@ pandora.ui.logsDialog = function() {
columns: [
{
id: 'id',
- title: 'ID',
+ title: Ox._('ID'),
visible: false
},
{
@@ -64,7 +64,7 @@ pandora.ui.logsDialog = function() {
},
id: 'user',
operator: '+',
- title: 'User',
+ title: Ox._('User'),
visible: true,
width: 72
},
@@ -75,7 +75,7 @@ pandora.ui.logsDialog = function() {
},
id: 'created',
operator: '-',
- title: 'Date',
+ title: Ox._('Date'),
visible: true,
width: 144
},
@@ -85,7 +85,7 @@ pandora.ui.logsDialog = function() {
},
id: 'url',
operator: '+',
- title: 'URL',
+ title: Ox._('URL'),
visible: true,
width: 320
},
@@ -95,7 +95,7 @@ pandora.ui.logsDialog = function() {
},
id: 'text',
operator: '+',
- title: 'Text',
+ title: Ox._('Text'),
visible: true,
width: 640
},
@@ -131,7 +131,7 @@ pandora.ui.logsDialog = function() {
buttons: [
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
})
.bindEvent({
click: function() {
@@ -161,7 +161,7 @@ pandora.ui.logsDialog = function() {
buttons: [
Ox.Button({
id: 'done',
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -192,7 +192,7 @@ pandora.ui.logsDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
- title: 'Error Logs',
+ title: Ox._('Error Logs'),
width: width
}),
diff --git a/static/js/pandora/mainMenu.js b/static/js/pandora/mainMenu.js
index 737f7b52..53a0d439 100644
--- a/static/js/pandora/mainMenu.js
+++ b/static/js/pandora/mainMenu.js
@@ -3,7 +3,6 @@
'use strict';
pandora.ui.mainMenu = function() {
-
var isGuest = pandora.user.level == 'guest',
ui = pandora.user.ui,
findState = pandora.getFindState(ui.find),
@@ -19,154 +18,194 @@ pandora.ui.mainMenu = function() {
[
{ id: pandora.site.site.id + 'Menu', title: pandora.site.site.name, items: [].concat(
[
- { id: 'home', title: 'Home' },
+ { id: 'home', title: Ox._('Home') },
{}
],
- Ox.clone(pandora.site.sitePages, true),
+ Ox.clone(pandora.site.sitePages, true).map(function(page) {
+ page.title = Ox._(page.title);
+ return page;
+ }),
[
{},
- { id: 'software', title: 'Software' }
+ { id: 'software', title: Ox._('Software') }
]
) },
- { id: 'userMenu', title: 'User', items: [
- { id: 'username', title: 'User: ' + (isGuest ? 'not signed in' : Ox.encodeHTMLEntities(pandora.user.username)), disabled: true },
+ { id: 'userMenu', title: Ox._('User'), items: [
+ { id: 'username', title: Ox._('User: {0}', [isGuest ? 'not signed in' : Ox.encodeHTMLEntities(pandora.user.username)]), disabled: true },
{},
- { id: 'preferences', title: 'Preferences...', disabled: isGuest, keyboard: 'control ,' },
- { id: 'archives', title: 'Archives...', disabled: /*isGuest*/ true },
+ { id: 'preferences', title: Ox._('Preferences...'), disabled: isGuest, keyboard: 'control ,' },
+ { id: 'archives', title: Ox._('Archives...'), disabled: /*isGuest*/ true },
{},
- { id: 'signup', title: 'Sign Up...', disabled: !isGuest },
- isGuest ? { id: 'signin', title: 'Sign In...' }
- : { id: 'signout', title: 'Sign Out...'}
+ { id: 'signup', title: Ox._('Sign Up...'), disabled: !isGuest },
+ isGuest ? { id: 'signin', title: Ox._('Sign In...')}
+ : { id: 'signout', title: Ox._('Sign Out...')}
] },
getListMenu(),
- { id: 'editMenu', title: 'Edit', items: [
- { id: 'add', title: 'Add ' + pandora.site.itemName.singular, disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] },
- { id: 'upload', title: 'Upload Video...', disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] },
+ { id: 'editMenu', title: Ox._('Edit'), items: [
+ { id: 'add', title: Ox._('Add {0}', [Ox._(pandora.site.itemName.singular)]), disabled: pandora.site.itemRequiresVideo || !pandora.site.capabilities.canAddItems[pandora.user.level] },
+ { id: 'upload', title: Ox._('Upload Video...'), disabled: !pandora.site.capabilities.canAddItems[pandora.user.level] },
{},
- { id: 'undo', title: 'Undo', disabled: true, keyboard: 'control z' },
- { id: 'redo', title: 'Redo', disabled: true, keyboard: 'shift control z' },
+ { id: 'undo', title: Ox._('Undo'), disabled: true, keyboard: 'control z' },
+ { id: 'redo', title: Ox._('Redo'), disabled: true, keyboard: 'shift control z' },
{},
- { id: 'cut', title: 'Cut', disabled: true, keyboard: 'control x' },
- { id: 'copy', title: 'Copy', disabled: true, keyboard: 'control c' },
- { id: 'paste', title: 'Paste', disabled: true, keyboard: 'control v' },
- { id: 'delete', title: 'Delete', disabled: true, keyboard: 'delete' },
+ { id: 'cut', title: Ox._('Cut{control_x}', {control_x:''}), disabled: true, keyboard: 'control x' },
+ { id: 'copy', title: Ox._('Copy'), disabled: true, keyboard: 'control c' },
+ { id: 'paste', title: Ox._('Paste'), disabled: true, keyboard: 'control v' },
+ { id: 'delete', title: Ox._('Delete'), disabled: true, keyboard: 'delete' },
{},
- { id: 'selectall', title: 'Select All', disabled: true, keyboard: 'control a' },
- { id: 'selectnone', title: 'Select None', disabled: true, keyboard: 'shift control a' },
- { id: 'invertselection', title: 'Invert Selection', disabled: true, keyboard: 'alt control a' }
+ { id: 'selectall', title: Ox._('Select All'), disabled: true, keyboard: 'control a' },
+ { id: 'selectnone', title: Ox._('Select None'), disabled: true, keyboard: 'shift control a' },
+ { id: 'invertselection', title: Ox._('Invert Selection'), disabled: true, keyboard: 'alt control a' }
] },
- { id: 'viewMenu', title: 'View', items: [
- { id: 'items', title: 'View ' + pandora.site.itemName.plural, items: [
+ { id: 'viewMenu', title: Ox._('View'), items: [
+ { id: 'items', title: Ox._('View {0}', [Ox._(pandora.site.itemName.plural)]), items: [
{ group: 'listview', min: 1, max: 1, items: pandora.site.listViews.map(function(view) {
return Ox.extend({
checked: ui.listView == view.id
- }, view);
+ }, view, {
+ title: Ox._(view.title)
+ });
}) },
]},
- { id: 'icons', title: 'Icons', items: [].concat([
+ { id: 'icons', title: Ox._('Icons'), items: [].concat([
{ group: 'viewicons', min: 1, max: 1, items: ['posters', 'frames'].map(function(icons) {
- return {id: icons, title: Ox.toTitleCase(icons), checked: ui.icons == icons};
+ return {id: icons, title: Ox._(Ox.toTitleCase(icons)), checked: ui.icons == icons};
}) },
{},
], pandora.site.media.importPosters ? [
- { id: 'showsiteposters', title: 'Always Show ' + pandora.site.site.name + ' Poster', checked: ui.showSitePosters },
+ { id: 'showsiteposters', title: Ox._('Always Show {0} Poster', [pandora.site.site.name]), checked: ui.showSitePosters },
{}
] : [], [
- { id: 'showreflections', title: 'Show Reflections', checked: true, disabled: true }
+ { id: 'showreflections', title: Ox._('Show Reflections'), checked: true, disabled: true }
]
) },
- { id: 'timelines', title: 'Timelines', items: [
+ { id: 'timelines', title: Ox._('Timelines'), items: [
{ group: 'viewtimelines', min: 1, max: 1, items: pandora.site.timelines.map(function(mode) {
- return {id: mode.id, title: mode.title, checked: ui.videoTimeline == mode.id};
+ return {id: mode.id, title: Ox._(mode.title), checked: ui.videoTimeline == mode.id};
}) }
]},
- { id: 'columns', title: 'Columns', items: [
- { id: 'loadcolumns', title: 'Load Layout...', disabled: true },
- { id: 'savecolumns', title: 'Save Layout...', disabled: true },
+ { id: 'columns', title: Ox._('Columns'), items: [
+ { id: 'loadcolumns', title: Ox._('Load Layout...'), disabled: true },
+ { id: 'savecolumns', title: Ox._('Save Layout...'), disabled: true },
{},
- { id: 'resetcolumns', title: 'Reset Layout', disabled: true }
+ { id: 'resetcolumns', title: Ox._('Reset Layout'), disabled: true }
] },
{},
- { id: 'item', title: ['Open ' + pandora.site.itemName.singular, 'Open ' + pandora.site.itemName.plural], items: [
+ { id: 'item', title: [
+ Ox._('Open {0}', [Ox._(pandora.site.itemName.singular)]),
+ Ox._('Open {0}', [Ox._(pandora.site.itemName.plural)])
+ ], items: [
{ group: 'itemview', min: 1, max: 1, items: pandora.site.itemViews.map(function(view) {
return Ox.extend({
checked: ui.itemView == view.id
}, view);
}) },
] },
- { id: 'clips', title: 'Open Clips', items: [
+ { id: 'clips', title: Ox._('Open Clips'), items: [
{ group: 'videoview', min: 1, max: 1, items: ['player', 'editor', 'timeline'].map(function(view) {
- return {id: view, title: Ox.toTitleCase(view), checked: ui.videoView == view};
+ return {id: view, title: Ox._(Ox.toTitleCase(view)), checked: ui.videoView == view};
}) }
] },
{},
- { id: 'filters', title: 'Filters', items: [
+ { id: 'filters', title: Ox._('Filters'), items: [
{ group: 'filters', min: 5, max: 5, items: pandora.site.filters.map(function(filter) {
return Ox.extend({
checked: Ox.getIndexById(ui.filters, filter.id) > -1
- }, filter);
+ }, filter, {
+ title: Ox._(filter.title)
+ });
}) },
{},
- { id: 'resetfilters', title: 'Reset Filters' }
+ { id: 'resetfilters', title: Ox._('Reset Filters') }
] },
{},
- { id: 'showsidebar', title: (ui.showSidebar ? 'Hide' : 'Show') + ' Sidebar', keyboard: 'shift s' },
- { id: 'showinfo', title: (ui.showInfo ? 'Hide' : 'Show') + ' Info', disabled: !ui.showSidebar, keyboard: 'shift i' },
- { id: 'showfilters', title: (ui.showFilters ? 'Hide' : 'Show') + ' Filters', disabled: !!ui.item, keyboard: 'shift f' },
- { id: 'showbrowser', title: (ui.showBrowser ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser', disabled: !ui.item, keyboard: 'shift b' },
- { id: 'showannotations', title: (ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations', disabled: !ui.item || ['timeline', 'player', 'editor'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
- { id: 'showtimeline', title: (ui.showTimeline ? 'Hide' : 'Show') + ' Timeline', disabled: !ui.item || ui.itemView != 'player', keyboard: 'shift t' },
+ {
+ id: 'showsidebar',
+ title: Ox._((ui.showSidebar ? 'Hide' : 'Show') + ' Sidebar'),
+ keyboard: 'shift s' },
+ {
+ id: 'showinfo',
+ title: Ox._((ui.showInfo ? 'Hide' : 'Show') + ' Info'),
+ disabled: !ui.showSidebar, keyboard: 'shift i' },
+ {
+ id: 'showfilters',
+ title: Ox._((ui.showFilters ? 'Hide' : 'Show') + ' Filters'),
+ disabled: !!ui.item, keyboard: 'shift f' },
+ {
+ id: 'showbrowser',
+ title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]),
+ disabled: !ui.item, keyboard: 'shift b' },
+ {
+ id: 'showannotations',
+ title: Ox._((ui.showAnnotations ? 'Hide' : 'Show') + ' Annotations'),
+ disabled: !ui.item || ['timeline', 'player', 'editor'].indexOf(ui.itemView) == -1, keyboard: 'shift a' },
+ {
+ id: 'showtimeline',
+ title: Ox._((ui.showTimeline ? 'Hide' : 'Show') + ' Timeline'),
+ disabled: !ui.item || ui.itemView != 'player', keyboard: 'shift t' },
{},
- { id: 'togglefullscreen', title: (fullscreenState ? 'Exit' : 'Enter') + ' Fullscreen', disabled: fullscreenState === void 0, keyboard: 'shift alt control f' },
- { id: 'entervideofullscreen', title: 'Enter Video Fullscreen', disabled: !ui.item || ui.itemView != 'player' },
+ {
+ id: 'togglefullscreen',
+ title: Ox._((fullscreenState ? 'Exit' : 'Enter') + ' Fullscreen'),
+ disabled: fullscreenState === void 0, keyboard: 'shift alt control f' },
+ {
+ id: 'entervideofullscreen',
+ title: Ox._('Enter Video Fullscreen'),
+ disabled: !ui.item || ui.itemView != 'player' },
{},
- { id: 'theme', title: 'Theme', items: [
+ { id: 'theme', title: Ox._('Theme'), items: [
{ group: 'settheme', min: 1, max: 1, items: pandora.site.themes.map(function(theme) {
return {id: theme, title: Ox.Theme.getThemeData(theme).themeName, checked: ui.theme == theme}
}) }
+ ] },
+ {},
+ { id: 'locale', title: Ox._('Language'), items: [
+ { group: 'setlocale', min: 1, max: 1, items: Object.keys(Ox.LOCALES).map(function(locale) {
+ return {id: locale, title: Ox.LOCALES[locale], checked: ui.locale == locale}
+ }) }
] }
]},
getSortMenu(),
- { id: 'findMenu', title: 'Find', items: [
- { id: 'find', title: 'Find', items: [
+ { id: 'findMenu', title: Ox._('Find'), items: [
+ { id: 'find', title: Ox._('Find'), items: [
{ group: 'find', min: 0, max: 1, items: pandora.site.findKeys.map(function(key, i) {
return Ox.extend({
checked: key.id == findState.key
}, key);
}) }
] },
- { id: 'advancedfind', title: 'Advanced Find...', keyboard: 'shift control f' },
+ { id: 'advancedfind', title: Ox._('Advanced Find...'), keyboard: 'shift control f' },
{},
- { id: 'findsimilar', title: 'Find Similar Clips...', keyboard: 'alt control f', disabled: !pandora.getItemIdAndPosition() }
+ { id: 'findsimilar', title: Ox._('Find Similar Clips...'), keyboard: 'alt control f', disabled: !pandora.getItemIdAndPosition() }
] },
- { id: 'dataMenu', title: 'Data', items: [
- { id: 'files', title: 'Manage Files...', disabled: !pandora.site.capabilities.canManageFiles[pandora.user.level] },
+ { id: 'dataMenu', title: Ox._('Data'), items: [
+ { id: 'files', title: Ox._('Manage Files...'), disabled: !pandora.site.capabilities.canManageFiles[pandora.user.level] },
{},
- { id: 'titles', title: 'Manage Titles...', disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
- { id: 'names', title: 'Manage Names...', disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
+ { id: 'titles', title: Ox._('Manage Titles...'), disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
+ { id: 'names', title: Ox._('Manage Names...'), disabled: !pandora.site.capabilities.canManageTitlesAndNames[pandora.user.level] },
{},
- { id: 'places', title: 'Manage Places...', disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
- { id: 'events', title: 'Manage Events...', disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
+ { id: 'places', title: Ox._('Manage Places...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
+ { id: 'events', title: Ox._('Manage Events...'), disabled: !pandora.site.capabilities.canManagePlacesAndEvents[pandora.user.level] },
{},
- { id: 'users', title: 'Manage Users...', disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
- { id: 'statistics', title: 'Statistics...', disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }
+ { id: 'users', title: Ox._('Manage Users...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] },
+ { id: 'statistics', title: Ox._('Statistics...'), disabled: !pandora.site.capabilities.canManageUsers[pandora.user.level] }
] },
- { id: 'helpMenu', title: 'Help', items: [
- { id: 'help', title: 'Help...', keyboard: 'control ?' },
- { id: 'api', title: 'API Documentation...' }
+ { id: 'helpMenu', title: Ox._('Help'), items: [
+ { id: 'help', title: Ox._('Help...'), keyboard: 'control ?' },
+ { id: 'api', title: Ox._('API Documentation...') }
] }
],
pandora.site.capabilities.canSeeDebugMenu[pandora.user.level]
? [
- { id: 'debugMenu', title: 'Debug', items: [
- { id: 'clearcache', title: 'Clear Cache'},
- { id: 'reloadapplication', title: 'Reload Application'},
+ { id: 'debugMenu', title: Ox._('Debug'), items: [
+ { id: 'clearcache', title: Ox._('Clear Cache')},
+ { id: 'reloadapplication', title: Ox._('Reload Application')},
{},
- { id: 'debugmode', title: (pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode' },
- { id: 'eventlogging', title: (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'},
+ { id: 'debugmode', title: Ox._((pandora.localStorage('enableDebugMode') ? 'Disable' : 'Enable') + ' Debug Mode') },
+ { id: 'eventlogging', title: Ox._((pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging')},
{},
- { id: 'errorlogs', title: 'View Error Logs...'},
- { id: 'tests', title: 'Run Tests'}
+ { id: 'errorlogs', title: Ox._('View Error Logs...')},
+ { id: 'tests', title: Ox._('Run Tests')}
] }
]
: []
@@ -231,6 +270,11 @@ pandora.ui.mainMenu = function() {
});
filters[index].sort[0].operator = operator;
pandora.UI.set({filters: filters});
+ } else if (data.id == 'setlocale') {
+ pandora.UI.set('locale', value);
+ pandora.setLocale(value, function() {
+ pandora.$ui.appPanel.reload();
+ });
} else if (data.id == 'settheme') {
var iframe, src;
Ox.Theme(value);
@@ -379,7 +423,7 @@ pandora.ui.mainMenu = function() {
pandora.localStorage('enableEventLogging', true);
}
Ox.Event[pandora.localStorage('enableEventLogging') ? 'bind' : 'unbind'](pandora.logEvent);
- that.setItemTitle('eventlogging', (pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging');
+ that.setItemTitle('eventlogging', Ox._((pandora.localStorage('enableEventLogging') ? 'Disable' : 'Enable') + ' Event Logging'));
} else if (data.id == 'errorlogs') {
pandora.$ui.logsDialog = pandora.ui.logsDialog().open();
} else if (data.id == 'tests') {
@@ -569,23 +613,23 @@ pandora.ui.mainMenu = function() {
]('findsimilar');
},
pandora_showannotations: function(data) {
- that.setItemTitle('showannotations', (data.value ? 'Hide' : 'Show') + ' Annotations');
+ that.setItemTitle('showannotations', Ox._((data.value ? 'Hide' : 'Show') + ' Annotations'));
},
pandora_showbrowser: function(data) {
- that.setItemTitle('showbrowser', (data.value ? 'Hide' : 'Show') + ' ' + pandora.site.itemName.singular + ' Browser');
+ that.setItemTitle('showbrowser', Ox._((data.value ? 'Hide' : 'Show') + ' {0} Browser', [Ox._(pandora.site.itemName.singular)]));
},
pandora_showfilters: function(data) {
- that.setItemTitle('showfilters', (data.value ? 'Hide' : 'Show') + ' Filters');
+ that.setItemTitle('showfilters', Ox._((data.value ? 'Hide' : 'Show') + ' Filters'));
},
pandora_showinfo: function(data) {
- that.setItemTitle('showinfo', (data.value ? 'Hide' : 'Show') + ' Info');
+ that.setItemTitle('showinfo', Ox._((data.value ? 'Hide' : 'Show') + ' Info'));
},
pandora_showsidebar: function(data) {
- that.setItemTitle('showsidebar', (data.value ? 'Hide' : 'Show') + ' Sidebar');
+ that.setItemTitle('showsidebar', Ox._((data.value ? 'Hide' : 'Show') + ' Sidebar'));
that[data.value ? 'enableItem' : 'disableItem']('showinfo');
},
pandora_showtimeline: function(data) {
- that.setItemTitle('showtimeline', (data.value ? 'Hide' : 'Show') + ' Timeline');
+ that.setItemTitle('showtimeline', Ox._((data.value ? 'Hide' : 'Show') + ' Timeline'));
},
pandora_videotimeline: function(data) {
that.checkItem('viewMenu_timelines_' + data.value);
@@ -593,7 +637,7 @@ pandora.ui.mainMenu = function() {
});
Ox.Fullscreen.bind('change', function(state) {
- that.setItemTitle('togglefullscreen', (state ? 'Exit' : 'Enter') + ' Fullscreen');
+ that.setItemTitle('togglefullscreen', Ox._((state ? 'Exit' : 'Enter') + ' Fullscreen'));
});
function changeFocus(direction) {
@@ -648,16 +692,16 @@ pandora.ui.mainMenu = function() {
}
function getListMenu(lists) {
- return { id: 'listMenu', title: 'List', items: [].concat(
- { id: 'allitems', title: 'All ' + pandora.site.itemName.plural, checked: !ui.item && !ui._list, keyboard: 'shift control w' },
+ return { id: 'listMenu', title: Ox._('List'), items: [].concat(
+ { id: 'allitems', title: Ox._('All {0}', [Ox._(pandora.site.itemName.plural)]), checked: !ui.item && !ui._list, keyboard: 'shift control w' },
['personal', 'favorite', 'featured'].map(function(folder) {
return {
id: folder + 'lists',
- title: Ox.toTitleCase(folder) + ' Lists',
+ title: Ox._('{0} Lists', [Ox._(Ox.toTitleCase(folder))]),
items: Ox.isUndefined(lists)
- ? [{id: 'loading', title: 'Loading...', disabled: true}]
+ ? [{id: 'loading', title: Ox._('Loading...'), disabled: true}]
: lists[folder].length == 0
- ? [{id: 'nolists', title: 'No ' + Ox.toTitleCase(folder) + ' Lists', disabled: true}]
+ ? [{id: 'nolists', title: Ox._('No {0} Lists', [Ox._(Ox.toTitleCase(folder))]), disabled: true}]
: lists[folder].map(function(list) {
return {
id: 'viewlist' + list.id,
@@ -671,17 +715,17 @@ pandora.ui.mainMenu = function() {
}),
[
{},
- { id: 'newlist', title: 'New List', disabled: isGuest, keyboard: 'control n' },
- { id: 'newlistfromselection', title: 'New List from Selection', disabled: isGuest || ui.listSelection.length == 0, keyboard: 'shift control n' },
- { id: 'newsmartlist', title: 'New Smart List', disabled: isGuest, keyboard: 'alt control n' },
- { id: 'newsmartlistfromresults', title: 'New Smart List from Results', disabled: isGuest, keyboard: 'shift alt control n' },
+ { id: 'newlist', title: Ox._('New List'), disabled: isGuest, keyboard: 'control n' },
+ { id: 'newlistfromselection', title: Ox._('New List from Selection'), disabled: isGuest || ui.listSelection.length == 0, keyboard: 'shift control n' },
+ { id: 'newsmartlist', title: Ox._('New Smart List'), disabled: isGuest, keyboard: 'alt control n' },
+ { id: 'newsmartlistfromresults', title: Ox._('New Smart List from Results'), disabled: isGuest, keyboard: 'shift alt control n' },
{},
- { id: 'duplicatelist', title: 'Duplicate Selected List', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control d' },
- { id: 'editlist', title: 'Edit Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'control e' },
- { id: 'deletelist', title: 'Delete Selected List...', disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
+ { id: 'duplicatelist', title: Ox._('Duplicate Selected List'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'control d' },
+ { id: 'editlist', title: Ox._('Edit Selected List...'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'control e' },
+ { id: 'deletelist', title: Ox._('Delete Selected List...'), disabled: isGuest || !pandora.user.ui._list, keyboard: 'delete' },
{},
- { id: 'print', title: 'Print', keyboard: 'control p' },
- { id: 'tv', title: 'TV', keyboard: 'control space' }
+ { id: 'print', title: Ox._('Print'), keyboard: 'control p' },
+ { id: 'tv', title: Ox._('TV'), keyboard: 'control space' }
]
)};
};
@@ -692,58 +736,68 @@ pandora.ui.mainMenu = function() {
clipItems = (isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
checked: ui.listSort[0].key == key.id,
- title: (!ui.item ? 'Clip ' : '') + key.title
+ title: (!ui.item ? Ox._('Clip') + ' ' : '') + Ox._(key.title)
});
}) : []).concat(!ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend({
checked: ui.listSort[0].key == key.id
}, key);
}) : []);
- return { id: 'sortMenu', title: 'Sort', items: [
- { id: 'sortitems', title: 'Sort ' + pandora.site.itemName.plural + ' by', disabled: !ui.item && isClipView, items: [
+ return { id: 'sortMenu', title: Ox._('Sort'), items: [
+ { id: 'sortitems', title: Ox._('Sort {0} by', [Ox._(pandora.site.itemName.plural)]), disabled: !ui.item && isClipView, items: [
{ group: 'itemsort', min: 1, max: 1, items: pandora.site.sortKeys.map(function(key) {
return Ox.extend({
checked: ui.listSort[0].key == key.id
- }, key);
+ }, key, {
+ title: Ox._(key.title)
+ });
}) }
] },
- { id: 'orderitems', title: 'Order ' + pandora.site.itemName.plural, disabled: !ui.item && isClipView, items: [
+ { id: 'orderitems', title: Ox._('Order {0}', [Ox._(pandora.site.itemName.plural)]), disabled: !ui.item && isClipView, items: [
{ group: 'itemorder', min: 1, max: 1, items: [
- { id: 'ascending', title: 'Ascending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
- { id: 'descending', title: 'Descending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
+ { id: 'ascending', title: Ox._('Ascending'), checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
+ { id: 'descending', title: Ox._('Descending'), checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
]}
] },
- { id: 'sortclips', title: 'Sort Clips by', disabled: !isClipView, items: [
+ { id: 'sortclips', title: Ox._('Sort Clips by'), disabled: !isClipView, items: [
{ group: 'clipsort', min: 1, max: 1, items: clipItems }
] },
- { id: 'orderclips', title: 'Order Clips', disabled: !isClipView, items: [
+ { id: 'orderclips', title: Ox._('Order Clips'), disabled: !isClipView, items: [
{ group: 'cliporder', min: 1, max: 1, items: [
- { id: 'ascending', title: 'Ascending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+' },
- { id: 'descending', title: 'Descending', checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-' }
+ {
+ id: 'ascending',
+ title: Ox._('Ascending'),
+ checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '+'
+ },
+ {
+ id: 'descending',
+ title: Ox._('Descending'),
+ checked: (ui.listSort[0].operator || pandora.getSortOperator(ui.listSort[0].key)) == '-'
+ }
]}
] },
- { id: 'advancedsort', title: 'Advanced Sort...', keyboard: 'shift control s', disabled: true },
+ { id: 'advancedsort', title: Ox._('Advanced Sort...'), keyboard: 'shift control s', disabled: true },
{},
- { id: 'sortfilters', title: 'Sort Filters', items: pandora.user.ui.filters.map(function(filter) {
+ { id: 'sortfilters', title: Ox._('Sort Filters'), items: pandora.user.ui.filters.map(function(filter) {
return {
id: 'sortfilter' + filter.id,
- title: 'Sort ' + Ox.getObjectById(pandora.site.filters, filter.id).title + ' Filter by',
+ title: Ox._('Sort {0} Filter by', [Ox._(Ox.getObjectById(pandora.site.filters, filter.id).title)]),
items: [
{ group: 'sortfilter' + filter.id, min: 1, max: 1, items: [
- { id: 'name', title: 'Name', checked: filter.sort[0].key == 'name' },
- { id: 'items', title: 'Items', checked: filter.sort[0].key == 'items' }
+ { id: 'name', title: Ox._('Name'), checked: filter.sort[0].key == 'name' },
+ { id: 'items', title: Ox._('Items'), checked: filter.sort[0].key == 'items' }
] }
]
}
}) },
- { id: 'orderfilters', title: 'Order Filters', items: pandora.user.ui.filters.map(function(filter) {
+ { id: 'orderfilters', title: Ox._('Order Filters'), items: pandora.user.ui.filters.map(function(filter) {
return {
id: 'orderfilter' + filter.id,
- title: 'Order ' + Ox.getObjectById(pandora.site.filters, filter.id).title + ' Filter',
+ title: Ox._('Order {0} Filter', [Ox._(Ox.getObjectById(pandora.site.filters, filter.id).title)]),
items: [
{ group: 'orderfilter' + filter.id, min: 1, max: 1, items: [
- { id: 'ascending', title: 'Ascending', checked: filter.sort[0].operator == '+' },
- { id: 'descending', title: 'Descending', checked: filter.sort[0].operator == '-' }
+ { id: 'ascending', title: Ox._('Ascending'), checked: filter.sort[0].operator == '+' },
+ { id: 'descending', title: Ox._('Descending'), checked: filter.sort[0].operator == '-' }
] }
]
}
diff --git a/static/js/pandora/makeListPrivateDialog.js b/static/js/pandora/makeListPrivateDialog.js
index fa6d75b3..4344fa58 100644
--- a/static/js/pandora/makeListPrivateDialog.js
+++ b/static/js/pandora/makeListPrivateDialog.js
@@ -6,7 +6,7 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
buttons: [
Ox.Button({
id: 'keep',
- title: 'Keep List Public'
+ title: Ox._('Keep List Public')
}).bindEvent({
click: function() {
that.close();
@@ -15,7 +15,7 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
}),
Ox.Button({
id: 'make',
- title: 'Make List Private'
+ title: Ox._('Make List Private')
}).bindEvent({
click: function() {
that.close();
@@ -24,13 +24,11 @@ pandora.ui.makeListPrivateDialog = function(name, subscribers, callback) {
})
],
keys: {enter: 'make', escape: 'keep'},
- text: 'Are you sure you want to make the list "'
- + name + '" private and lose its '
- + (subscribers == 1 ? 'subscriber' : subscribers + ' subscribers')
- + '?',
- title: 'Make List Private'
+ text: Ox._('Are you sure you want to make the list "{0}" private and loose its {1}?',
+ [name, subscribers == 1 ? Ox._('subscriber') : Ox._('{0} subscribers', [subscribers])]),
+ title: Ox._('Make List Private')
});
return that;
-};
\ No newline at end of file
+};
diff --git a/static/js/pandora/metadataDialog.js b/static/js/pandora/metadataDialog.js
index c06b77ae..ea7cde94 100644
--- a/static/js/pandora/metadataDialog.js
+++ b/static/js/pandora/metadataDialog.js
@@ -31,7 +31,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'close',
- title: 'Not Now'
+ title: Ox._('Not Now')
})
.bindEvent({
click: function() {
@@ -41,7 +41,7 @@ pandora.ui.metadataDialog = function(data) {
Ox.Button({
distabled: true,
id: 'update',
- title: 'Update IMDb Id...'
+ title: Ox._('Update IMDb ID...')
})
.bindEvent({
click: function() {
@@ -51,10 +51,9 @@ pandora.ui.metadataDialog = function(data) {
})
],
keyboard: {enter: 'update', escape: 'close'},
- text: 'To update the metadata for this '
- + pandora.site.itemName.singular.toLowerCase()
- + ', please enter its IMDb ID.',
- title: 'Update Metadata'
+ text: Ox._('To update the metadata for this {0}, please enter its IMDb ID.',
+ [pandora.site.itemName.singular.toLowerCase()]),
+ title: Ox._('Update Metadata')
});
}
@@ -63,7 +62,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'switch',
- title: 'Update IMDb Id...'
+ title: Ox._('Update IMDb ID...')
})
.bindEvent({
click: function() {
@@ -74,7 +73,7 @@ pandora.ui.metadataDialog = function(data) {
{},
Ox.Button({
id: 'cancel',
- title: 'Don\'t Update'
+ title: Ox._('Don\'t Update')
})
.bindEvent({
click: function() {
@@ -84,7 +83,8 @@ pandora.ui.metadataDialog = function(data) {
Ox.Button({
disabled: true,
id: 'update',
- title: 'Update Metadata...'
+ title: Ox._('Update Metadata...')
+
})
.bindEvent({
click: function() {
@@ -99,7 +99,7 @@ pandora.ui.metadataDialog = function(data) {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
- title: 'Update Metadata',
+ title: Ox._('Update Metadata'),
width: dialogWidth
})
.bindEvent({
@@ -112,7 +112,7 @@ pandora.ui.metadataDialog = function(data) {
buttons: [
Ox.Button({
id: 'cancel',
- title: 'Don\'t Update'
+ title: Ox._('Don\'t Update')
})
.bindEvent({
click: function() {
@@ -121,7 +121,7 @@ pandora.ui.metadataDialog = function(data) {
}),
Ox.Button({
id: 'update',
- title: 'Update'
+ title: Ox._('Update')
})
.bindEvent({
click: function() {
@@ -132,16 +132,16 @@ pandora.ui.metadataDialog = function(data) {
],
height: 192,
keyboard: {enter: 'update', escape: 'cancel'},
- text: 'Are you sure you want to update the value'
+ text: Ox._('Are you sure you want to update the value'
+ (updateKeys.length == 1 ? '' : 's')
- + ' for ' + updateKeys.map(function(key, index) {
+ + ' for {0}?', [updateKeys.map(function(key, index) {
return (
index == 0 ? ''
: index < updateKeys.length - 1 ? ', '
- : ' and '
+ : ' ' + Ox._('and') + ' '
) + getTitle(key)
- }).join('') + '?',
- title: 'Update Metadata'
+ }).join('')]),
+ title: Ox._('Update Metadata')
});
}
@@ -175,7 +175,7 @@ pandora.ui.metadataDialog = function(data) {
orientation: 'vertical'
});
$selectNoneButton = Ox.Button({
- title: 'Select No Updates',
+ title: Ox._('Select No Updates'),
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
.bindEvent({
@@ -185,7 +185,7 @@ pandora.ui.metadataDialog = function(data) {
})
.appendTo($bar),
$selectAllButton = Ox.Button({
- title: 'Select All Updates',
+ title: Ox._('Select All Updates'),
})
.css({float: 'left', margin: '4px 2px 4px 2px'})
.bindEvent({
@@ -265,8 +265,10 @@ pandora.ui.metadataDialog = function(data) {
}
function getTitle(key) {
- return key == 'alternativeTitles' ? 'Alternative Titles'
- : Ox.getObjectById(pandora.site.itemKeys, key).title;
+ return key == Ox._(
+ 'alternativeTitles' ? 'Alternative Titles'
+ : Ox.getObjectById(pandora.site.itemKeys, key).title
+ );
}
function getUpdateKeys() {
diff --git a/static/js/pandora/namesDialog.js b/static/js/pandora/namesDialog.js
index 5aa1b28c..94fafd82 100644
--- a/static/js/pandora/namesDialog.js
+++ b/static/js/pandora/namesDialog.js
@@ -34,7 +34,7 @@ pandora.ui.namesDialog = function() {
columns: [
{
id: 'id',
- title: 'ID',
+ title: Ox._('ID'),
visible: false,
width: 0
},
@@ -42,7 +42,7 @@ pandora.ui.namesDialog = function() {
id: 'name',
operator: '+',
removable: false,
- title: 'Name',
+ title: Ox._('Name'),
visible: true,
width: 256
},
@@ -50,8 +50,8 @@ pandora.ui.namesDialog = function() {
editable: true,
id: 'sortname',
operator: '+',
- title: 'Sort Name',
- tooltip: 'Edit Sort Name',
+ title: Ox._('Sort Name'),
+ tooltip: Ox._('Edit Sort Name'),
visible: true,
width: 256
},
@@ -59,7 +59,7 @@ pandora.ui.namesDialog = function() {
id: 'numberofnames',
align: 'right',
operator: '-',
- title: 'Names',
+ title: Ox._('Names'),
visible: true,
width: 64
},
@@ -98,7 +98,7 @@ pandora.ui.namesDialog = function() {
$findButton = Ox.Button({
disabled: true,
- title: 'Find',
+ title: Ox._('Find'),
width: 48
}).bindEvent({
click: function() {
@@ -118,7 +118,7 @@ pandora.ui.namesDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
- title: 'Manage Titles...'
+ title: Ox._('Manage Titles...')
}).bindEvent({
click: function() {
that.close();
@@ -130,7 +130,7 @@ pandora.ui.namesDialog = function() {
{},
$findButton,
Ox.Button({
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -160,7 +160,7 @@ pandora.ui.namesDialog = function() {
minHeight: 256,
minWidth: 512,
padding: 0,
- title: 'Manage Names',
+ title: Ox._('Manage Names'),
width: width
})
.bindEvent({
diff --git a/static/js/pandora/navigationView.js b/static/js/pandora/navigationView.js
index f811e4b4..ffcda74b 100644
--- a/static/js/pandora/navigationView.js
+++ b/static/js/pandora/navigationView.js
@@ -92,7 +92,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
resizable: true,
resize: listSizes,
size: listSize,
- tooltip: 'clips'
+ tooltip: Ox._('clips')
}
],
orientation: 'horizontal'
@@ -206,7 +206,7 @@ pandora.ui.navigationView = function(type, videoRatio) {
function selectItem(data) {
var id = data.id || '';
if (id && id[0] != '_') {
- $status.html('Loading...');
+ $status.html(Ox._('Loading...'));
$list.options({
items: function(data, callback) {
var itemsQuery;
diff --git a/static/js/pandora/news.js b/static/js/pandora/news.js
index 98db33d1..a9c1ce14 100644
--- a/static/js/pandora/news.js
+++ b/static/js/pandora/news.js
@@ -29,7 +29,7 @@ pandora.ui.news = function(width, height) {
function addItem() {
pandora.api.addNews({
- title: 'Untitled',
+ title: Ox._('Untitled'),
date: Ox.formatDate(new Date(), '%Y-%m-%d'),
text: ''
}, function(result) {
@@ -136,7 +136,7 @@ pandora.ui.news = function(width, height) {
.css({height: '16px', marginBottom: '8px'})
.append(
Ox.Button({
- title: 'Add',
+ title: Ox._('Add'),
width: 92
})
.css({float: 'left', margin: '0 4px 0 0'})
@@ -146,7 +146,7 @@ pandora.ui.news = function(width, height) {
)
.append(
Ox.Button({
- title: 'Remove',
+ title: Ox._('Remove'),
width: 92
})
.css({float: 'left', margin: '0 0 0 4px'})
diff --git a/static/js/pandora/onloadDialog.js b/static/js/pandora/onloadDialog.js
index 7cdc9c4d..42014eb8 100644
--- a/static/js/pandora/onloadDialog.js
+++ b/static/js/pandora/onloadDialog.js
@@ -9,9 +9,9 @@ pandora.ui.onloadDialog = function() {
$input = Ox.Input({
height: dialogHeight - 32,
id: 'onload',
- placeholder: '/*\nAny JavaScript you paste here will run on load.\n'
+ placeholder: Ox._('/*\nAny JavaScript you paste here will run on load.\n'
+ 'If you ever need to manually change or remove it, '
- + 'you can do so by setting localStorage["pandora.onload"] in the console.\n*/',
+ + 'you can do so by setting localStorage["pandora.onload"] in the console.\n*/'),
type: 'textarea',
value: localStorage['pandora.onload'] || '',
width: dialogWidth - 32
@@ -20,7 +20,7 @@ pandora.ui.onloadDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
- title: 'Clear'
+ title: Ox._('Clear')
})
.css({margin: '4px 4px 4px 0'})
.bindEvent({
@@ -30,7 +30,7 @@ pandora.ui.onloadDialog = function() {
}),
Ox.Button({
id: 'done',
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -45,7 +45,7 @@ pandora.ui.onloadDialog = function() {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
- title: 'Run Script on Load',
+ title: Ox._('Run Script on Load'),
width: dialogWidth
})
.bindEvent({
diff --git a/static/js/pandora/placesDialog.js b/static/js/pandora/placesDialog.js
index 29b1586a..10412397 100644
--- a/static/js/pandora/placesDialog.js
+++ b/static/js/pandora/placesDialog.js
@@ -79,7 +79,7 @@ pandora.ui.placesDialog = function(options) {
buttons: [
Ox.Button({
id: 'manageEvents',
- title: 'Manage Events...'
+ title: Ox._('Manage Events...')
}).bindEvent({
click: function() {
that.close();
@@ -91,7 +91,7 @@ pandora.ui.placesDialog = function(options) {
{},
Ox.Button({
id: 'done',
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -107,7 +107,7 @@ pandora.ui.placesDialog = function(options) {
minWidth: 512,
//keys: {enter: 'done', escape: 'done'},
padding: 0,
- title: 'Manage Places',
+ title: Ox._('Manage Places'),
width: width
})
.bindEvent({
diff --git a/static/js/pandora/preferencesDialog.js b/static/js/pandora/preferencesDialog.js
index de640c8f..7fec10b2 100644
--- a/static/js/pandora/preferencesDialog.js
+++ b/static/js/pandora/preferencesDialog.js
@@ -3,8 +3,8 @@
pandora.ui.preferencesDialog = function() {
var tabs = [
- {id: 'account', title: 'Account', selected: true},
- {id: 'advanced', title: 'Advanced'}
+ {id: 'account', title: Ox._('Account'), selected: true},
+ {id: 'advanced', title: Ox._('Advanced')}
],
$tabPanel = Ox.TabPanel({
content: function(id) {
@@ -28,7 +28,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
disabled: true,
id: 'username',
- label: 'Username',
+ label: Ox._('Username'),
labelWidth: 120,
value: pandora.user.username,
width: 320
@@ -36,7 +36,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
autovalidate: /.+/,
id: 'password',
- label: 'New Password',
+ label: Ox._('New Password'),
labelWidth: 120,
type: 'password',
validate: pandora.validateNewPassword,
@@ -50,7 +50,7 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
autovalidate: pandora.autovalidateEmail,
id: 'email',
- label: 'E-Mail Address',
+ label: Ox._('E-Mail Address'),
labelWidth: 120,
validate: pandora.validateNewEmail,
value: pandora.user.email,
@@ -67,16 +67,16 @@ pandora.ui.preferencesDialog = function() {
Ox.Input({
disabled: true,
id: 'level',
- label: 'Level',
+ label: Ox._('Level'),
labelWidth: 120,
value: Ox.toTitleCase(pandora.user.level),
width: 320
}),
Ox.Checkbox({
id: 'newsletter',
- label: 'Newsletter',
+ label: Ox._('Newsletter'),
labelWidth: 120,
- title: pandora.user.newsletter ? 'Subscribed' : 'Unsubscribed',
+ title: pandora.user.newsletter ? Ox._('Subscribed') : Ox._('Unsubscribed'),
value: pandora.user.newsletter,
width: 320
})
@@ -84,7 +84,7 @@ pandora.ui.preferencesDialog = function() {
change: function(data) {
pandora.user.newsletter = data.value;
this.options({
- title: pandora.user.newsletter ? 'Subscribed' : 'Unsubscribed'
+ title: pandora.user.newsletter ? Ox._('Subscribed') : Ox._('Unsubscribed')
});
pandora.api.editPreferences({
newsletter: pandora.user.newsletter
@@ -99,7 +99,7 @@ pandora.ui.preferencesDialog = function() {
} else {
$content.append(
Ox.Button({
- title: 'Reset UI Settings...',
+ title: Ox._('Reset UI Settings...'),
width: 160
})
.bindEvent({
@@ -111,7 +111,7 @@ pandora.ui.preferencesDialog = function() {
);
$content.append(
Ox.Button({
- title: 'Run Script on Load...',
+ title: Ox._('Run Script on Load...'),
width: 160
})
.bindEvent({
@@ -130,7 +130,7 @@ pandora.ui.preferencesDialog = function() {
buttons: [
Ox.Button({
id: 'signout',
- title: 'Sign Out...'
+ title: Ox._('Sign Out...')
}).bindEvent({
click: function() {
pandora.UI.set({page: 'signout'});
@@ -139,7 +139,7 @@ pandora.ui.preferencesDialog = function() {
{},
Ox.Button({
id: 'done',
- title: 'Done'
+ title: Ox._('Done')
}).bindEvent({
click: function() {
$dialog.close();
@@ -151,7 +151,7 @@ pandora.ui.preferencesDialog = function() {
height: 192,
minHeight: 192,
minWidth: 432,
- title: 'Preferences',
+ title: Ox._('Preferences'),
width: 432
})
.bindEvent({
diff --git a/static/js/pandora/publicLists.js b/static/js/pandora/publicLists.js
index 8ffd75ed..a374195e 100644
--- a/static/js/pandora/publicLists.js
+++ b/static/js/pandora/publicLists.js
@@ -5,7 +5,7 @@ pandora.ui.publicListsDialog = function() { // fixme: unused
buttons: [
Ox.Button({
id: 'done',
- title: 'Done'
+ title: Ox._('Done')
}).bindEvent({
click: function() {
that.close();
@@ -16,7 +16,7 @@ pandora.ui.publicListsDialog = function() { // fixme: unused
height: 320,
keys: {enter: 'close', escape: 'close'},
padding: 0,
- title: 'Public Lists',
+ title: Ox._('Public Lists'),
width: 420
})
.css({
diff --git a/static/js/pandora/resetUIDialog.js b/static/js/pandora/resetUIDialog.js
index 4f8a5f8d..2a387ea0 100644
--- a/static/js/pandora/resetUIDialog.js
+++ b/static/js/pandora/resetUIDialog.js
@@ -7,7 +7,7 @@ pandora.ui.resetUIDialog = function(data) {
buttons: [
Ox.Button({
id: 'cancel',
- title: 'Don\'t Reset'
+ title: Ox._('Don\'t Reset')
})
.bindEvent({
click: function() {
@@ -16,7 +16,7 @@ pandora.ui.resetUIDialog = function(data) {
}),
Ox.Button({
id: 'reset',
- title: 'Reset'
+ title: Ox._('Reset')
}).bindEvent({
click: function() {
that.close();
@@ -27,10 +27,10 @@ pandora.ui.resetUIDialog = function(data) {
})
],
keys: {enter: 'reset', escape: 'cancel'},
- text: 'Are you sure you want to reset all UI settings?',
- title: 'Reset UI Settings'
+ text: Ox._('Are you sure you want to reset all UI settings?'),
+ title: Ox._('Reset UI Settings')
});
return that;
-};
\ No newline at end of file
+};
diff --git a/static/js/pandora/sectionButtons.js b/static/js/pandora/sectionButtons.js
index 826a1cc1..470bc7b6 100644
--- a/static/js/pandora/sectionButtons.js
+++ b/static/js/pandora/sectionButtons.js
@@ -4,8 +4,8 @@ pandora.ui.sectionButtons = function() {
var that = Ox.ButtonGroup({
buttons: [
{id: 'items', title: pandora.site.itemName.plural},
- {id: 'edits', title: 'Edits', disabled: true},
- {id: 'texts', title: 'Texts', disabled: pandora.user.level != 'admin'}
+ {id: 'edits', title: Ox._('Edits'), disabled: true},
+ {id: 'texts', title: Ox._('Texts'), disabled: pandora.user.level != 'admin'}
],
id: 'sectionButtons',
selectable: true,
diff --git a/static/js/pandora/sectionSelect.js b/static/js/pandora/sectionSelect.js
index 4a03da6c..42ced846 100644
--- a/static/js/pandora/sectionSelect.js
+++ b/static/js/pandora/sectionSelect.js
@@ -6,8 +6,8 @@ pandora.ui.sectionSelect = function() {
id: 'sectionSelect',
items: [
{id: 'items', title: pandora.site.itemName.plural},
- {id: 'edits', title: 'Edits', disabled: true},
- {id: 'texts', title: 'Texts', disabled: true}
+ {id: 'edits', title: Ox._('Edits'), disabled: true},
+ {id: 'texts', title: Ox._('Texts'), disabled: true}
],
value: pandora.user.ui.section
}).css({
diff --git a/static/js/pandora/sequencesDialog.js b/static/js/pandora/sequencesDialog.js
index facd15b6..4513dde1 100644
--- a/static/js/pandora/sequencesDialog.js
+++ b/static/js/pandora/sequencesDialog.js
@@ -48,8 +48,8 @@ pandora.ui.sequencesDialog = function() {
$modeButtons = Ox.ButtonGroup({
buttons: [
- {id: 'shape', title: 'Similar Shapes'},
- {id: 'color', title: 'Similar Colors'}
+ {id: 'shape', title: Ox._('Similar Shapes')},
+ {id: 'color', title: Ox._('Similar Colors')}
],
selectable: true,
value: pandora.user.ui.sequenceMode
@@ -89,9 +89,12 @@ pandora.ui.sequencesDialog = function() {
$sortSelect = Ox.Select({
items: ['title', 'director', 'position', 'duration'].map(function(id) {
+ var item = Ox.getObjectById(pandora.site.itemKeys, id)
+ || Ox.getObjectById(pandora.site.clipKeys, id),
+ title = Ox._(item ? item.title : Ox.toTitleCase(id));
return {
id: id,
- title: 'Sort by ' + Ox.toTitleCase(id)
+ title: Ox._('Sort by {0}', [title])
};
}),
value: pandora.user.ui.sequenceSort[0].key,
@@ -124,14 +127,14 @@ pandora.ui.sequencesDialog = function() {
Ox.Button({
disabled: true,
id: 'open',
- title: 'Open Selected Clip',
+ title: Ox._('Open Selected Clip'),
width: 128
}).bindEvent({
click: openClip
}),
Ox.Button({
id: 'close',
- title: 'Close',
+ title: Ox._('Close'),
width: 64
}).bindEvent({
click: function() {
@@ -146,7 +149,7 @@ pandora.ui.sequencesDialog = function() {
maximizeButton: true,
padding: 0,
removeOnClose: true,
- title: 'Similar Clips',
+ title: Ox._('Similar Clips'),
width: dialogSize.width
})
.bindEvent({
@@ -181,7 +184,7 @@ pandora.ui.sequencesDialog = function() {
fontSize: '9px',
textAlign: 'center'
})
- .html('Loading...')
+ .html(Ox._('Loading...'))
.appendTo($statusbar);
getClips();
@@ -196,7 +199,7 @@ pandora.ui.sequencesDialog = function() {
function getClips() {
$dialog && $dialog.disableButton('open');
- $status && $status.html('Loading...');
+ $status && $status.html(Ox._('Loading...'));
pandora.api.get({
id: item.id,
keys: ['director', 'duration', 'title', 'videoRatio']
diff --git a/static/js/pandora/siteDialog.0xdb.js b/static/js/pandora/siteDialog.0xdb.js
index 95575c2c..bd816223 100644
--- a/static/js/pandora/siteDialog.0xdb.js
+++ b/static/js/pandora/siteDialog.0xdb.js
@@ -8,7 +8,7 @@ pandora.ui.siteDialog = function(section) {
dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
dialogWidth = Math.round(window.innerWidth * 0.75),
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
- tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: 'Software'}]);
+ tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: Ox._('Software')}]);
Ox.getObjectById(tabs, section).selected = true;
var $tabPanel = Ox.TabPanel({
content: function(id) {
@@ -50,7 +50,7 @@ pandora.ui.siteDialog = function(section) {
editable: isEditable,
tooltip: isEditable ? pandora.getEditTooltip() : '',
type: 'textarea',
- placeholder: isEditable ? 'Doubleclick to insert text' : '',
+ placeholder: isEditable ? Ox._('Doubleclick to insert text') : '',
value: result.data.text
})
.css(id == 'rights' ? {
@@ -137,7 +137,7 @@ pandora.ui.siteDialog = function(section) {
buttons: [
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
diff --git a/static/js/pandora/siteDialog.js b/static/js/pandora/siteDialog.js
index 1012efe0..aceca945 100644
--- a/static/js/pandora/siteDialog.js
+++ b/static/js/pandora/siteDialog.js
@@ -8,7 +8,7 @@ pandora.ui.siteDialog = function(section) {
dialogHeight = Math.round((window.innerHeight - 48) * 0.75),
dialogWidth = Math.round(window.innerWidth * 0.75),
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
- tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: 'Software'}]);
+ tabs = Ox.clone(pandora.site.sitePages, true).concat([{id: 'software', title: Ox._('Software')}]);
Ox.getObjectById(tabs, section).selected = true;
var $tabPanel = Ox.TabPanel({
content: function(id) {
@@ -50,7 +50,7 @@ pandora.ui.siteDialog = function(section) {
editable: isEditable,
tooltip: isEditable ? pandora.getEditTooltip() : '',
type: 'textarea',
- placeholder: isEditable ? 'Doubleclick to insert text' : '',
+ placeholder: isEditable ? Ox._('Doubleclick to insert text') : '',
value: result.data.text
})
.css({
@@ -104,7 +104,7 @@ pandora.ui.siteDialog = function(section) {
buttons: [
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
}).bindEvent({
click: function() {
that.close();
diff --git a/static/js/pandora/sortElement.js b/static/js/pandora/sortElement.js
index 94a8fa51..a00cb8a1 100644
--- a/static/js/pandora/sortElement.js
+++ b/static/js/pandora/sortElement.js
@@ -9,13 +9,13 @@ pandora.ui.sortElement = function(isNavigationView) {
items = (
isClipView ? pandora.site.clipKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
- title: 'Sort by ' + (!pandora.user.ui.item ? 'Clip ' : '') + key.title
+ title: Ox._((!pandora.user.ui.item ? 'Sort by Clip {0}' : 'Sort by {0}'), [Ox._(key.title)])
});
}) : []
).concat(
!pandora.user.ui.item ? pandora.site.sortKeys.map(function(key) {
return Ox.extend(Ox.clone(key), {
- title: 'Sort by ' + key.title
+ title: Ox._('Sort by {0}', [Ox._(key.title)])
});
}) : []
),
@@ -62,11 +62,11 @@ pandora.ui.sortElement = function(isNavigationView) {
.bindEvent('pandora_' + sortKey.toLowerCase(), updateElement);
function getButtonTitle() {
- return pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down';
+ return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'up' : 'down');
}
function getButtonTooltip() {
- return pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending';
+ return Ox._(pandora.user.ui[sortKey][0].operator == '+' ? 'Ascending' : 'Descending');
}
function updateElement() {
@@ -79,4 +79,4 @@ pandora.ui.sortElement = function(isNavigationView) {
return that;
-};
\ No newline at end of file
+};
diff --git a/static/js/pandora/sortMenu.js b/static/js/pandora/sortMenu.js
index c95c4a65..965ca7a0 100644
--- a/static/js/pandora/sortMenu.js
+++ b/static/js/pandora/sortMenu.js
@@ -12,16 +12,16 @@ pandora.ui.sortMenu = function() {
return Ox.extend(Ox.clone(key), {
checked: key.id == pandora.user.ui.itemSort[0].key,
id: key.id,
- title: 'Sort by ' + key.title
+ title: Ox._('Sort by {0}', [key.title])
});
}),
[
{},
- {id: 'ascending', title: 'Ascending', checked: pandora.user.ui.itemSort[0].operator == '+'},
- {id: 'descending', title: 'Descending', checked: pandora.user.ui.itemSort[0].operator == '-'}
+ {id: 'ascending', title: Ox._('Ascending'), checked: pandora.user.ui.itemSort[0].operator == '+'},
+ {id: 'descending', title: Ox._('Descending'), checked: pandora.user.ui.itemSort[0].operator == '-'}
]
),
- tooltip: 'Sort clips',
+ tooltip: Ox._('Sort clips'),
type: 'image'
})
.css({float: 'left', margin: '2px'})
@@ -50,4 +50,4 @@ pandora.ui.sortMenu = function() {
return that;
-};
\ No newline at end of file
+};
diff --git a/static/js/pandora/statisticsDialog.js b/static/js/pandora/statisticsDialog.js
index 4d81eea9..cce7a736 100644
--- a/static/js/pandora/statisticsDialog.js
+++ b/static/js/pandora/statisticsDialog.js
@@ -36,16 +36,16 @@ pandora.ui.statisticsDialog = function() {
dialogHeight = Math.round((window.innerHeight - 48) * 0.9),
dialogWidth = Math.round(window.innerWidth * 0.9),
tabs = [
- {id: 'seen', title: 'First Seen & Last Seen', selected: true},
- {id: 'locations', title: 'Locations'},
- {id: 'platforms', title: 'Platforms & Browsers'}
+ {id: 'seen', title: Ox._('First Seen & Last Seen'), selected: true},
+ {id: 'locations', title: Ox._('Locations')},
+ {id: 'platforms', title: Ox._('Platforms & Browsers')}
],
$dialog = Ox.Dialog({
buttons: [
Ox.Button({
id: 'manageUsers',
- title: 'Manage Users...'
+ title: Ox._('Manage Users...')
}).bindEvent({
click: function() {
$dialog.close();
@@ -55,7 +55,7 @@ pandora.ui.statisticsDialog = function() {
{},
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
}).bindEvent({
click: function() {
$dialog.close();
@@ -69,7 +69,7 @@ pandora.ui.statisticsDialog = function() {
minHeight: 256,
minWidth: 512,
removeOnClose: true,
- title: 'Statistics',
+ title: Ox._('Statistics'),
width: dialogWidth
})
.bindEvent({
@@ -248,7 +248,7 @@ pandora.ui.statisticsDialog = function() {
});
$guestsCheckbox = Ox.Checkbox({
- title: 'Include Guests',
+ title: Ox._('Include Guests'),
value: false
})
.css({float: 'left', margin: '4px'})
diff --git a/static/js/pandora/statusbar.js b/static/js/pandora/statusbar.js
index 51888d5c..4e615210 100644
--- a/static/js/pandora/statusbar.js
+++ b/static/js/pandora/statusbar.js
@@ -5,11 +5,11 @@
pandora.ui.statusbar = function() {
var $text = {
- titleTotal: Ox.Element('
').html('Total: '),
+ titleTotal: Ox.Element('').html(Ox._('Total: ')),
total: Ox.Element(''),
- titleSelected: Ox.Element('').html(' — Selected: '),
+ titleSelected: Ox.Element('').html(' — ' + Ox._('Selected: ')),
selected: Ox.Element(''),
- loading: Ox.Element('').html('Loading...')
+ loading: Ox.Element('').html(Ox._('Loading...'))
},
that = Ox.Bar({size: 16})
diff --git a/static/js/pandora/textPanel.js b/static/js/pandora/textPanel.js
index e1dae1b7..07395019 100644
--- a/static/js/pandora/textPanel.js
+++ b/static/js/pandora/textPanel.js
@@ -27,7 +27,7 @@ pandora.ui.textPanel = function() {
$find = Ox.Input({
clear: true,
- placeholder: 'Find in Texts',
+ placeholder: Ox._('Find in Texts'),
value: pandora.user.ui.textFind,
width: 188
})
@@ -45,7 +45,7 @@ pandora.ui.textPanel = function() {
$nextButton = Ox.Button({
disabled: embedURLs.length < 2,
title: 'arrowRight',
- tooltip: 'Next Clip',
+ tooltip: Ox._('Next Clip'),
type: 'image'
})
.css({
@@ -64,7 +64,7 @@ pandora.ui.textPanel = function() {
$currentButton = Ox.Button({
disabled: embedURLs.length < 1,
title: 'center',
- tooltip: 'Current Reference',
+ tooltip: Ox._('Current Reference'),
type: 'image'
})
.css({
@@ -76,7 +76,7 @@ pandora.ui.textPanel = function() {
$previousButton = Ox.Button({
disabled: embedURLs.length < 2,
title: 'arrowLeft',
- tooltip: 'Previous Clip',
+ tooltip: Ox._('Previous Clip'),
type: 'image'
})
.css({
@@ -116,11 +116,11 @@ pandora.ui.textPanel = function() {
if (text.type == 'html') {
$editMenu = Ox.MenuButton({
items: [
- {id: 'insertHTML', title: 'Insert HTML...'},
- {id: 'insertEmbed', title: 'Insert Embed...'}
+ {id: 'insertHTML', title: Ox._('Insert HTML...')},
+ {id: 'insertEmbed', title: Ox._('Insert Embed...')}
],
title: 'edit',
- tooltip: 'Editing Options',
+ tooltip: Ox._('Editing Options'),
type: 'image'
})
.css({
@@ -140,7 +140,7 @@ pandora.ui.textPanel = function() {
} else {
$uploadButton = Ox.FileButton({
image: 'upload',
- tooltip: 'Upload PDF',
+ tooltip: Ox._('Upload PDF'),
type: 'image'
})
.css({
@@ -222,9 +222,9 @@ pandora.ui.textHTML = function(text) {
$title = Ox.Editable({
editable: text.name ? text.editable : false,
height: 32,
- placeholder: text.editable ? 'Doubleclick to edit title' : 'Untitled',
+ placeholder: text.editable ? Ox._('Doubleclick to edit title') : Ox._('Untitled'),
tooltip: text.editable ? pandora.getEditTooltip('title') : '',
- value: text.name || pandora.site.site.name + ' Texts',
+ value: text.name || Ox._('{0} Texts', [pandora.site.site.name]),
width: width
})
.css({
@@ -272,7 +272,7 @@ pandora.ui.textHTML = function(text) {
);
},
maxHeight: height - 1,
- placeholder: text.editable ? 'Doubleclick to edit text' : '',
+ placeholder: text.editable ? Ox._('Doubleclick to edit text') : '',
tooltip: text.editable ? pandora.getEditTooltip('text') : '',
type: 'textarea',
width: width,
diff --git a/static/js/pandora/titlesDialog.js b/static/js/pandora/titlesDialog.js
index a1ecc15c..84ed5ba7 100644
--- a/static/js/pandora/titlesDialog.js
+++ b/static/js/pandora/titlesDialog.js
@@ -32,14 +32,14 @@ pandora.ui.titlesDialog = function() {
columns: [
{
id: 'id',
- title: 'ID',
+ title: Ox._('ID'),
visible: false
},
{
id: 'title',
operator: '+',
removable: false,
- title: 'Title',
+ title: Ox._('Title'),
visible: true,
width: 256
},
@@ -47,7 +47,7 @@ pandora.ui.titlesDialog = function() {
editable: true,
id: 'sorttitle',
operator: '+',
- title: 'Sort Title',
+ title: Ox._('Sort Title'),
visible: true,
width: 256
},
@@ -87,7 +87,7 @@ pandora.ui.titlesDialog = function() {
$findButton = Ox.Button({
disabled: true,
- title: 'Find',
+ title: Ox._('Find'),
width: 48
}).bindEvent({
click: function() {
@@ -107,7 +107,7 @@ pandora.ui.titlesDialog = function() {
that = Ox.Dialog({
buttons: [
Ox.Button({
- title: 'Manage Names...'
+ title: Ox._('Manage Names...')
}).bindEvent({
click: function() {
that.close();
@@ -119,7 +119,7 @@ pandora.ui.titlesDialog = function() {
{},
$findButton,
Ox.Button({
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -149,7 +149,7 @@ pandora.ui.titlesDialog = function() {
minHeight: 256,
minWidth: 512,
padding: 0,
- title: 'Manage Titles',
+ title: Ox._('Manage Titles'),
width: width
})
.bindEvent({
diff --git a/static/js/pandora/toolbar.js b/static/js/pandora/toolbar.js
index 9a1a500b..448b37ea 100644
--- a/static/js/pandora/toolbar.js
+++ b/static/js/pandora/toolbar.js
@@ -72,7 +72,7 @@ pandora.ui.toolbar = function() {
function getListName(listId) {
return '' + (
listId == ''
- ? 'All ' + pandora.site.itemName.plural
+ ? Ox._('All {0}', [pandora.site.itemName.plural])
: Ox.encodeHTMLEntities(listId.slice(listId.indexOf(':') + 1))
) + '';
}
diff --git a/static/js/pandora/tv.js b/static/js/pandora/tv.js
index d48ea398..b42d58f7 100644
--- a/static/js/pandora/tv.js
+++ b/static/js/pandora/tv.js
@@ -61,9 +61,9 @@ pandora.ui.tv = function() {
'volume', 'scale', 'timeline', 'position', 'settings'
],
controlsTooltips: {
- open: 'Open in ' + Ox.getObjectById(
+ open: Ox._('Open in {0} View', [Ox._(Ox.getObjectById(
pandora.site.itemViews, pandora.user.ui.videoView
- ).title + ' View'
+ ).title)])
},
controlsTop: ['close', 'title', 'open'],
duration: result.data.duration,
@@ -78,7 +78,7 @@ pandora.ui.tv = function() {
tooltips: true,
timeline: '/' + result.data.item + '/timeline16p.jpg',
title: pandora.site.site.name + ' — ' + (
- list || 'All ' + pandora.site.itemName.plural
+ list || Ox._('All {0}', [Ox._(pandora.site.itemName.plural)])
) + ' — '
+ result.data.title
+ (
diff --git a/static/js/pandora/uploadDialog.js b/static/js/pandora/uploadDialog.js
index 33f89fcf..178b9d98 100644
--- a/static/js/pandora/uploadDialog.js
+++ b/static/js/pandora/uploadDialog.js
@@ -11,23 +11,23 @@ pandora.ui.uploadDialog = function(data) {
$closeButton,
$content = Ox.Element().css({margin: '16px'}),
$info = $('').css({padding: '4px'})
- .html('Please select the video file you want to upload.'),
+ .html(Ox._('Please select the video file you want to upload.')),
$progress,
$status = $('
').css({padding: '4px', paddingTop: '8px'}),
that = Ox.Dialog({
buttons: [
$closeButton = Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
}).css({
float: 'left'
}).bindEvent({
click: function() {
- if ($closeButton.options('title') == 'Cancel') {
+ if ($closeButton.options('title') == Ox._('Cancel')) {
cancelled = true;
pandora.firefogg && pandora.firefogg.cancel();
pandora.$ui.upload && pandora.$ui.upload.abort();
- $closeButton.options('title', 'Close');
+ $closeButton.options('title', Ox._('Close'));
$actionButton.show();
} else {
that.triggerEvent('close');
@@ -36,35 +36,35 @@ pandora.ui.uploadDialog = function(data) {
}),
$actionButton = hasFirefogg ? Ox.Button({
id: 'action',
- title: 'Select Video'
+ title: Ox._('Select Video')
}).bindEvent({
click: function() {
- if ($actionButton.options('title') == 'Select Video') {
+ if ($actionButton.options('title') == Ox._('Select Video')) {
if (selectVideo()) {
- $actionButton.options('title', 'Upload');
+ $actionButton.options('title', Ox._('Upload'));
}
- } else if ($actionButton.options('title') == 'Cancel') {
+ } else if ($actionButton.options('title') == Ox._('Cancel')) {
cancelled = true;
pandora.firefogg && pandora.firefogg.cancel();
pandora.$ui.upload && pandora.$ui.upload.abort();
- $actionButton.options('title', 'Select Video');
+ $actionButton.options('title', Ox._('Select Video'));
$closeButton.show();
} else {
- $closeButton.options('title', 'Cancel');
- $actionButton.hide().options('title', 'Select Video');
+ $closeButton.options('title', Ox._('Cancel'));
+ $actionButton.hide().options('title', Ox._('Select Video'));
encode();
}
}
}) : Ox.FileButton({
id: 'action',
- title: 'Select Video',
+ title: Ox._('Select Video'),
maxFiles: 1,
width: 96
}).bindEvent({
click: function(data) {
if(data.files.length) {
$actionButton.hide();
- $closeButton.options('title', 'Cancel');
+ $closeButton.options('title', Ox._('Cancel'));
upload(data.files[0]);
}
}
@@ -74,7 +74,7 @@ pandora.ui.uploadDialog = function(data) {
height: 128,
removeOnClose: true,
width: 368,
- title: 'Upload Video',
+ title: Ox._('Upload Video'),
})
.bindEvent({
close: function(data) {
@@ -87,13 +87,12 @@ pandora.ui.uploadDialog = function(data) {
});
if (!pandora.site.itemRequiresVideo && !pandora.user.ui.item) {
- $info.html(
- 'You can only upload a video to an existing '
- + pandora.site.itemName.singular.toLowerCase()
- + '. Please check if an entry for the '
- + pandora.site.itemName.singular.toLowerCase()
- + ' you want to upload exists and create otherwise.'
- );
+ $info.html(Ox._(
+ 'You can only upload a video to an existing {0}.'
+ + ' Please check if an entry for the {0}'
+ + ' you want to upload exists and create otherwise.',
+ [pandora.site.itemName.singular.toLowerCase()]
+ ));
$actionButton.hide();
}
$content.append($info);
@@ -136,7 +135,7 @@ pandora.ui.uploadDialog = function(data) {
info = JSON.parse(pandora.firefogg.sourceInfo),
item,
oshash = info.oshash;
- $info.html('
' + filename + 'encoding...');
+ $info.html('
' + filename + '' + Ox._('encoding...'));
resetProgress();
pandora.api.addMedia({
filename: filename,
@@ -150,12 +149,12 @@ pandora.ui.uploadDialog = function(data) {
function(result, file) {
result = JSON.parse(result);
if (result.progress != 1) {
- $status.html(cancelled ? 'Encoding cancelled.' : 'Encoding failed.');
+ $status.html(cancelled ? Ox._('Encoding cancelled.') : Ox._('Encoding failed.'));
delete pandora.firefogg;
return;
}
setTimeout(function() {
- $info.html('
' + filename + 'uploading...');
+ $info.html('
' + filename + '' + Ox._('uploading...'));
uploadStream(item, oshash, file);
});
},
@@ -189,7 +188,7 @@ pandora.ui.uploadDialog = function(data) {
delete pandora.firefogg;
that.close();
} else {
- $status.html('Upload Failed.');
+ $status.html(Ox._('Upload Failed.'));
pandora.api.log({
text: data.responseText,
url: '/' + item,
@@ -205,7 +204,7 @@ pandora.ui.uploadDialog = function(data) {
function upload(file) {
resetProgress();
- $info.html('Uploading ' + file.name);
+ $info.html(Ox._('Uploading {0}', [file.name]));
Ox.oshash(file, function(oshash) {
pandora.api.addMedia({
filename: file.name,
@@ -233,7 +232,7 @@ pandora.ui.uploadDialog = function(data) {
}
that.close();
} else {
- $status.html(cancelled ? 'Upload cancelled.' : 'Upload failed.');
+ $status.html(cancelled ? Ox._('Upload cancelled.') : Ox._('Upload failed.'));
!cancelled && pandora.api.log({
text: data.responseText,
url: '/' + item,
@@ -397,8 +396,8 @@ pandora.ui.uploadDialog = function(data) {
$info.html(formatInfo(info));
$status.html(
options.passthrough
- ? 'Your video will be uploaded directly.'
- : 'Your video will be transcoded before upload.'
+ ? Ox._('Your video will be uploaded directly.')
+ : Ox._('Your video will be transcoded before upload.')
);
} else {
pandora.api.find({
diff --git a/static/js/pandora/uploadFileDialog.js b/static/js/pandora/uploadFileDialog.js
index 2670f256..f6160445 100644
--- a/static/js/pandora/uploadFileDialog.js
+++ b/static/js/pandora/uploadFileDialog.js
@@ -19,7 +19,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
$content = Ox.Element().css({margin: '16px'}),
$text = $('
')
- .html('Uploading ' + file.name)
+ .html(Ox._('Uploading {0}', [file.name]))
.appendTo($content),
$progress = Ox.Progressbar({
@@ -37,14 +37,14 @@ pandora.ui.uploadFileDialog = function(file, callback) {
buttons: [
Ox.Button({
id: 'close',
- title: 'Cancel Upload'
+ title: Ox._('Cancel Upload')
}).bindEvent({
click: function() {
var title = this.options('title');
$uploadDialog.close();
- if (title == 'Cancel Upload') {
+ if (title == Ox._('Cancel Upload')) {
upload.abort();
- } else if (title == 'Done') {
+ } else if (title == Ox._('Done')) {
callback({
id: id
});
@@ -56,7 +56,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
height: 112,
keys: {escape: 'close'},
width: 288,
- title: 'Upload File'
+ title: Ox._('Upload File')
})
.bindEvent({
open: function() {
@@ -70,11 +70,11 @@ pandora.ui.uploadFileDialog = function(file, callback) {
.bindEvent({
done: function(data) {
if (data.progress == 1) {
- $uploadDialog.options('buttons')[0].options({title: 'Done'});
+ $uploadDialog.options('buttons')[0].options({title: Ox._('Done')});
Ox.print('SUCCEEDED');
} else {
- $message.html('Upload failed.')
- $uploadDialog.options('buttons')[0].options({title: 'Close'});
+ $message.html(Ox._('Upload failed.'))
+ $uploadDialog.options('buttons')[0].options({title: Ox._('Close')});
Ox.print('FAILED');
}
},
@@ -86,7 +86,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
});
if (!Ox.contains(extensions, extension)) {
- return errorDialog('Supported file types are GIF, JPG, PNG and PDF.');
+ return errorDialog(Ox._('Supported file types are GIF, JPG, PNG and PDF.'));
} else {
Ox.oshash(file, function(oshash) {
pandora.api.findFiles({
@@ -99,12 +99,9 @@ pandora.ui.uploadFileDialog = function(file, callback) {
sort: [{key: 'name', operator: '+'}]
}, function(result) {
if (result.data.items.length) {
- errorDialog(
- 'The file ' + id + ' already exists' + (
- filename == result.data.items[0].id
- ? ''
- : ' as ' + result.data.items[0].id
- ) + '.'
+ errorDialog(filename == result.data.items[0].id
+ ? Ox._('The file {0} already exists', [filename])
+ : Ox._('The file {0} already exists as {1}', [filename, result.data.items[0].id])
).open();
} else {
$uploadDialog.open();
@@ -119,7 +116,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
buttons: [
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
})
.bindEvent({
click: function() {
@@ -127,7 +124,7 @@ pandora.ui.uploadFileDialog = function(file, callback) {
}
})
],
- title: 'Upload File',
+ title: Ox._('Upload File'),
text: text
});
}
diff --git a/static/js/pandora/uploadPDFDialog.js b/static/js/pandora/uploadPDFDialog.js
index 52e064b3..ccf0dd74 100644
--- a/static/js/pandora/uploadPDFDialog.js
+++ b/static/js/pandora/uploadPDFDialog.js
@@ -15,7 +15,7 @@ pandora.ui.uploadPDFDialog = function(options) {
buttons: [
$closeButton = Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
}).bindEvent({
click: function() {
that.triggerEvent('close');
@@ -23,7 +23,7 @@ pandora.ui.uploadPDFDialog = function(options) {
}),
$cancelButton = Ox.Button({
id: 'cancel',
- title: 'Cancel',
+ title: Ox._('Cancel'),
disabled: true
}).bindEvent({
click: function(data) {
@@ -39,7 +39,7 @@ pandora.ui.uploadPDFDialog = function(options) {
height: 128,
removeOnClose: true,
width: 368,
- title: 'Upload PDF',
+ title: Ox._('Upload PDF'),
})
.bindEvent({
close: function(data) {
diff --git a/static/js/pandora/usersDialog.js b/static/js/pandora/usersDialog.js
index 4edb71ab..a5501517 100644
--- a/static/js/pandora/usersDialog.js
+++ b/static/js/pandora/usersDialog.js
@@ -24,7 +24,7 @@ pandora.ui.usersDialog = function() {
$reloadButton = Ox.Button({
disabled: true,
title: 'redo',
- tooltip: 'Reload',
+ tooltip: Ox._('Reload'),
type: 'image'
})
.css({float: 'left', margin: '4px 2px 4px 4px'})
@@ -37,7 +37,7 @@ pandora.ui.usersDialog = function() {
}),
$guestsCheckbox = Ox.Checkbox({
- title: 'Include Guests',
+ title: Ox._('Include Guests'),
value: false
})
.css({float: 'left', margin: '4px 2px'})
@@ -51,7 +51,7 @@ pandora.ui.usersDialog = function() {
}),
$robotsCheckbox = Ox.Checkbox({
- title: 'Include Robots',
+ title: Ox._('Include Robots'),
value: false
})
.css({float: 'left', margin: '4px 2px'})
@@ -62,9 +62,9 @@ pandora.ui.usersDialog = function() {
$findSelect = Ox.Select({
items: [
- {id: 'all', title: 'Find: All'},
- {id: 'username', title: 'Find: Username'},
- {id: 'email', title: 'Find: E-Mail-Address'}
+ {id: 'all', title: Ox._('Find: All')},
+ {id: 'username', title: Ox._('Find: Username')},
+ {id: 'email', title: Ox._('Find: E-Mail-Address')}
],
overlap: 'right',
type: 'image'
@@ -113,7 +113,7 @@ pandora.ui.usersDialog = function() {
},
id: 'disabled',
operator: '-',
- title: 'Enabled',
+ title: Ox._('Enabled'),
titleImage: 'check',
visible: true,
width: 16
@@ -132,7 +132,7 @@ pandora.ui.usersDialog = function() {
});
},
id: 'newsletter',
- title: 'Newsletter',
+ title: Ox._('Newsletter'),
titleImage: 'mail',
operator: '-',
visible: true,
@@ -147,7 +147,7 @@ pandora.ui.usersDialog = function() {
id: 'username',
operator: '+',
removable: false,
- title: 'Username',
+ title: Ox._('Username'),
visible: true,
width: 128
},
@@ -159,7 +159,7 @@ pandora.ui.usersDialog = function() {
},
id: 'email',
operator: '+',
- title: 'E-Mail Address',
+ title: Ox._('E-Mail Address'),
visible: true,
width: 192
},
@@ -174,7 +174,7 @@ pandora.ui.usersDialog = function() {
},
id: 'level',
operator: '-',
- title: 'Level',
+ title: Ox._('Level'),
type: 'label',
visible: true,
width: 64
@@ -198,7 +198,7 @@ pandora.ui.usersDialog = function() {
},
id: 'location',
operator: '+',
- title: 'Location',
+ title: Ox._('Location'),
titleImage: 'flag',
visible: true,
width: 16
@@ -233,7 +233,7 @@ pandora.ui.usersDialog = function() {
},
id: 'system',
operator: '+',
- title: 'System',
+ title: Ox._('System'),
titleImage: 'square',
visible: true,
width: 16
@@ -264,7 +264,7 @@ pandora.ui.usersDialog = function() {
},
id: 'browser',
operator: '+',
- title: 'Browser',
+ title: Ox._('Browser'),
titleImage: 'circle',
visible: true,
width: 16
@@ -276,7 +276,7 @@ pandora.ui.usersDialog = function() {
},
id: 'timesseen',
operator: '-',
- title: 'Times Seen',
+ title: Ox._('Times Seen'),
visible: true,
width: 80
},
@@ -287,7 +287,7 @@ pandora.ui.usersDialog = function() {
},
id: 'firstseen',
operator: '-',
- title: 'First Seen',
+ title: Ox._('First Seen'),
visible: true,
width: 144
},
@@ -298,7 +298,7 @@ pandora.ui.usersDialog = function() {
},
id: 'lastseen',
operator: '-',
- title: 'Last Seen',
+ title: Ox._('Last Seen'),
visible: true,
width: 144
},
@@ -310,14 +310,14 @@ pandora.ui.usersDialog = function() {
},
id: 'numberoflists',
operator: '-',
- title: 'Lists',
+ title: Ox._('Lists'),
visible: true,
width: 64
},
{
id: 'groups',
operator: '+',
- title: 'Groups',
+ title: Ox._('Groups'),
visible: true,
width: 64
},
@@ -325,7 +325,7 @@ pandora.ui.usersDialog = function() {
id: 'screensize',
align: 'right',
operator: '-',
- title: 'Screen Size',
+ title: Ox._('Screen Size'),
visible: true,
width: 80
},
@@ -333,7 +333,7 @@ pandora.ui.usersDialog = function() {
align: 'right',
id: 'windowsize',
operator: '-',
- title: 'Window Size',
+ title: Ox._('Window Size'),
visible: true,
width: 80
},
@@ -341,14 +341,14 @@ pandora.ui.usersDialog = function() {
align: 'right',
id: 'ip',
operator: '+',
- title: 'IP Address',
+ title: Ox._('IP Address'),
visible: true,
width: 128
},
{
id: 'useragent',
operator: '+',
- title: 'User Agent',
+ title: Ox._('User Agent'),
visible: true,
width: 768
}
@@ -395,7 +395,7 @@ pandora.ui.usersDialog = function() {
$formLabel = Ox.Label({
textAlign: 'center',
- title: 'No user selected',
+ title: Ox._('No user selected'),
width: 212
})
.css({float: 'left', margin: '4px 2px 4px 4px'}),
@@ -406,12 +406,12 @@ pandora.ui.usersDialog = function() {
id: 'edit',
selected: true,
title: 'edit',
- tooltip: 'Edit'
+ tooltip: Ox._('Edit')
},
{
id: 'mail',
title: 'mail',
- tooltip: 'Mail'
+ tooltip: Ox._('Mail')
}
],
selectable: true,
@@ -429,7 +429,7 @@ pandora.ui.usersDialog = function() {
$sendButton = Ox.Button({
disabled: true,
id: 'send',
- title: 'Send',
+ title: Ox._('Send'),
width: 64
})
.bindEvent({
@@ -488,7 +488,7 @@ pandora.ui.usersDialog = function() {
buttons: [
Ox.Button({
id: 'statistics',
- title: 'Statistics...'
+ title: Ox._('Statistics...')
}).bindEvent({
click: function() {
that.close();
@@ -497,7 +497,7 @@ pandora.ui.usersDialog = function() {
}),
{},
Ox.Button({
- title: 'Export E-Mail Addresses'
+ title: Ox._('Export E-Mail Addresses')
})
.css({margin: '4px 4px 4px 0'})
.bindEvent({
@@ -511,7 +511,7 @@ pandora.ui.usersDialog = function() {
var $dialog = Ox.Dialog({
buttons: [
Ox.Button({
- title: 'Close'
+ title: Ox._('Close')
})
.bindEvent({
click: function() {
@@ -531,7 +531,7 @@ pandora.ui.usersDialog = function() {
}).join(', ')
),
removeOnClose: true,
- title: 'E-Mail Addresses'
+ title: Ox._('E-Mail Addresses')
})
.open();
});
@@ -539,7 +539,7 @@ pandora.ui.usersDialog = function() {
}),
Ox.Button({
id: 'done',
- title: 'Done',
+ title: Ox._('Done'),
width: 48
}).bindEvent({
click: function() {
@@ -555,7 +555,7 @@ pandora.ui.usersDialog = function() {
minWidth: 512,
padding: 0,
removeOnClose: true,
- title: 'Manage Users',
+ title: Ox._('Manage Users'),
width: dialogWidth
})
.bindEvent({
@@ -751,8 +751,8 @@ pandora.ui.usersDialog = function() {
Ox.Select({
id: 'include',
items: [
- {id: 'users', title: 'All users'},
- {id: 'subscribers', title: 'Subscribers only'},
+ {id: 'users', title: Ox._('All users')},
+ {id: 'subscribers', title: Ox._('Subscribers only')},
],
label: 'Include',
labelWidth: 80,
@@ -788,10 +788,10 @@ pandora.ui.usersDialog = function() {
Ox.MenuButton({
id: 'insert',
items: [
- {id: 'username', title: 'Username'},
- {id: 'email', title: 'E-Mail address'},
+ {id: 'username', title: Ox._('Username')},
+ {id: 'email', title: Ox._('E-Mail address')},
],
- title: 'Insert...',
+ title: Ox._('Insert...'),
width: formWidth - 16
})
.bindEvent({
@@ -809,7 +809,7 @@ pandora.ui.usersDialog = function() {
}),
Ox.Checkbox({
id: 'receipt',
- title: 'Send a receipt to ' + pandora.user.email,
+ title: Ox._('Send a receipt to {0}', [pandora.user.email]),
value: false,
width: formWidth - 16
}),
@@ -857,7 +857,7 @@ pandora.ui.usersDialog = function() {
}
function sendMail() {
- $sendButton.options({title: 'Sending', disabled: true});
+ $sendButton.options({title: Ox._('Sending'), disabled: true});
pandora.api.mail({
to: getTo(),
subject: getFormItemById('subject').value(),
@@ -868,7 +868,7 @@ pandora.ui.usersDialog = function() {
buttons: [
Ox.Button({
id: 'close',
- title: 'Close'
+ title: Ox._('Close')
})
.bindEvent({
click: function() {
@@ -878,13 +878,13 @@ pandora.ui.usersDialog = function() {
],
keys: {enter: 'close', escape: 'close'},
text: result.status.code == 200
- ? 'Your message has been sent.'
- : 'Your message could not be sent. Please try again.',
+ ? Ox._('Your message has been sent.')
+ : Ox._('Your message could not be sent. Please try again.'),
title: result.status.code == 200
- ? 'Message Sent'
- : 'Application Error'
+ ? Ox._('Message Sent')
+ : Ox._('Application Error')
}).open();
- $sendButton.options({title: 'Send', disabled: false});
+ $sendButton.options({title: Ox._('Send'), disabled: false});
});
}
@@ -901,20 +901,20 @@ pandora.ui.usersDialog = function() {
var users = $list.options('selected').map(function(id) {
return $list.value(id);
}),
- title = users.length == 0 ? 'No user selected'
+ title = users.length == 0 ? Ox._('No user selected')
: users.length == 1 ? (
['guest', 'robot'].indexOf(users[0].level) > -1
? Ox.toTitleCase(users[0].level)
: Ox.encodeHTMLEntities(users[0].username)
+ ' <' + users[0].email + '>'
)
- : users.length + ' users selected';
+ : Ox._('{0} users selected', [users.length]);
$formLabel.options({title: title});
}
function setSend() {
getFormItemById('send').options({
- disabled: getFormItemById('to').value() == 'No recipients'
+ disabled: getFormItemById('to').value() == Ox._('No recipients')
|| getFormItemById('subject').value() === ''
|| getFormItemById('message').value() === ''
});
@@ -923,7 +923,7 @@ pandora.ui.usersDialog = function() {
function setTo() {
var recipients = getTo().length;
$mailForm.values({
- to: (recipients || 'No') + ' recipient' + (recipients == 1 ? '' : 's')
+ to: (recipients || Ox._('No')) + (recipients == 1 ? Ox._('recipient') : Ox._('recipients'))
});
}
diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js
index d5bdbe60..067c3c21 100644
--- a/static/js/pandora/utils.js
+++ b/static/js/pandora/utils.js
@@ -433,33 +433,33 @@ pandora.enableDragAndDrop = function($list, canMove) {
function getTitle() {
var image, text;
if (drag.action == 'move' && drag.source.user != pandora.user.username) {
- image = 'symbolClose'
- text = 'You can only remove ' + pandora.site.itemName.plural.toLowerCase()
- + '
from your own lists.';
+ image = 'symbolClose';
+ text = Ox._('You can only remove {0}
from your own lists.',
+ [pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.action == 'move' && drag.source.type == 'smart') {
image = 'symbolClose';
- text = 'You can\'t remove ' + pandora.site.itemName.plural.toLowerCase()
- + '
from smart lists.';
+ text = Ox._('You can\'t remove {0}
from smart lists.',
+ [pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.user != pandora.user.username) {
- image = 'symbolClose'
- text = 'You can only ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase()
- + '
to your own lists';
+ image = 'symbolClose';
+ text = Ox._('You can only {0} {1}
to your own lists',
+ [drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else if (drag.target && drag.target.type == 'smart') {
- image = 'symbolClose'
- text = 'You can\'t ' + drag.action + ' ' + pandora.site.itemName.plural.toLowerCase()
- + '
to smart lists';
+ image = 'symbolClose';
+ text = Ox._('You can\'t {0} {1}
to smart lists',
+ [drag.action, pandora.site.itemName.plural.toLowerCase()]);
} else {
image = drag.action == 'copy' ? 'symbolAdd' : 'symbolRemove';
- text = Ox.toTitleCase(drag.action) + ' ' + (
+ text = Ox._(Ox.toTitleCase(drag.action)) + ' ' + (
Ox.isString(drag.item)
? '"' + drag.item + '"'
: drag.item + ' ' + pandora.site.itemName[
drag.item == 1 ? 'singular' : 'plural'
].toLowerCase()
- ) + ' to ' + (
+ ) + '
' + (
drag.target && !drag.target.selected
- ? 'the list "' + Ox.encodeHTMLEntities(drag.target.name) + '"'
- : (pandora.user.ui._list ? 'another' : 'a') + ' list'
+ ? Ox._('to the list "{0}"', [Ox.encodeHTMLEntities(drag.target.name)])
+ : Ox._('to ' + (pandora.user.ui._list ? 'another' : 'a') + ' list')
);
}
return $('
')
@@ -584,14 +584,14 @@ pandora.getClipsQuery = function() {
var parts = [pandora.site.site.name];
if (pandora.user.ui.section == 'items') {
if (!pandora.user.ui.item) {
- pandora.user.ui._list && parts.push('List ' + pandora.user.ui._list);
- parts.push(Ox.toTitleCase(pandora.user.ui.listView) + ' View');
+ pandora.user.ui._list && parts.push(Ox._('List {0}', [pandora.user.ui._list]));
+ parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View'));
} else {
parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item);
- parts.push(Ox.toTitleCase(pandora.user.ui.itemView) + ' View');
+ parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.itemView) + ' View'));
}
} else if (pandora.user.ui.section == 'texts') {
- parts.push(pandora.user.ui.text ? pandora.user.ui.text : 'Texts');
+ parts.push(pandora.user.ui.text ? pandora.user.ui.text : Ox._('Texts'));
}
return parts.join(' - ');
};
@@ -602,7 +602,7 @@ pandora.getEditTooltip = function(title) {
var $target = $(e.target);
return (
$target.is('a') || $target.parents('a').length
- ? 'Shift+doubleclick to edit' : 'Doubleclick to edit'
+ ? Ox._('Shift+doubleclick to edit') : Ox._('Doubleclick to edit')
) + (title ? ' ' + title : '');
}
};
@@ -903,15 +903,15 @@ pandora.getListData = function(list) {
pandora.getPageTitle = function(stateOrURL) {
var pages = [
{id: '', title: ''},
- {id: 'api', title: 'API Documentation'},
- {id: 'help', title: 'Help'},
+ {id: 'api', title: Ox._('API Documentation')},
+ {id: 'help', title: Ox._('Help')},
{id: 'home', title: ''},
- {id: 'preferences', title: 'Preferences'},
- {id: 'signin', title: 'Sign In'},
- {id: 'signout', title: 'Sign Out'},
- {id: 'signup', title: 'Sign Up'},
- {id: 'software', title: 'Software'},
- {id: 'tv', title: 'TV'}
+ {id: 'preferences', title: Ox._('Preferences')},
+ {id: 'signin', title: Ox._('Sign In')},
+ {id: 'signout', title: Ox._('Sign Out')},
+ {id: 'signup', title: Ox._('Sign Up')},
+ {id: 'software', title: Ox._('Software')},
+ {id: 'tv', title: Ox._('TV')}
].concat(pandora.site.sitePages),
page = Ox.getObjectById(
pages,
@@ -1046,7 +1046,7 @@ pandora.getStatusText = function(data) {
canSeeFiles = pandora.site.capabilities.canSeeFiles[pandora.user.level],
canSeeSize = pandora.site.capabilities.canSeeSize[pandora.user.level],
itemName = ui.listView == 'clip'
- ? (data.items == 1 ? 'Clip' : 'Clips')
+ ? (data.items == 1 ? Ox._('Clip') : Ox._('Clips'))
: (pandora.site.itemName[data.items == 1 ? 'singular' : 'plural']),
parts = [];
parts.push(Ox.formatNumber(data.items) + ' '+ itemName);
@@ -1057,7 +1057,7 @@ pandora.getStatusText = function(data) {
}
if (canSeeFiles) {
data.files && parts.push(
- Ox.formatNumber(data.files) + ' file' + (data.files == 1 ? '' : 's')
+ Ox.formatCount(data.files, 'file')
);
data.duration && parts.push(Ox.formatDuration(data.duration));
}
@@ -1462,9 +1462,17 @@ pandora.selectList = function() {
}
};
+pandora.setLocale = function(locale, callback) {
+ Ox.setLocale(locale, locale && locale != 'en'
+ ? '/static/json/locale.' + locale + '.json'
+ : void 0, function(result) {
+ callback(result);
+ });
+}
+
pandora.beforeunloadWindow = function() {
if (pandora.firefogg)
- return "Encoding is currently running\nDo you want to leave this page?";
+ return Ox._("Encoding is currently running\nDo you want to leave this page?");
//prevent error dialogs on unload
pandora.isUnloading = true;
};
diff --git a/static/js/pandora/viewSelect.js b/static/js/pandora/viewSelect.js
index a713d38b..25a90975 100644
--- a/static/js/pandora/viewSelect.js
+++ b/static/js/pandora/viewSelect.js
@@ -9,7 +9,7 @@ pandora.ui.viewSelect = function() {
items = pandora.site[viewKey + 's'].filter(function(view) {
return view.id != 'data' && view.id != 'files';
}).map(function(view) {
- return {id: view.id, title: 'View ' + view.title};
+ return {id: view.id, title: Ox._('View {0}', [Ox._(view.title)])};
}),
that;
if (
@@ -18,8 +18,8 @@ pandora.ui.viewSelect = function() {
) {
items = items.concat([
{},
- {id: 'data', title: 'View Data'},
- {id: 'files', title: 'View Files'}
+ {id: 'data', title: Ox._('View Data')},
+ {id: 'files', title: Ox._('View Files')}
]);
}
that = Ox.Select({
diff --git a/static/json/locale.pandora.ar.json b/static/json/locale.pandora.ar.json
new file mode 100644
index 00000000..2c63c085
--- /dev/null
+++ b/static/json/locale.pandora.ar.json
@@ -0,0 +1,2 @@
+{
+}
diff --git a/static/json/locale.pandora.de.json b/static/json/locale.pandora.de.json
new file mode 100644
index 00000000..2c63c085
--- /dev/null
+++ b/static/json/locale.pandora.de.json
@@ -0,0 +1,2 @@
+{
+}