Auto Language

Documentation Status

Automatically set the user’s language based on their browser language.

Without further ado, let’s get started.

Get started

How it works

Every browser sends its preffered language in the HTTP Header. This addon compares it to all installed languages and sets the right one automatically.

Requirements

Beside the normal requirements for a XF 2.1+ installation, all installed languages need to have a language code.

Locale setting

In most cases you don’t need to do anything, good translations have this option set up.

Installation

Install the addon like every other addon by uploading it directly via SFTP or the control panel.

From control panel

Addons

For the control panel method you need php zip:

sudo apt-get install php-zip
sudo yum install php-zip

Installing from archives must be explicitly enabled by adding the following line to src/config.php:

$config['enableAddOnArchiveInstaller'] = true;

(S)FTP

Upload the contents of the “upload” folder to your root XenForo directory.

Configuration

The configuration is pretty straightforward. Out of the box, guests and registered users language gets changed automatically.

You can disable the Auto Language function for registered users by unticking the box.

Option1

Saving

The addon saves when a language has been automatically selected for the user. This allows the user to change his language manually without interferences.

Guests

If you tick this option, the automatically detected language is forced for guests at every page load.

Option2

Users

For all registered users the information is saved in the database. How long should it be stored?

Option2

Fallback language

XenForo will select the default language (defined in the settings) if no matching language has been found.

Languages

Example: If the users browser language is German, but only English (default) and Spanish are installed, English will be selected.

Support

Feathery Design

You can send us a message anytime:

hello@feathery.design