summaryrefslogtreecommitdiffstats
path: root/search
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-24 12:50:54 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-10-29 10:09:12 +0100
commitd71cd680dd6133ad254fd296319aeab6deb77686 (patch)
tree5540046761fb4d14c0142c87b8692011b9e21c65 /search
parenta589d61b78fbfedad8fcf3ee59522b2e95de48ed (diff)
downloadnextcloud-server-d71cd680dd6133ad254fd296319aeab6deb77686.tar.gz
nextcloud-server-d71cd680dd6133ad254fd296319aeab6deb77686.zip
Include core translations
Moved search result type translations to search.js Load JS translations earlier Translations need to be loaded earlier to make sure that some JS files like search.js get access to translations at this time. This requires the template initialization to be moved to after session initialization, because only after the session we have access to the current language.
Diffstat (limited to 'search')
-rw-r--r--search/js/result.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/search/js/result.js b/search/js/result.js
index 13be0b552bf..fe84aecde3e 100644
--- a/search/js/result.js
+++ b/search/js/result.js
@@ -1,3 +1,20 @@
+/*
+ * Copyright (c) 2014
+ *
+ * This file is licensed under the Affero General Public License version 3
+ * or later.
+ *
+ * See the COPYING-README file.
+ *
+ */
+
+//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.search.catagorizeResults=function(results){
var types={};
for(var i=0;i<results.length;i++){
@@ -118,4 +135,4 @@ OC.search.renderCurrent=function(){
$('#searchresults tr.result').removeClass('current');
$(result).addClass('current');
}
-}; \ No newline at end of file
+};