mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
Page:
Automatically load language
Pages
3rd party connectors, plugins, modules
Adding file description to Properties dialog 2.1
Adding file description to Properties dialog
Adding new column to list view in 2.1
Advisory about vulnerability of CVE 2018 9109 and CVE 2018 9110
Automatically load language
Basic Authentication Example
Build and compress elFinder from source
Client Server API 2.0
Client Server API 2.1
Client configuration options 2.1
Client configuration options
Client event API
Common issues
Connector configuration options 2.1
Connector configuration options
Create dialog with custom context menu command
Custom context menu command
Custom search function
Disable real file path from being shown
Getting encoded hash from the path
HOWTOs by external sites
Home
How to get OAuth token
How to load CSS with RequireJS
Install
Integration with CKEditor (jQuery UI dialog mode) Varian 2 (change url)
Integration with CKEditor (jQuery UI dialog mode)
Integration with CKEditor 4 (jQuery UI dialog mode)
Integration with CKEditor 4
Integration with CKEditor 5
Integration with CKEditor
Integration with CodeIgniter
Integration with Codeigniter 2
Integration with Multiple Summernote (fixed functions)
Integration with TinyMCE 3.x
Integration with TinyMCE 4.x
Integration with elRTE 1.x
Logging
Multiple Roots
Node.js connector
Simple file permissions control
Using custom editor to edit files within elfinder
Using elFinder 2.x UI with 1.x connector
Using toast() to display popup notifications in 2.1
Clone
1
Automatically load language
Sergey B (Troex Nevelin) edited this page 2016-05-05 18:23:14 +03:00
Automatically load language based on browser locale setting or url lang parameter
<script type="text/javascript" charset="utf-8">
(function($){
var i18nPath = 'js/i18n',
start = function(lng) {
$().ready(function() {
var elf = $('#elfinder').elfinder({
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
lang : lng,
url : 'php/connector.php' // connector URL (REQUIRED)
}).elfinder('instance');
});
},
loct = window.location.search,
full_lng, locm, lng;
// detect language
if (loct && (locm = loct.match(/lang=([a-zA-Z_-]+)/))) {
full_lng = locm[1];
} else {
full_lng = (navigator.browserLanguage || navigator.language || navigator.userLanguage);
}
lng = full_lng.substr(0,2);
if (lng == 'ja') lng = 'jp';
else if (lng == 'pt') lng = 'pt_BR';
else if (lng == 'zh') lng = (full_lng.substr(0,5) == 'zh-tw')? 'zh_TW' : 'zh_CN';
if (lng != 'en') {
$.ajax({
url : i18nPath+'/elfinder.'+lng+'.js',
cache : true,
dataType : 'script'
})
.done(function() {
start(lng);
})
.fail(function() {
start('en');
});
} else {
start(lng);
}
})(jQuery);
</script>
<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>