Adding the t() function to have the labels in the search results translated
This should solve #55
This commit is contained in:
parent
b66dd3ebef
commit
37296b8b6d
|
@ -4,6 +4,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
||||||
function search($query) {
|
function search($query) {
|
||||||
$files=OC_FileCache::search($query,true);
|
$files=OC_FileCache::search($query,true);
|
||||||
$results=array();
|
$results=array();
|
||||||
|
$l=OC_L10N::get('lib');
|
||||||
foreach($files as $fileData) {
|
foreach($files as $fileData) {
|
||||||
$path = $fileData['path'];
|
$path = $fileData['path'];
|
||||||
$mime = $fileData['mimetype'];
|
$mime = $fileData['mimetype'];
|
||||||
|
@ -13,7 +14,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
||||||
$skip = false;
|
$skip = false;
|
||||||
if($mime=='httpd/unix-directory') {
|
if($mime=='httpd/unix-directory') {
|
||||||
$link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
|
$link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
|
||||||
$type = 'Files';
|
$type = (string)$l->t('Files');
|
||||||
}else{
|
}else{
|
||||||
$link = OC_Helper::linkTo( 'files', 'download.php', array('file' => $path));
|
$link = OC_Helper::linkTo( 'files', 'download.php', array('file' => $path));
|
||||||
$mimeBase = $fileData['mimepart'];
|
$mimeBase = $fileData['mimepart'];
|
||||||
|
@ -22,16 +23,16 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
||||||
$skip = true;
|
$skip = true;
|
||||||
break;
|
break;
|
||||||
case 'text':
|
case 'text':
|
||||||
$type = 'Text';
|
$type = (string)$l->t('Text');
|
||||||
break;
|
break;
|
||||||
case 'image':
|
case 'image':
|
||||||
$type = 'Images';
|
$type = (string)$l->t('Images');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if($mime=='application/xml') {
|
if($mime=='application/xml') {
|
||||||
$type = 'Text';
|
$type = (string)$l->t('Text');
|
||||||
}else{
|
}else{
|
||||||
$type = 'Files';
|
$type = (string)$l->t('Files');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue