Language
By default, interface language will automatically load based on detected browser language.
Translations is a work in progress. As we add new features, some texts remain in English.
Options from url
Visitors can override language options by appending parameters to the url in browser if required.
Assign specific language
If visitors wish to override the assigned language, simply append ?lang={code}
in browser.
https://demo.files.gallery/?lang=fr
Reset language
If visitors want to reset any previously assigned language, simply append ?lang=reset
in browser.
https://demo.files.gallery/?lang=reset
Enable language menu
The language menu (lang_menu
config option) can be enabled by appending lang_menu=1
.
https://demo.files.gallery/?lang_menu=1
Language config options
Language config options available in config.php
.
lang_default
Default interface language if browser language is not supported or lang_auto
is disabled.
'lang_default' => 'en'
lang_auto
Automatically assign interface language based on detected browser language.
'lang_auto' => true
Adding new custom language
In case the language you want to use does not exist or you simply want to add your own, you can add language files _files/lang/{code}.json
. If you want the language to automatically load based on browser language, it needs to be named following language code conventions [see ref]. If you want your new language as default, change option 'lang_default' => '{code}'
, and set 'lang_auto' => false
if you don't want the language automatically assigned from browser. Use the following default language template when adding your translation:
{
"blocks": "",
"columns": "",
"copy link": "",
"copy text": "",
"date": "",
"delete": "",
"directory is empty": "",
"download": "",
"duplicate": "",
"error": "",
"fail": "",
"files": "",
"filter": "",
"folders": "",
"google maps": "",
"grid": "",
"imagelist": "",
"images": "",
"kind": "",
"language": "",
"layout": "",
"list": "",
"loading": "",
"login": "",
"logout": "",
"matches found for": "",
"name": "",
"new file": "",
"new folder": "",
"open in new tab": "",
"rename": "",
"rows": "",
"save": "",
"show info": "",
"size": "",
"sort": "",
"space": "",
"uniform": "",
"upload": "",
"zoom": ""
}
Language javascript config
You can also extend languages and assign language options from javascript config.
_c.config = {
// custom language options
lang: {
// assign language menu items in topbar / true = all / false = no menu (default)
menu: ['pt', 'en', 'zh'], // Portuguese, English, Chinese
// override or create new languages
langs: {
fr: {
logout: 'déconnexion'
},
no: {
date: 'dato',
flag: 'no'
}
}
},
}
Submit language modifications
Feel free to submit new languages or improvements to existing translations. We will include improvements in official releases.