Skip to content

Commit

Permalink
fix root i18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Aug 31, 2012
1 parent fd095d7 commit 02d5f16
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
9 changes: 1 addition & 8 deletions js/commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,9 @@ elFinder.prototype.commands.info = function() {

if (cnt == 1) {
file = files[0];
if (!file.phash) {
name = 'volume_'+file.name;
i18 = fm.i18n(name);
if (i18 != name) {
file.name = i18;
}
}

view = view.replace('{class}', fm.mime2class(file.mime));
title = tpl.itemTitle.replace('{name}', file.name).replace('{kind}', fm.mime2kind(file));
title = tpl.itemTitle.replace('{name}', fm.escape(file.i18 || file.name)).replace('{kind}', fm.mime2kind(file));

if (file.tmb) {
tmb = fm.option('tmbUrl')+file.tmb;
Expand Down
10 changes: 9 additions & 1 deletion js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ window.elFinder = function(node, opts) {
while (l--) {
f = data[l];
if (f.name && f.hash && f.mime) {
if (!f.phash) {
var name = 'volume_'+f.name,
i18 = self.i18n(name);

if (name != i18) {
f.i18 = i18;
}
}
files[f.hash] = f;
}
}
Expand Down Expand Up @@ -681,7 +689,7 @@ window.elFinder = function(node, opts) {
path = [];

while (hash && (file = files[hash]) && file.hash) {
path.unshift(file.name);
path.unshift(file.i18 || file.name);
hash = file.phash;
}

Expand Down
1 change: 1 addition & 0 deletions js/i18n/elfinder.ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object'
'kindVideoFlash' : 'Видео Flash',
'kindVideoMKV' : 'Видео Matroska',
'kindVideoOGG' : 'Видео Ogg'

}
}
}
Expand Down
11 changes: 1 addition & 10 deletions js/ui/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,7 @@ $.fn.elfindertree = function(fm, opts) {
* @return String
*/
itemhtml = function(dir) {
if (!dir.phash) {
var name = 'volume_'+dir.name,
i18n = fm.i18n(name);

if (name != i18n) {
dir.name = i18n;
}
}

dir.name = fm.escape(dir.name);
dir.name = fm.escape(dir.i18 || dir.name);

return tpl.replace(/(?:\{([a-z]+)\})/ig, function(m, key) {
return dir[key] || (replace[key] ? replace[key](dir) : '');
Expand Down

0 comments on commit 02d5f16

Please sign in to comment.