Merge pull request #17 from scambra/4.5-l10n-fixes

Fix some untranslated strings
This commit is contained in:
Thomas Müller 2012-09-21 16:09:30 -07:00
commit ac69974d73
7 changed files with 48 additions and 42 deletions

View File

@ -179,6 +179,7 @@ FileActions.register('all','Delete', OC.PERMISSION_DELETE, function(){return OC.
$('.tipsy').remove(); $('.tipsy').remove();
}); });
// t('files', 'Rename')
FileActions.register('all','Rename', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename');},function(filename){ FileActions.register('all','Rename', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename');},function(filename){
FileList.rename(filename); FileList.rename(filename);
}); });

View File

@ -119,7 +119,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
$folder->assign('uploadMaxHumanFilesize', 0); $folder->assign('uploadMaxHumanFilesize', 0);
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('folder', $folder->fetchPage(), false); $tmpl->assign('folder', $folder->fetchPage(), false);
$tmpl->assign('details', $uidOwner.' shared the folder '.$baseDir.' with you'); $tmpl->assign('uidOwner', $uidOwner);
$tmpl->assign('dir', basename($dir)); $tmpl->assign('dir', basename($dir));
$tmpl->assign('filename', basename($path)); $tmpl->assign('filename', basename($path));
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path)); $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
@ -132,7 +132,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath, false); $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath, false);
} else { } else {
// Show file preview if viewer is available // Show file preview if viewer is available
$tmpl->assign('details', $uidOwner.' shared the file '.basename($path).' with you'); $tmpl->assign('uidOwner', $uidOwner);
$tmpl->assign('dir', dirname($path)); $tmpl->assign('dir', dirname($path));
$tmpl->assign('filename', basename($path)); $tmpl->assign('filename', basename($path));
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path)); $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
@ -155,4 +155,4 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
} }
header('HTTP/1.0 404 Not Found'); header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest'); $tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage(); $tmpl->printPage();

View File

@ -5,7 +5,11 @@
<header><div id="header"> <header><div id="header">
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
<div class="header-right"> <div class="header-right">
<span id="details"><?php echo $_['details']; ?></span> <?php if (isset($_['folder'])): ?>
<span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['uidOwner'], $_['filename'])) ?></span>
<?php else: ?>
<span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['uidOwner'], $_['filename'])) ?></span>
<?php endif; ?>
<?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
<a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a>
<?php endif; ?> <?php endif; ?>
@ -30,4 +34,4 @@
<div id="content"></div> <div id="content"></div>
<table></table> <table></table>
</div> </div>
<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; <?php echo $l->t('web services under your control'); ?></p></footer> <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; <?php echo $l->t('web services under your control'); ?></p></footer>

View File

@ -10,10 +10,10 @@ $(document).ready(function() {
$(document).ready(function(){ $(document).ready(function(){
if (typeof FileActions !== 'undefined') { if (typeof FileActions !== 'undefined') {
// Add history button to files/index.php // Add history button to 'files/index.php'
FileActions.register( FileActions.register(
'file' 'file'
,'History' , t('files_versions', 'History')
, OC.PERMISSION_UPDATE , OC.PERMISSION_UPDATE
, function() { , function() {
// Specify icon for hitory button // Specify icon for hitory button
@ -147,4 +147,4 @@ $(this).click(
} }
); );

View File

@ -106,7 +106,7 @@ var OCdialogs = {
var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content'; var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content';
var c_id = '#'+c_name; var c_id = '#'+c_name;
var d = '<div id="'+c_name+'" title="'+title+'"><select id="dirtree"><option value="0">'+OC.currentUser+'</option></select><div id="filelist"></div><div class="filepicker_loader"><img src="'+OC.filePath('gallery','img','loading.gif')+'"></div></div>'; var d = '<div id="'+c_name+'" title="'+title+'"><select id="dirtree"><option value="0">'+OC.currentUser+'</option></select><div id="filelist"></div><div class="filepicker_loader"><img src="'+OC.filePath('gallery','img','loading.gif')+'"></div></div>';
if (!modal) modal = false; // Huh..? if (!modal) modal = false; // Huh..
if (!multiselect) multiselect = false; if (!multiselect) multiselect = false;
$('body').append(d); $('body').append(d);
$(c_id + ' #dirtree').focus(function() { $(c_id + ' #dirtree').focus(function() {
@ -120,7 +120,7 @@ var OCdialogs = {
}).data('multiselect', multiselect).data('mimetype',mimetype_filter); }).data('multiselect', multiselect).data('mimetype',mimetype_filter);
// build buttons // build buttons
var b = [{ var b = [{
text: t('dialogs', 'Choose'), text: t('core', 'Choose'),
click: function(){ click: function(){
if (callback != undefined) { if (callback != undefined) {
var p; var p;
@ -140,7 +140,7 @@ var OCdialogs = {
} }
}, },
{ {
text: t('dialogs', 'Cancel'), text: t('core', 'Cancel'),
click: function(){$(c_id).dialog('close'); }} click: function(){$(c_id).dialog('close'); }}
]; ];
$(c_id).dialog({width: ((4*$('body').width())/9), height: 400, modal: modal, buttons: b}); $(c_id).dialog({width: ((4*$('body').width())/9), height: 400, modal: modal, buttons: b});
@ -156,11 +156,11 @@ var OCdialogs = {
var b = []; var b = [];
switch (buttons) { switch (buttons) {
case OCdialogs.YES_NO_BUTTONS: case OCdialogs.YES_NO_BUTTONS:
b[1] = {text: t('dialogs', 'No'), click: function(){ if (callback != undefined) callback(false); $(c_id).dialog('close'); }}; b[1] = {text: t('core', 'No'), click: function(){ if (callback != undefined) callback(false); $(c_id).dialog('close'); }};
b[0] = {text: t('dialogs', 'Yes'), click: function(){ if (callback != undefined) callback(true); $(c_id).dialog('close');}}; b[0] = {text: t('core', 'Yes'), click: function(){ if (callback != undefined) callback(true); $(c_id).dialog('close');}};
break; break;
case OCdialogs.OK_CANCEL_BUTTONS: case OCdialogs.OK_CANCEL_BUTTONS:
b[1] = {text: t('dialogs', 'Cancel'), click: function(){$(c_id).dialog('close'); }}; b[1] = {text: t('core', 'Cancel'), click: function(){$(c_id).dialog('close'); }};
case OCdialogs.OK_BUTTON: // fallthrough case OCdialogs.OK_BUTTON: // fallthrough
var f; var f;
switch(dialog_type) { switch(dialog_type) {
@ -174,7 +174,7 @@ var OCdialogs = {
f = function(){OCdialogs.form_ok_handler(callback, c_id)}; f = function(){OCdialogs.form_ok_handler(callback, c_id)};
break; break;
} }
b[0] = {text: t('dialogs', 'Ok'), click: f}; b[0] = {text: t('core', 'Ok'), click: f};
break; break;
} }
var possible_height = ($('tr', d).size()+1)*30; var possible_height = ($('tr', d).size()+1)*30;

View File

@ -79,7 +79,7 @@ OC.Share={
var item = itemSource; var item = itemSource;
} }
if (typeof OC.Share.statuses[item] === 'undefined') { if (typeof OC.Share.statuses[item] === 'undefined') {
// NOTE: Check doesn't always work and misses some shares, fix later // NOTE: Check does not always work and misses some shares, fix later
checkShares = true; checkShares = true;
} else { } else {
checkShares = true; checkShares = true;
@ -100,7 +100,7 @@ OC.Share={
callback(result.data); callback(result.data);
} }
} else { } else {
OC.dialogs.alert(result.data.message, 'Error while sharing'); OC.dialogs.alert(result.data.message, t('core', 'Error while sharing'));
} }
}); });
}, },
@ -111,14 +111,14 @@ OC.Share={
callback(); callback();
} }
} else { } else {
OC.dialogs.alert('Error', 'Error while unsharing'); OC.dialogs.alert(t('core', 'Error'), t('core', 'Error while unsharing'));
} }
}); });
}, },
setPermissions:function(itemType, itemSource, shareType, shareWith, permissions) { setPermissions:function(itemType, itemSource, shareType, shareWith, permissions) {
$.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setPermissions', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith, permissions: permissions }, function(result) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setPermissions', itemType: itemType, itemSource: itemSource, shareType: shareType, shareWith: shareWith, permissions: permissions }, function(result) {
if (!result || result.status !== 'success') { if (!result || result.status !== 'success') {
OC.dialogs.alert('Error', 'Error while changing permissions'); OC.dialogs.alert(t('core', 'Error'), t('core', 'Error while changing permissions'));
} }
}); });
}, },
@ -127,30 +127,30 @@ OC.Share={
var html = '<div id="dropdown" class="drop" data-item-type="'+itemType+'" data-item-source="'+itemSource+'">'; var html = '<div id="dropdown" class="drop" data-item-type="'+itemType+'" data-item-source="'+itemSource+'">';
if (data.reshare) { if (data.reshare) {
if (data.reshare.share_type == OC.Share.SHARE_TYPE_GROUP) { if (data.reshare.share_type == OC.Share.SHARE_TYPE_GROUP) {
html += '<span class="reshare">Shared with you and the group '+data.reshare.share_with+' by '+data.reshare.uid_owner+'</span>'; html += '<span class="reshare">'+t('core', 'Shared with you and the group %s by %s', data.reshare.share_with, data.reshare.uid_owner)+'</span>';
} else { } else {
html += '<span class="reshare">Shared with you by '+data.reshare.uid_owner+'</span>'; html += '<span class="reshare">'+t('core', 'Shared with you by %s', data.reshare.uid_owner)+'</span>';
} }
html += '<br />'; html += '<br />';
} }
if (possiblePermissions & OC.PERMISSION_SHARE) { if (possiblePermissions & OC.PERMISSION_SHARE) {
html += '<input id="shareWith" type="text" placeholder="Share with" />'; html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';
html += '<ul id="shareWithList">'; html += '<ul id="shareWithList">';
html += '</ul>'; html += '</ul>';
if (link) { if (link) {
html += '<div id="link">'; html += '<div id="link">';
html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">Share with link</label>'; html += '<input type="checkbox" name="linkCheckbox" id="linkCheckbox" value="1" /><label for="linkCheckbox">'+t('core', 'Share with link')+'</label>';
html += '<a href="#" id="showPassword" style="display:none;"><img class="svg" alt="Password protect" src="'+OC.imagePath('core', 'actions/lock')+'"/></a>'; html += '<a href="#" id="showPassword" style="display:none;"><img class="svg" alt="'+t('core', 'Password protect')+'" src="'+OC.imagePath('core', 'actions/lock')+'"/></a>';
html += '<br />'; html += '<br />';
html += '<input id="linkText" type="text" readonly="readonly" />'; html += '<input id="linkText" type="text" readonly="readonly" />';
html += '<div id="linkPass">'; html += '<div id="linkPass">';
html += '<input id="linkPassText" type="password" placeholder="Password" />'; html += '<input id="linkPassText" type="password" placeholder="'+t('core', 'Password')+'" />';
html += '</div>'; html += '</div>';
html += '</div>'; html += '</div>';
} }
html += '<div id="expiration">'; html += '<div id="expiration">';
html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">Set expiration date</label>'; html += '<input type="checkbox" name="expirationCheckbox" id="expirationCheckbox" value="1" /><label for="expirationCheckbox">'+t('core', 'Set expiration date')+'</label>';
html += '<input id="expirationDate" type="text" placeholder="Expiration date" style="display:none; width:90%;" />'; html += '<input id="expirationDate" type="text" placeholder="'+t('core', 'Expiration date')+'" style="display:none; width:90%;" />';
html += '</div>'; html += '</div>';
$(html).appendTo(appendTo); $(html).appendTo(appendTo);
// Reset item shares // Reset item shares
@ -179,9 +179,9 @@ OC.Share={
// Suggest sharing via email if valid email address // Suggest sharing via email if valid email address
// var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i); // var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/i);
// if (pattern.test(search.term)) { // if (pattern.test(search.term)) {
// response([{label: 'Share via email: '+search.term, value: {shareType: OC.Share.SHARE_TYPE_EMAIL, shareWith: search.term}}]); // response([{label: t('core', 'Share via email: %s', search.term), value: {shareType: OC.Share.SHARE_TYPE_EMAIL, shareWith: search.term}}]);
// } else { // } else {
response(['No people found']); response([t('core', 'No people found')]);
// } // }
} }
}); });
@ -207,7 +207,7 @@ OC.Share={
} }
}); });
} else { } else {
html += '<input id="shareWith" type="text" placeholder="Resharing is not allowed" style="width:90%;" disabled="disabled"/>'; html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Resharing is not allowed')+'" style="width:90%;" disabled="disabled"/>';
html += '</div>'; html += '</div>';
$(html).appendTo(appendTo); $(html).appendTo(appendTo);
} }
@ -243,7 +243,7 @@ OC.Share={
if (collectionList.length > 0) { if (collectionList.length > 0) {
$(collectionList).append(', '+shareWith); $(collectionList).append(', '+shareWith);
} else { } else {
var html = '<li style="clear: both;" data-collection="'+item+'">Shared in '+item+' with '+shareWith+'</li>'; var html = '<li style="clear: both;" data-collection="'+item+'">'+t('core', 'Shared in %s with %s', item, shareWith)+'</li>';
$('#shareWithList').prepend(html); $('#shareWithList').prepend(html);
} }
} else { } else {
@ -264,7 +264,7 @@ OC.Share={
shareChecked = 'checked="checked"'; shareChecked = 'checked="checked"';
} }
var html = '<li style="clear: both;" data-share-type="'+shareType+'" data-share-with="'+shareWith+'">'; var html = '<li style="clear: both;" data-share-type="'+shareType+'" data-share-with="'+shareWith+'">';
html += '<a href="#" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>'; html += '<a href="#" class="unshare" style="display:none;"><img class="svg" alt="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>';
html += shareWith; html += shareWith;
if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) { if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) {
if (editChecked == '') { if (editChecked == '') {
@ -272,21 +272,21 @@ OC.Share={
} else { } else {
html += '<label>'; html += '<label>';
} }
html += '<input type="checkbox" name="edit" class="permissions" '+editChecked+' />can edit</label>'; html += '<input type="checkbox" name="edit" class="permissions" '+editChecked+' />'+t('core', 'can edit')+'</label>';
} }
html += '<a href="#" class="showCruds" style="display:none;"><img class="svg" alt="access control" src="'+OC.imagePath('core', 'actions/triangle-s')+'"/></a>'; html += '<a href="#" class="showCruds" style="display:none;"><img class="svg" alt="'+t('core', 'access control')+'" src="'+OC.imagePath('core', 'actions/triangle-s')+'"/></a>';
html += '<div class="cruds" style="display:none;">'; html += '<div class="cruds" style="display:none;">';
if (possiblePermissions & OC.PERMISSION_CREATE) { if (possiblePermissions & OC.PERMISSION_CREATE) {
html += '<label><input type="checkbox" name="create" class="permissions" '+createChecked+' data-permissions="'+OC.PERMISSION_CREATE+'" />create</label>'; html += '<label><input type="checkbox" name="create" class="permissions" '+createChecked+' data-permissions="'+OC.PERMISSION_CREATE+'" />'+t('core', 'create')+'</label>';
} }
if (possiblePermissions & OC.PERMISSION_UPDATE) { if (possiblePermissions & OC.PERMISSION_UPDATE) {
html += '<label><input type="checkbox" name="update" class="permissions" '+updateChecked+' data-permissions="'+OC.PERMISSION_UPDATE+'" />update</label>'; html += '<label><input type="checkbox" name="update" class="permissions" '+updateChecked+' data-permissions="'+OC.PERMISSION_UPDATE+'" />'+t('core', 'update')+'</label>';
} }
if (possiblePermissions & OC.PERMISSION_DELETE) { if (possiblePermissions & OC.PERMISSION_DELETE) {
html += '<label><input type="checkbox" name="delete" class="permissions" '+deleteChecked+' data-permissions="'+OC.PERMISSION_DELETE+'" />delete</label>'; html += '<label><input type="checkbox" name="delete" class="permissions" '+deleteChecked+' data-permissions="'+OC.PERMISSION_DELETE+'" />'+t('core', 'delete')+'</label>';
} }
if (possiblePermissions & OC.PERMISSION_SHARE) { if (possiblePermissions & OC.PERMISSION_SHARE) {
html += '<label><input type="checkbox" name="share" class="permissions" '+shareChecked+' data-permissions="'+OC.PERMISSION_SHARE+'" />share</label>'; html += '<label><input type="checkbox" name="share" class="permissions" '+shareChecked+' data-permissions="'+OC.PERMISSION_SHARE+'" />'+t('core', 'share')+'</label>';
} }
html += '</div>'; html += '</div>';
html += '</li>'; html += '</li>';
@ -310,7 +310,7 @@ OC.Share={
$('#showPassword').show(); $('#showPassword').show();
if (password != null) { if (password != null) {
$('#linkPass').show('blind'); $('#linkPass').show('blind');
$('#linkPassText').attr('placeholder', 'Password protected'); $('#linkPassText').attr('placeholder', t('core', 'Password protected'));
} }
$('#expiration').show(); $('#expiration').show();
}, },
@ -460,7 +460,7 @@ $(document).ready(function() {
var itemSource = $('#dropdown').data('item-source'); var itemSource = $('#dropdown').data('item-source');
OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() { OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $(this).val(), OC.PERMISSION_READ, function() {
$('#linkPassText').val(''); $('#linkPassText').val('');
$('#linkPassText').attr('placeholder', 'Password protected'); $('#linkPassText').attr('placeholder', t('core', 'Password protected'));
}); });
} }
}); });
@ -482,7 +482,7 @@ $(document).ready(function() {
var itemSource = $('#dropdown').data('item-source'); var itemSource = $('#dropdown').data('item-source');
$.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) { $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) {
if (!result || result.status !== 'success') { if (!result || result.status !== 'success') {
OC.dialogs.alert('Error', 'Error setting expiration date'); OC.dialogs.alert(t('core', 'Error'), t('core', 'Error setting expiration date'));
} }
}); });
}); });

View File

@ -158,7 +158,8 @@ class OC_Template{
if($renderas == 'user') { if($renderas == 'user') {
$this->vars['requesttoken'] = OC_Util::callRegister(); $this->vars['requesttoken'] = OC_Util::callRegister();
} }
$this->l10n = OC_L10N::get($app); $parts = explode('/', $app); // fix translation when app is something like core/lostpassword
$this->l10n = OC_L10N::get($parts[0]);
header('X-Frame-Options: Sameorigin'); header('X-Frame-Options: Sameorigin');
header('X-XSS-Protection: 1; mode=block'); header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff'); header('X-Content-Type-Options: nosniff');