allow apps to add translation for search result typeid
This commit is contained in:
parent
2801f0f222
commit
7c29645f22
|
@ -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=[];
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue