From 3f0327ff1d8eb7fedc6bf877e3a2b4755bfea003 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Mon, 12 Mar 2012 22:31:52 +0100 Subject: [PATCH] Adds sr translation by Goran. --- README.md | 2 + src/_h5ai/config.js | 15 ++++++++ src/_h5ai/js/inc/Core.js | 5 ++- src/_h5ai/js/inc/H5ai.js | 71 +++++++++++++++++++++--------------- src/_h5ai/js/inc/Html.js | 2 +- src/_h5ai/js/inc/Localize.js | 3 +- 6 files changed, 65 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 68e0b7a6..3aefe027 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h * updates lv translation * adds ro translation by [Jakob Cosoroabă](http://github.com/midday) * adds ja translation by [metasta](http://github.com/metasta) +* adds nb translation by [Sindre Sorhus](http://github.com/sindresorhus) +* adds sr translation by [Goran](http://github.com/vBm) ### v0.18 - *2012-02-24* diff --git a/src/_h5ai/config.js b/src/_h5ai/config.js index 5021c56c..8de84a03 100644 --- a/src/_h5ai/config.js +++ b/src/_h5ai/config.js @@ -443,6 +443,21 @@ var H5AI_CONFIG = { "noMatch": "no match" }, + "sr": { + "lang": "srpski", + "details": "detalji", + "icons": "ikone", + "name": "Ime", + "lastModified": "Poslednja modifikacija", + "size": "Veličina", + "parentDirectory": "Roditeljski direktorijum", + "empty": "prazno", + "folders": "direktorijum", + "files": "fajlovi", + "download": "download", + "noMatch": "bez poklapanja" + }, + "sv": { "lang": "svenska", "details": "detaljerad", diff --git a/src/_h5ai/js/inc/Core.js b/src/_h5ai/js/inc/Core.js index b325fb18..e41fdab9 100644 --- a/src/_h5ai/js/inc/Core.js +++ b/src/_h5ai/js/inc/Core.js @@ -306,8 +306,9 @@ shiftTree: shiftTree, linkHoverStates: linkHoverStates, initIndicators: initIndicators, - getFileType: getFileType, - init: init + getFileType: getFileType }; + h5ai(init); + }(window, jQuery, h5ai)); diff --git a/src/_h5ai/js/inc/H5ai.js b/src/_h5ai/js/inc/H5ai.js index a2233ad2..2d417616 100644 --- a/src/_h5ai/js/inc/H5ai.js +++ b/src/_h5ai/js/inc/H5ai.js @@ -33,40 +33,53 @@ qrCodesSize: null, showFilter: false }, - h5ai = function () { + initMethods = [], + addInitMethod = function (fn) { + + if ($.isFunction(fn)) { + initMethods.push(fn); + } + }, + init = function () { + + var $html = $('html'); + + h5ai.isJs = $html.hasClass('h5ai-js'); + h5ai.isPhp = $html.hasClass('h5ai-php'); + + if (h5ai.isJs) { + h5ai.extended.init(); + } + + $.each(initMethods, function (idx, initMethod) { + + initMethod(); + }) + + // h5ai.core.init(); + h5ai.localize.init(); + h5ai.sort.init(); + h5ai.finder.init(); + h5ai.zippedDownload.init(); + h5ai.context.init(); + + if (h5ai.isPhp) { + $('#tree').scrollpanel(); + h5ai.core.shiftTree(false, true); + } + + // publish for testing + window.h5ai = h5ai; + }, + h5ai = function (fn) { + + addInitMethod(fn); }; h5ai.config = config; h5ai.settings = $.extend({}, defaults, config.options); - h5ai.init = function () { - - var $html = $('html'); - - h5ai.isJs = $html.hasClass('h5ai-js'); - h5ai.isPhp = $html.hasClass('h5ai-php'); - - if (h5ai.isJs) { - h5ai.extended.init(); - } - - h5ai.core.init(); - h5ai.localize.init(); - h5ai.sort.init(); - h5ai.finder.init(); - h5ai.zippedDownload.init(); - h5ai.context.init(); - - if (h5ai.isPhp) { - $('#tree').scrollpanel(); - h5ai.core.shiftTree(false, true); - } - - // publish for testing - window.h5ai = h5ai; - }; - // @include "Util.js" // @include "Core.js" // @include "Localize.js" @@ -80,6 +93,6 @@ // @include "Html.js" // @include "Extended.js" - $(h5ai.init); + $(init); }(jQuery, H5AI_CONFIG)); diff --git a/src/_h5ai/js/inc/Html.js b/src/_h5ai/js/inc/Html.js index 62940d6b..6d8e60a9 100644 --- a/src/_h5ai/js/inc/Html.js +++ b/src/_h5ai/js/inc/Html.js @@ -132,7 +132,7 @@ if (path.html.$extended) { path.html.$extended.replaceWith($html); - h5ai.core.formatDates(); + h5ai.localize.formatDates(); } path.html.$extended = $html; diff --git a/src/_h5ai/js/inc/Localize.js b/src/_h5ai/js/inc/Localize.js index ecf6030c..27cc6062 100644 --- a/src/_h5ai/js/inc/Localize.js +++ b/src/_h5ai/js/inc/Localize.js @@ -101,7 +101,8 @@ }; h5ai.localize = { - init: init + init: init, + formatDates: formatDates }; }(jQuery, h5ai));