wrap more strings

This commit is contained in:
j 2014-02-14 15:23:59 +00:00
parent 5905e339e3
commit e8e4639dce
15 changed files with 61 additions and 64 deletions

View file

@ -10,7 +10,7 @@ pandora.ui.contentPanel = function() {
resizable: true, resizable: true,
resize: [96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256], resize: [96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256],
size: pandora.user.ui.filtersSize, size: pandora.user.ui.filtersSize,
tooltip: 'filters <span class="OxBright">' tooltip: Ox._('filters') + ' <span class="OxBright">'
+ Ox.SYMBOLS.SHIFT + 'F</span>' + Ox.SYMBOLS.SHIFT + 'F</span>'
}, },
{ {
@ -26,8 +26,8 @@ pandora.ui.contentPanel = function() {
collapsible: true, collapsible: true,
element: pandora.$ui.browser = pandora.ui.browser(), element: pandora.$ui.browser = pandora.ui.browser(),
size: 112 + Ox.UI.SCROLLBAR_SIZE, size: 112 + Ox.UI.SCROLLBAR_SIZE,
tooltip: pandora.site.itemName.singular.toLowerCase() tooltip: Ox._('{0} browser', [Ox._(pandora.site.itemName.singular.toLowerCase())])
+ ' browser <span class="OxBright">' + ' <span class="OxBright">'
+ Ox.SYMBOLS.SHIFT + 'B</span>' + Ox.SYMBOLS.SHIFT + 'B</span>'
}, },
{ {

View file

@ -3,12 +3,12 @@
pandora.ui.deleteDocumentDialog = function(files, callback) { pandora.ui.deleteDocumentDialog = function(files, callback) {
var string = files.length == 1 ? 'Document' : 'Documents', var string = Ox._(files.length == 1 ? 'Document' : 'Documents'),
that = pandora.ui.iconDialog({ that = pandora.ui.iconDialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
id: 'keep', id: 'keep',
title: Ox._('Keep ' + string) title: Ox._('Keep {0}', [string])
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -16,7 +16,7 @@ pandora.ui.deleteDocumentDialog = function(files, callback) {
}), }),
Ox.Button({ Ox.Button({
id: 'delete', id: 'delete',
title: Ox._('Delete ' + string) title: Ox._('Delete {0}', [string])
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
@ -33,7 +33,7 @@ pandora.ui.deleteDocumentDialog = function(files, callback) {
: Ox._('Are you sure you want to delete {0} documents?', [files.length]), : Ox._('Are you sure you want to delete {0} documents?', [files.length]),
keys: {enter: 'delete', escape: 'keep'}, keys: {enter: 'delete', escape: 'keep'},
title: files.length == 1 title: files.length == 1
? Ox._('Delete Document') ? Ox._('Delete {0}', [string])
: Ox._('Delete {0} Documents', [files.length]) : Ox._('Delete {0} Documents', [files.length])
}); });

View file

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

View file

@ -235,7 +235,7 @@ pandora.ui.documentsPanel = function(options) {
$itemMenu = Ox.MenuButton({ $itemMenu = Ox.MenuButton({
items: isItemView ? [ items: isItemView ? [
{id: 'add', title: Ox._( {id: 'add', title: Ox._(
'Add Documents to ' + pandora.site.itemName.singular + '...' 'Add Documents to {0}...', [pandora.site.itemName.singular]
), keyboard: 'control n'}, ), keyboard: 'control n'},
{}, {},
{id: 'open', title: '', keyboard: 'return'}, {id: 'open', title: '', keyboard: 'return'},
@ -244,13 +244,13 @@ pandora.ui.documentsPanel = function(options) {
{}, {},
{id: 'remove', title: '', keyboard: 'delete'} {id: 'remove', title: '', keyboard: 'delete'}
] : [ ] : [
{id: 'upload', title: Ox._('Upload Documents...'), file: {width: 192}}, {id: 'upload', title: Ox._('Upload {0}...', [Ox._('Documents')]), file: {width: 192}},
{}, {},
{id: 'open', title: '', keyboard: 'return'}, {id: 'open', title: '', keyboard: 'return'},
{id: 'add', title: ''}, {id: 'add', title: ''},
{id: 'embed', title: Ox._('Embed Document...')}, {id: 'embed', title: Ox._('Embed Document...')},
{}, {},
{id: 'replace', title: Ox._('Replace Document...')}, {id: 'replace', title: Ox._('Replace {0}...', [Ox._('Document')])},
{id: 'delete', title: '', keyboard: 'delete'} {id: 'delete', title: '', keyboard: 'delete'}
], ],
title: 'set', title: 'set',
@ -791,28 +791,28 @@ pandora.ui.documentsPanel = function(options) {
return; return;
} }
var selected = ui.documentsSelection[isItemView ? ui.item : ''] || [], var selected = ui.documentsSelection[isItemView ? ui.item : ''] || [],
string = selected.length < 2 ? 'Document' : ' Documents'; string = Ox._(selected.length < 2 ? 'Document' : 'Documents');
$list.options({selected: selected}); $list.options({selected: selected});
$itemMenu.setItemTitle('open', Ox._('Open ' + string)) $itemMenu.setItemTitle('open', Ox._('Open {0}', [string]))
[selected.length ? 'enableItem' : 'disableItem']('open'); [selected.length ? 'enableItem' : 'disableItem']('open');
if (isItemView) { if (isItemView) {
$itemMenu.setItemTitle('edit', Ox._('Edit ' + string + '...')) $itemMenu.setItemTitle('edit', Ox._('Edit {0}...', [string]))
.setItemTitle('remove', Ox._( .setItemTitle('remove', Ox._(
'Remove ' + string + ' from ' 'Remove {0} from {1}',
+ pandora.site.itemName.singular [string, Ox._(pandora.site.itemName.singular)]
)) ))
[selected.length ? 'enableItem' : 'disableItem']('edit') [selected.length ? 'enableItem' : 'disableItem']('edit')
[selected.length ? 'enableItem' : 'disableItem']('embed') [selected.length ? 'enableItem' : 'disableItem']('embed')
[selected.length ? 'enableItem' : 'disableItem']('remove'); [selected.length ? 'enableItem' : 'disableItem']('remove');
} else { } else {
$itemMenu.setItemTitle('add', Ox._('Add ' + string + ' to ' + ( $itemMenu.setItemTitle('add', Ox._('Add {0} to {1} {2}', [
hasListSelection ? 'Selected' : 'Current' Ox._(hasListSelection ? 'Selected' : 'Current'),
) + ' {0}', [pandora.site.itemName[ string, Ox._(pandora.site.itemName[
hasListSelection && ui.listSelection.length > 1 hasListSelection && ui.listSelection.length > 1
? 'plural' : 'singular' ? 'plural' : 'singular'])
]])) ]))
.setItemTitle('replace', Ox._('Replace ' + string + '...')) .setItemTitle('replace', Ox._('Replace {0}...', [string]))
.setItemTitle('delete', Ox._('Delete ' + string + '...')) .setItemTitle('delete', Ox._('Delete {0}...', [string]))
[selected.length && (hasItemView || hasListSelection) ? 'enableItem' : 'disableItem']('add') [selected.length && (hasItemView || hasListSelection) ? 'enableItem' : 'disableItem']('add')
[selected.length ? 'enableItem' : 'disableItem']('embed') [selected.length ? 'enableItem' : 'disableItem']('embed')
[selected.length == 1 ? 'enableItem' : 'disableItem']('replace') [selected.length == 1 ? 'enableItem' : 'disableItem']('replace')

View file

@ -143,7 +143,7 @@ pandora.ui.editPanel = function(isEmbed) {
), ),
subtitles: getSubtitles(edit.clips), subtitles: getSubtitles(edit.clips),
timeline: ui.videoTimeline, timeline: ui.videoTimeline,
timelineTooltip: 'timeline <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>', timelineTooltip: Ox._('timeline') + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>',
video: getVideos(), video: getVideos(),
volume: ui.videoVolume, volume: ui.videoVolume,
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1

View file

@ -13,13 +13,11 @@ pandora.ui.editor = function(data) {
annotationsRange: ui.annotationsRange, annotationsRange: ui.annotationsRange,
annotationsSize: ui.annotationsSize, annotationsSize: ui.annotationsSize,
annotationsSort: ui.annotationsSort, annotationsSort: ui.annotationsSort,
annotationsTooltip: Ox._( annotationsTooltip: Ox._('annotations')
'annotations {0}', + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
['<span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>']
),
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon, censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text, censoredTooltip: Ox._(pandora.site.cantPlay.text),
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,

View file

@ -129,7 +129,7 @@ pandora.ui.folderBrowserList = function(id, section) {
tooltip: function(data) { tooltip: function(data) {
var checked = id == 'favorite' ? data.subscribed : data.status == 'featured'; var checked = id == 'favorite' ? data.subscribed : data.status == 'featured';
return Ox._((checked ? 'Remove from' : 'Add to') return Ox._((checked ? 'Remove from' : 'Add to')
+ ' ' + Ox.toTitleCase(id) + ' ' + folderItems); + ' {0} {1}', [Ox._(Ox.toTitleCase(id)), Ox._(folderItems)]);
}, },
visible: true, visible: true,
width: 16 width: 16

View file

@ -9,13 +9,10 @@ pandora.ui.folderPlaceholder = function(id, section) {
}); });
that.updateText = function(string, isFind) { that.updateText = function(string, isFind) {
return that.html( return that.html(
Ox._(
string != 'volumes' string != 'volumes'
? 'No ' + string + ' ' ? Ox._('No {0} {1}' + (isFind ? ' found' : ''),
+ (section == 'items' ? 'lists' : section) [Ox._(string), Ox._(section == 'items' ? 'lists' : section)])
+ (isFind ? ' found' : '') : Ox._('No local volumes')
: 'No local volumes'
)
); );
}; };
return that.updateText(id); return that.updateText(id);

View file

@ -516,9 +516,9 @@ pandora.ui.infoView = function(data) {
key = Ox._(item ? item.title : key); key = Ox._(item ? item.title : key);
mode = mode || 'text'; mode = mode || 'text';
if (key == 'alternativeTitles') { if (key == 'alternativeTitles') {
key = 'alternative title' + ( key = Ox._('Alternative Title' + (
data.alternativeTitles && data.alternativeTitles.length == 1 ? '' : 's' data.alternativeTitles && data.alternativeTitles.length == 1 ? '' : 's'
); ));
} else if (key == 'keyword') { } else if (key == 'keyword') {
key = 'keywords' key = 'keywords'
} }
@ -528,8 +528,7 @@ pandora.ui.infoView = function(data) {
? Ox.toTitleCase(key) ? Ox.toTitleCase(key)
: Ox.Element() : Ox.Element()
.css({marginBottom: '4px', fontWeight: 'bold'}) .css({marginBottom: '4px', fontWeight: 'bold'})
.html(Ox.toTitleCase(key) .html(Ox.toTitleCase(key).replace(' Per ', ' per '));
.replace(' Per ', ' per '));
} }
function formatLight(str) { function formatLight(str) {
@ -749,14 +748,15 @@ pandora.ui.infoView = function(data) {
var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel, var hasCapability = pandora.site.capabilities[capability.name][userLevel] >= rightsLevel,
$element = Ox.Theme.formatColorLevel(hasCapability, ['', '']); $element = Ox.Theme.formatColorLevel(hasCapability, ['', '']);
Ox.Button({ Ox.Button({
tooltip: Ox._((canEdit ? Ox.toTitleCase(userLevel) : 'You') + ' ' tooltip: Ox._('{0} '
+ (hasCapability ? 'can' : 'can\'t') + ' ' + (hasCapability ? 'can' : 'can\'t') + ' '
+ Ox.toSlashes(capability.name) + Ox.toSlashes(capability.name)
.split('/').slice(1).join(' ') .split('/').slice(1).join(' ')
.toLowerCase() .toLowerCase()
.replace('see item', 'see the item') .replace('see item', 'see the item')
.replace('play video', 'play the full video') .replace('play video', 'play the full video')
.replace('download video', 'download the video')), .replace('download video', 'download the video'),
[canEdit ? Ox.toTitleCase(userLevel) : Ox._('You')]),
title: capability.symbol, title: capability.symbol,
type: 'image' type: 'image'
}) })

View file

@ -26,7 +26,10 @@ pandora.ui.listDialog = function(section) {
} else if (id == 'icon') { } else if (id == 'icon') {
return pandora.$ui.listIconPanel = pandora.ui.listIconPanel(listData); return pandora.$ui.listIconPanel = pandora.ui.listIconPanel(listData);
} else if (id == 'query') { } else if (id == 'query') {
return pandora.$ui.filterForm = pandora.ui.filterForm(listData) return pandora.$ui.filterForm = pandora.ui.filterForm({
mode: 'list',
list: listData
})
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
listData.query = data.query; listData.query = data.query;

View file

@ -196,7 +196,7 @@ pandora.ui.mainMenu = function() {
}) } }) }
] }, ] },
{}, {},
{ id: 'embed', title: Ox._('Embed...'), disabled: true } { id: 'embed', title: Ox._('Embed...') }
]}, ]},
getSortMenu(), getSortMenu(),
getFindMenu(), getFindMenu(),
@ -487,6 +487,8 @@ pandora.ui.mainMenu = function() {
Ox.Fullscreen.toggle(); Ox.Fullscreen.toggle();
} else if (data.id == 'entervideofullscreen') { } else if (data.id == 'entervideofullscreen') {
pandora.$ui.player.options({fullscreen: true}); pandora.$ui.player.options({fullscreen: true});
} else if (data.id == 'embed') {
pandora.$ui.embedDialog = pandora.ui.embedDialog().open();
} else if (data.id == 'advancedfind') { } else if (data.id == 'advancedfind') {
pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
} else if (data.id == 'findsimilar') { } else if (data.id == 'findsimilar') {
@ -1026,7 +1028,8 @@ pandora.ui.mainMenu = function() {
items: Ox.isUndefined(lists[folder]) items: Ox.isUndefined(lists[folder])
? [{id: 'loading', title: Ox._('Loading...'), disabled: true}] ? [{id: 'loading', title: Ox._('Loading...'), disabled: true}]
: lists[folder].length == 0 : lists[folder].length == 0
? [{id: 'nolists', title: Ox._('No ' + Ox.toTitleCase(folder) + ' ' + itemNamePlural), disabled: true}] ? [{id: 'nolists', title: Ox._('No {0} {1}',
[Ox._(Ox.toTitleCase(folder)), Ox._(itemNamePlural)]), disabled: true}]
: lists[folder].map(function(list) { : lists[folder].map(function(list) {
return { return {
id: 'viewlist' + list.id.replace(/_/g, Ox.char(9)), id: 'viewlist' + list.id.replace(/_/g, Ox.char(9)),

View file

@ -11,7 +11,7 @@ pandora.ui.mainPanel = function() {
resizable: true, resizable: true,
resize: [192, 256, 320, 384], resize: [192, 256, 320, 384],
size: ui.sidebarSize, size: ui.sidebarSize,
tooltip: 'sidebar <span class="OxBright">' tooltip: Ox._('sidebar') + ' <span class="OxBright">'
+ Ox.SYMBOLS.SHIFT + 'S</span>' + Ox.SYMBOLS.SHIFT + 'S</span>'
}, },
{ {

View file

@ -13,13 +13,11 @@ pandora.ui.player = function(data) {
annotationsRange: ui.annotationsRange, annotationsRange: ui.annotationsRange,
annotationsSize: ui.annotationsSize, annotationsSize: ui.annotationsSize,
annotationsSort: ui.annotationsSort, annotationsSort: ui.annotationsSort,
annotationsTooltip: Ox._( annotationsTooltip: Ox._('annotations')
'annotations {0}', + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
['<span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>']
),
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon, censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text, censoredTooltip: Ox._(pandora.site.cantPlay.text),
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,
@ -53,7 +51,7 @@ pandora.ui.player = function(data) {
smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'), smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'),
subtitles: data.subtitles, subtitles: data.subtitles,
timeline: ui.videoTimeline, timeline: ui.videoTimeline,
timelineTooltip: 'timeline <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>', timelineTooltip: Ox._('timeline') + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>',
video: data.video, video: data.video,
volume: ui.videoVolume, volume: ui.videoVolume,
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1

View file

@ -13,13 +13,11 @@ pandora.ui.timeline = function(data) {
annotationsRange: ui.annotationsRange, annotationsRange: ui.annotationsRange,
annotationsSize: ui.annotationsSize, annotationsSize: ui.annotationsSize,
annotationsSort: ui.annotationsSort, annotationsSort: ui.annotationsSort,
annotationsTooltip: Ox._( annotationsTooltip: Ox._('annotations')
'annotations {0}', + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
['<span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>']
),
censored: data.censored, censored: data.censored,
censoredIcon: pandora.site.cantPlay.icon, censoredIcon: pandora.site.cantPlay.icon,
censoredTooltip: pandora.site.cantPlay.text, censoredTooltip: Ox._(pandora.site.cantPlay.text),
clickLink: pandora.clickLink, clickLink: pandora.clickLink,
cuts: data.cuts || [], cuts: data.cuts || [],
duration: data.duration, duration: data.duration,

View file

@ -969,10 +969,10 @@ pandora.getClipVideos = function(clip, resolution) {
? pandora.user.ui._list.split(':').slice(1).join(':') ? pandora.user.ui._list.split(':').slice(1).join(':')
: pandora.getAllItemsTitle('items') : pandora.getAllItemsTitle('items')
); );
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.listView) + ' View')); parts.push(Ox._("{0} View", [Ox._(Ox.toTitleCase(pandora.user.ui.listView))]));
} else { } else {
parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item); parts.push(itemTitles[pandora.user.ui.item] || pandora.user.ui.item);
parts.push(Ox._(Ox.toTitleCase(pandora.user.ui.itemView) + ' View')); parts.push(Ox._("{0} View", [Ox._(Ox.toTitleCase(pandora.user.ui.itemView))]));
} }
} else if (pandora.user.ui.section == 'edits') { } else if (pandora.user.ui.section == 'edits') {
if (pandora.user.ui.edit) { if (pandora.user.ui.edit) {
@ -1005,7 +1005,7 @@ pandora.getEditTooltip = function(title) {
return ( return (
$target.is('a') || $target.parents('a').length $target.is('a') || $target.parents('a').length
? Ox._('Shift+doubleclick to edit') : Ox._('Doubleclick to edit') ? Ox._('Shift+doubleclick to edit') : Ox._('Doubleclick to edit')
) + (title ? ' ' + title : ''); ) + (title ? ' ' + Ox._(title) : '');
} }
}; };