From 3e6a16d191a4b8fe4259ade365cd3853924bf902 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 17 Jul 2013 10:25:01 +0000 Subject: [PATCH] wrap more strings in Ox._ --- static/js/folders.js | 8 ++++---- static/js/helpDialog.js | 2 +- static/js/insertEmbedDialog.js | 2 +- static/js/namesDialog.js | 5 +---- static/js/siteDialog.js | 5 ++++- static/js/titlesDialog.js | 5 +---- static/js/usersDialog.js | 2 +- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/static/js/folders.js b/static/js/folders.js index 2615575b9..f9aaa9441 100644 --- a/static/js/folders.js +++ b/static/js/folders.js @@ -26,7 +26,7 @@ pandora.ui.folders = function(section) { if (folder.id == 'personal') { if (pandora.user.level == 'guest') { extras = [ - infoButton(Ox._('Personal {0}', [Ox._(folderItems)]), + infoButton(Ox._('Personal ' + folderItems), Ox._('To create and share your own list of {0} please sign up or sign in.', [Ox._(pandora.site.itemName.plural.toLowerCase())]), Ox._('To create and share your own {0} please sign up or sign in.', [section])) ]; @@ -148,7 +148,7 @@ pandora.ui.folders = function(section) { } } else if (folder.id == 'favorite') { if (pandora.user.level == 'guest') { - extras = [infoButton(Ox._('Favorite ', folderItems), + extras = [infoButton(Ox._('Favorite ' + folderItems), Ox._('To browse and subscribe to shared {0} from other users, please sign up or sign in.', [Ox._(folderItems.toLowerCase())]))]; } else { extras = [pandora.$ui.manageListsButton['favorite'] = Ox.Button({ @@ -196,7 +196,7 @@ pandora.ui.folders = function(section) { } } else if (folder.id == 'featured') { if (pandora.user.level != 'admin') { - extras = [infoButton(Ox._('Featured {0}', [Ox._(folderItems)]), + extras = [infoButton(Ox._('Featured ' + folderItems), Ox._('Featured {0} are selected public {0}, picked by the {1} staff.', [Ox._(folderItems.toLowerCase()), pandora.site.site.name]))]; } else { @@ -279,7 +279,7 @@ pandora.ui.folders = function(section) { collapsed: !ui.showFolder.items[folder.id], extras: extras, size: 16, - title: folder.title + title: Ox._(folder.title) }) .bindEvent({ // fixme: duplicated diff --git a/static/js/helpDialog.js b/static/js/helpDialog.js index 82f567527..0dea1ba3e 100644 --- a/static/js/helpDialog.js +++ b/static/js/helpDialog.js @@ -82,7 +82,7 @@ pandora.ui.helpDialog = function() { } ], items: pandora.site.help.map(function(value, index) { - return Ox.extend({index: index}, value); + return Ox.extend({index: index}, value, {title: Ox._(value.title)}); }), max: 1, min: 1, diff --git a/static/js/insertEmbedDialog.js b/static/js/insertEmbedDialog.js index 057ae30a2..939f8a65b 100644 --- a/static/js/insertEmbedDialog.js +++ b/static/js/insertEmbedDialog.js @@ -168,7 +168,7 @@ pandora.ui.insertEmbedDialog = function(/*[url, ]callback*/) { .appendTo($form); $input.item = Ox.Input({ - label: pandora.site.itemName.singular, + label: Ox._(pandora.site.itemName.singular), labelWidth: 128, value: item, width: formWidth diff --git a/static/js/namesDialog.js b/static/js/namesDialog.js index 257c88922..180685ab0 100644 --- a/static/js/namesDialog.js +++ b/static/js/namesDialog.js @@ -74,10 +74,7 @@ pandora.ui.namesDialog = function() { .bindEvent({ init: function(data) { numberOfNames = data.items; - $status.html( - Ox.formatNumber(numberOfNames) - + ' name' + (numberOfNames == 1 ? '' : 's') - ); + $status.html(Ox.formatCount(numberOfNames, 'name')); }, open: function(data) { $list.find('.OxItem.OxSelected > .OxCell.OxColumnSortname') diff --git a/static/js/siteDialog.js b/static/js/siteDialog.js index d335eaaab..179814376 100644 --- a/static/js/siteDialog.js +++ b/static/js/siteDialog.js @@ -8,7 +8,10 @@ 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: Ox._('Software')}]); + tabs = Ox.clone(pandora.site.sitePages, true).map(function(page) { + page.title = Ox._(page.title); + return page; + }).concat([{id: 'software', title: Ox._('Software')}]); Ox.getObjectById(tabs, section).selected = true; var $tabPanel = Ox.TabPanel({ content: function(id) { diff --git a/static/js/titlesDialog.js b/static/js/titlesDialog.js index 1a5bd2a32..14fe38dbb 100644 --- a/static/js/titlesDialog.js +++ b/static/js/titlesDialog.js @@ -63,10 +63,7 @@ pandora.ui.titlesDialog = function() { .bindEvent({ init: function(data) { numberOfTitles = data.items; - $status.html( - Ox.formatNumber(numberOfTitles) - + ' title' + (numberOfTitles == 1 ? '' : 's') - ); + $status.html(Ox.formatCount(numberOfTitles, 'title')); }, open: function(data) { $list.find('.OxItem.OxSelected > .OxCell.OxColumnSorttitle') diff --git a/static/js/usersDialog.js b/static/js/usersDialog.js index 9630132ca..ab8125925 100644 --- a/static/js/usersDialog.js +++ b/static/js/usersDialog.js @@ -79,7 +79,7 @@ pandora.ui.usersDialog = function() { $findInput = Ox.Input({ changeOnKeypress: true, clear: true, - placeholder: 'Find: All', + placeholder: Ox._('Find: All'), width: 192 }) .bindEvent({