Skip to content

Language#

All user interface text in XenForo can be translated into other languages without having to edit any HTML or templates at all.

This is achieved through a system of Phrases, which in turn belong to Languages. A single XenForo installation may have multiple languages available, and these can be selected by your visiting users.

Languages#

In XenForo, Languages function in a similar manner to Styles, in that they represent a collection of data that is grouped together for ease of management.

Pre-built languages#

While you can translate the entire XenForo system text yourself, you may find that the translation you want already exists.

Installing a new language is a simple task and can be managed by most administrators.

If you complete your own translation, you might want to use the Export tools available in the language manager, and add your translation to the collection of language translations already available in the XenForo Resource Manager for the benefit of other XenForo administrators.

Setting the default language#

When your site has multiple languages installed, you can specify which of the installed languages will be used for visitors who have not specified their own preference.

To do this, visit the Appearance section of the main XenForo options system, and select the language you want to act as the default using the Default language option.

By default, all installed languages are selectable by your visitors, but you may prevent selection of specific languages with a toggle on the Appearance > Languages list page.

Language inheritance#

Also like styles, languages in XenForo can be arranged into parent/child relationships, such that a child language may inherit all of the data from a parent language, and customize only those items that require change.

A simple example of this would be UK English, which can inherit most of the settings from US English, except for a few differences like color vs colour and 11/28/2017 vs 28/11/2017.

A full description of the way inheritance works can be found in the styles section of this manual.

Language settings#

When you click on a language in the language manager, you will be presented with the language editor, where you can define some basic rules for the language, like the locale, the text direction (left-to-right or right-to-left), the decimal point character, the week start day and the date format.

These settings have wide-ranging effects, so ensure that you set them carefully.

Phrases#

All the user interface text in XenForo is stored in predefined text snippets called Phrases.

When XenForo needs to place some text on a page, rather than calling the text directly, it calls for the appropriate phrase that contains the desired text.

For the most part, phrases are named according to their content, so a phrase whose content is Please click the 'Save' button would most likely be stored in a phrase called please_click_the_save_button.

Sometimes, when the text in a phrase is too long to be reasonably used as the phrase name, or if the phrase must serve a specific programmatic task, the phrase may have a name that describes its content, rather than directly reflecting its content. For example, the text that explains the use of the Background size parameter in the Smilie editor is named background_size_explain.

When a phrase needs to include an important variable, like the name of a piece of content it is describing, the variable will be represented in the phrase name with a letter, like x or y. For example, your_thread_x_has_been_updated.

Within the phrase, the variable is represented as a word in curly braces:

Your thread, {name} has been updated.

XenForo template syntax will take care of inserting the correct value into the {name} variable.

Phrase inheritance#

As properties of languages, phrases inherit their content from parent languages unless they have been customized in the current language.

Upgrading with customized phrases#

Unlike templates, phrases can only contain simple data, so it is highly unlikely that customizing or translating a phrase will result in broken functionality after a XenForo upgrade, provided that all {variable} variables that existed in the original version of the phrase remain in your customized or translated version.