Merge pull request #4376 from owncloud/use_plurals

Use plural translations
This commit is contained in:
Jörn Friedrich Dreyer 2013-08-14 10:23:19 -07:00
commit 8f3f47e868
5 changed files with 16 additions and 35 deletions

View File

@ -452,13 +452,14 @@ $(document).ready(function(){
var currentUploads = parseInt(uploadtext.attr('currentUploads'));
currentUploads += 1;
uploadtext.attr('currentUploads', currentUploads);
var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads);
if(currentUploads === 1) {
var img = OC.imagePath('core', 'loading.gif');
data.context.find('td.filename').attr('style','background-image:url('+img+')');
uploadtext.text(t('files', '1 file uploading'));
uploadtext.text(translatedText);
uploadtext.show();
} else {
uploadtext.text(currentUploads + ' ' + t('files', 'files uploading'));
uploadtext.text(translatedText);
}
} else {
// add as stand-alone row to filelist

View File

@ -759,21 +759,13 @@ function procesSelection(){
$('#headerSize').text(humanFileSize(totalSize));
var selection='';
if(selectedFolders.length>0){
if(selectedFolders.length==1){
selection+=t('files','1 folder');
}else{
selection+=t('files','{count} folders',{count: selectedFolders.length});
}
selection += n('files', '%n folder', '%n folders', selectedFolders.length);
if(selectedFiles.length>0){
selection+=' & ';
}
}
if(selectedFiles.length>0){
if(selectedFiles.length==1){
selection+=t('files','1 file');
}else{
selection+=t('files','{count} files',{count: selectedFiles.length});
}
selection += n('files', '%n file', '%n files', selectedFiles.length);
}
$('#headerName>span.name').text(selection);
$('#modified').text('');

View File

@ -188,21 +188,13 @@ function processSelection(){
$('.selectedActions').show();
var selection='';
if(selectedFolders.length>0){
if(selectedFolders.length === 1){
selection+=t('files','1 folder');
}else{
selection+=t('files','{count} folders',{count: selectedFolders.length});
}
selection += n('files', '%n folder', '%n folders', selectedFolders.length);
if(selectedFiles.length>0){
selection+=' & ';
}
}
if(selectedFiles.length>0){
if(selectedFiles.length === 1){
selection+=t('files','1 file');
}else{
selection+=t('files','{count} files',{count: selectedFiles.length});
}
selection += n('files', '%n file', '%n files', selectedFiles.length);
}
$('#headerName>span.name').text(selection);
$('#modified').text('');

View File

@ -813,15 +813,13 @@ function relative_modified_date(timestamp) {
var diffdays = Math.round(diffhours/24);
var diffmonths = Math.round(diffdays/31);
if(timediff < 60) { return t('core','seconds ago'); }
else if(timediff < 120) { return t('core','1 minute ago'); }
else if(timediff < 3600) { return t('core','{minutes} minutes ago',{minutes: diffminutes}); }
else if(timediff < 7200) { return t('core','1 hour ago'); }
else if(timediff < 86400) { return t('core','{hours} hours ago',{hours: diffhours}); }
else if(timediff < 3600) { return n('core','%n minute ago', '%n minutes ago', diffminutes); }
else if(timediff < 86400) { return n('core', '%n hour ago', '%n hours ago', diffhours); }
else if(timediff < 86400) { return t('core','today'); }
else if(timediff < 172800) { return t('core','yesterday'); }
else if(timediff < 2678400) { return t('core','{days} days ago',{days: diffdays}); }
else if(timediff < 2678400) { return n('core', '%n day ago', '%n days ago', diffdays); }
else if(timediff < 5184000) { return t('core','last month'); }
else if(timediff < 31556926) { return t('core','{months} months ago',{months: diffmonths}); }
else if(timediff < 31556926) { return n('core', '%n month ago', '%n months ago', diffmonths); }
//else if(timediff < 31556926) { return t('core','months ago'); }
else if(timediff < 63113852) { return t('core','last year'); }
else { return t('core','years ago'); }

View File

@ -78,15 +78,13 @@ function relative_modified_date($timestamp) {
$diffmonths = round($diffdays/31);
if($timediff < 60) { return $l->t('seconds ago'); }
else if($timediff < 120) { return $l->t('1 minute ago'); }
else if($timediff < 3600) { return $l->t('%d minutes ago', $diffminutes); }
else if($timediff < 7200) { return $l->t('1 hour ago'); }
else if($timediff < 86400) { return $l->t('%d hours ago', $diffhours); }
else if($timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); }
else if($timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); }
else if((date('G')-$diffhours) > 0) { return $l->t('today'); }
else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); }
else if($timediff < 2678400) { return $l->t('%d days ago', $diffdays); }
else if($timediff < 2678400) { return $l->n('%n day go', '%n days ago', $diffdays); }
else if($timediff < 5184000) { return $l->t('last month'); }
else if((date('n')-$diffmonths) > 0) { return $l->t('%d months ago', $diffmonths); }
else if((date('n')-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); }
else if($timediff < 63113852) { return $l->t('last year'); }
else { return $l->t('years ago'); }
}