allow apps to add translation for search result typeid

This commit is contained in:
Jörn Friedrich Dreyer 2014-06-06 11:28:43 +02:00
parent 2801f0f222
commit 7c29645f22
2 changed files with 8 additions and 1 deletions

View File

@ -585,6 +585,13 @@ OC.search.customResults={};
OC.search.currentResult=-1; OC.search.currentResult=-1;
OC.search.lastQuery=''; OC.search.lastQuery='';
OC.search.lastResults={}; OC.search.lastResults={};
//translations for result type ids, can be extended by apps
OC.search.resultTypes={
file: t('core','File'),
folder: t('core','Folder'),
image: t('core','Image'),
audio: t('core','Audio')
};
OC.addStyle.loaded=[]; OC.addStyle.loaded=[];
OC.addScript.loaded=[]; OC.addScript.loaded=[];

View File

@ -64,7 +64,7 @@ OC.search.showResults=function(results){
row.data('index',index); row.data('index',index);
if (i === 0){ if (i === 0){
var typeName = typeid.charAt(0).toUpperCase() + typeid.slice(1); var typeName = OC.search.resultTypes[typeid];
row.children('td.type').text(t('lib', typeName)); row.children('td.type').text(t('lib', typeName));
} }
row.find('td.result div.name').text(type[i].name); row.find('td.result div.name').text(type[i].name);