diff options
author | Felix Moeller <mail@felixmoeller.de> | 2012-10-22 20:52:51 +0200 |
---|---|---|
committer | Felix Moeller <mail@felixmoeller.de> | 2012-10-22 20:55:05 +0200 |
commit | 37296b8b6dd7a1b96c3e4fa326995bf3747ac116 (patch) | |
tree | 5a10ee6f625b2b1dcc57bbb2989eb0bf1212e0ee /lib/search | |
parent | b66dd3ebef605e0cd681c5621706e880c7d38571 (diff) | |
download | nextcloud-server-37296b8b6dd7a1b96c3e4fa326995bf3747ac116.tar.gz nextcloud-server-37296b8b6dd7a1b96c3e4fa326995bf3747ac116.zip |
Adding the t() function to have the labels in the search results translated
This should solve #55
Diffstat (limited to 'lib/search')
-rw-r--r-- | lib/search/provider/file.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php index 24832296c59..8d0843ce2d2 100644 --- a/lib/search/provider/file.php +++ b/lib/search/provider/file.php @@ -4,6 +4,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ function search($query) { $files=OC_FileCache::search($query,true); $results=array(); + $l=OC_L10N::get('lib'); foreach($files as $fileData) { $path = $fileData['path']; $mime = $fileData['mimetype']; @@ -13,7 +14,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ $skip = false; if($mime=='httpd/unix-directory') { $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path)); - $type = 'Files'; + $type = (string)$l->t('Files'); }else{ $link = OC_Helper::linkTo( 'files', 'download.php', array('file' => $path)); $mimeBase = $fileData['mimepart']; @@ -22,16 +23,16 @@ class OC_Search_Provider_File extends OC_Search_Provider{ $skip = true; break; case 'text': - $type = 'Text'; + $type = (string)$l->t('Text'); break; case 'image': - $type = 'Images'; + $type = (string)$l->t('Images'); break; default: if($mime=='application/xml') { - $type = 'Text'; + $type = (string)$l->t('Text'); }else{ - $type = 'Files'; + $type = (string)$l->t('Files'); } } } |