From 7c29645f22eeb686ce7a25c9f8ad97b464d7febb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 6 Jun 2014 11:28:43 +0200 Subject: [PATCH] allow apps to add translation for search result typeid --- core/js/js.js | 7 +++++++ search/js/result.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/js/js.js b/core/js/js.js index b3cefa83be..03b496b263 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -585,6 +585,13 @@ OC.search.customResults={}; OC.search.currentResult=-1; OC.search.lastQuery=''; 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.addScript.loaded=[]; diff --git a/search/js/result.js b/search/js/result.js index b300f90f4c..04e999c62e 100644 --- a/search/js/result.js +++ b/search/js/result.js @@ -64,7 +64,7 @@ OC.search.showResults=function(results){ row.data('index',index); 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.find('td.result div.name').text(type[i].name);