Skip to main content

Language

By default, interface language will load automatically based on detected browser language.

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 Menu Demo

Language config options​

Language config options are available in your config.php file.

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 language automatically assigned from browser. Use the default language template when adding your translation:

{
"archive": "",
"blocks": "",
"cancel": "",
"columns": "",
"copied to clipboard": "",
"copy": "",
"copy link": "",
"copy links": "",
"copy text": "",
"date": "",
"delete": "",
"details": "",
"directory is empty": "",
"download": "",
"duplicate": "",
"error": "",
"fail": "",
"file": "",
"files": "",
"filter": "",
"folder": "",
"folders": "",
"from clipboard": "",
"google maps": "",
"grid": "",
"height": "",
"home": "",
"image": "",
"imagelist": "",
"images": "",
"invalid": "",
"invalid login": "",
"is not writeable": "",
"kind": "",
"language": "",
"layout": "",
"list": "",
"loading": "",
"login": "",
"logout": "",
"matches found for": "",
"move": "",
"name": "",
"new file": "",
"new folder": "",
"new user": "",
"open": "",
"open in new tab": "",
"overlay": "",
"password": "",
"quality": "",
"reload": "",
"rename": "",
"resize and compress images": "",
"rows": "",
"save": "",
"select all": "",
"selection mode": "",
"settings": "",
"show info": "",
"shuffle": "",
"size": "",
"sort": "",
"space": "",
"uniform": "",
"unzip": "",
"upload": "",
"use image": "",
"username": "",
"width": "",
"you were logged out": "",
"zip": "",
"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 in the support forums. We will include improvements in official releases.