Managing languages for your site

October 8, 2024

You enable and manage language settings for the current site in Administration>Sites>Languages. This defines the languages in which visitors access your site. You can add or remove languages from your site, define which ones are mandatory, and specify the default language.

The right of the page displays languages available on the site. The left part displays languages that you can activated on your site.

site-languages.png

The structure of your site is the same in all languages. Only internationalized fields use different content. Content created in one language must be translated to display in another language. When you delete content, you delete it in all languages.

Note: For developer content, see Specifying internationalization settings.

Adding languages

Notice that some languages are listed multiple times. The list is based on local languages (language of the region). The available languages are a combination of language and region. Jahia can identify these local languages from browser preferences and will react differently depending on the detected language (fr_CA or fr_FR for example). You might have two separate sites with different content for Canadian and French.

If you prefer to manage the French generically, choose the French language (fr). If you do not intend to handle content specific to a country or region (for example, en_US or fr_FR), you should always use the generic local language for the specified language.

Contact your system administrator if you do not find the desired language in this list, as new locals can be added.

To add languages:

  1. Select or more languages (Ctrl-click) in the Available languages list.
  2. Click add admin-languages-add-button.png to move them to the right.
    admin-languages-add.png
  3. Click Submit.

Specifying the default language

You can define only one language as the default language among all enabled languages. You specify the default language by selecting Default language beside the appropriate language.

The default language is the one where:

  • Editors can define and modify system names for content. To maintain URL consistency, system names are invariable and editable in only one language.
  • Jahia redirects visitors automatically if it doesn’t have the data necessary to serve pages in a specific language. For more information, see Replacing untranslated content with default content.
  • Jahia serves untranslated content if the substitution option has been activated on the current project. For more information, see Allowing unlisted languages.

Jahia uses the default language to serve content if it fails to find a language corresponding to the preferences expressed or implied by the user. Jahia seeks for this user preference through a series of tests against all user related datasets. The order of the tests is the:

  1. Language specified in the URL
  2. Language specified in the user profile (for registered users)
  3. Preferred language declared in the browser options
  4. Browser language

Specifying mandatory languages

Mandatory languages affect how editors can publish a node and how a node displays in live mode. You make a language mandatory by selecting the appropriate check box under Mandatory. Mandatory languages only apply to nodes with mandatory properties.

Only valid content can be published. If a mandatory property is missing, it is invalid and a Publish Error icon displays as the publication status.

publish-error.png

Also note that:

  • Content must have a value in each mandatory language for each of its mandatory properties to be valid in any language.
  • Once content is valid, each language has its own workflow so they can be really published at a different time.
  • If content is created and not translated into one mandatory language, the Publish Error displays as the publication status.

In live mode, content needs to be valid to be visible. It must have a value in each mandatory language for each of its mandatory properties to be available to users. For example, if your site has two mandatory languages (en and fr) each page that editors create must have a title in both languages to be publishable. To be visible in live mode, a page must have completed workflows for each language. If the English workflow for a page is completed on Monday and the French workflow is completed on Tuesday, the English page will only be visible in live mode on Tuesday.

Making content editable in a specific language

The Active (Edit) option specifies whether editors can change content in a specific language. If this option is unchecked, content in this language is safely stored, but editors can no longer access or edit content in the language.

When you clear the Active (Edit) checkbox, the Active (Live) checkbox also becomes cleared. The language is no longer available to editors in the languages drop-down in Page Composer and jContent.

It is appropriate to disable the Active (Edit) option for a language if you want to:

  • Stop translating new content in a given language on your site and you are happy with the existing language.
  • Completely disable a language without removing the language and its related translated content. 

At any time, you can reactivate a previously disabled language. Previously translated content will then reappear.

Making content live in a specific language

The Active (Live) option specifies whether a language is accessible by visitors who access the published version of your site. If this box is unchecked and even if translations exist in this language, users can not access them. When you add a language, the Active (Live) option is always unchecked. You must manually activate it at the appropriate time.

This option is especially useful for starting the translation of a site in a language that you recently added, when the site is already active in other languages. Publication in a non-active live language can still be performed. When the site is fully translated and published in this new language, activate the language in live to make it available to your visitors.

Replacing untranslated content with default content

For intranet or extranet requirements, you may need to display content regardless of the language of the user's browser. For example, if you do not want blank pages in some languages when the site has not been fully translated or made available in all languages, you can enable the option of mixed languages (for example, use several languages when browsing).

This option is not recommended on sites open to the public because the result can be confusing to site visitors. It can be acceptable on sites such as intranets where visitors are aware of this choice and are unlikely to be confused when content displays in two languages on the same page.

You enable this option by selecting Replace untranslated content with the default language content for a specific language.

admin-languages-default.png

When enabled, if content does not exist in the current language, Jahia displays content in the default language. For example, if English is the default language and some content is not translated into French, English content will display.

Allowing unlisted languages

By default, Jahia serves pages in the requested language through the URL and loads the resource bundle files (translations for the static elements declared in JSP pages) of the matching language. If a user calls a page in an undeclared language, Jahia returns a 404 error because the page does not exist in this language, for example: www.partners.com/sq/home/actualites2012.html (sq = Albanian).

With Allow to use unlisted languages enabled, Jahia ignores the language specification and serves the requested page in the default language of the site, loading resource bundles corresponding to the requested language if they exist.

admin-languages-unlisted.png

Important: This option should only be enabled if the Replacement of untranslated content with the default language content option is also enabled.

Removing a language

Removing a language in Jahia is a non-destructive action. Removing the language from the available languages in your site and does not erase any content from your repository (as your content could be reused anywhere in this language).

You cannot remove a language if:

  • The language is the default language
  • Active (Edit) is enabled for the language
  • Content exists for the language

If you add language back to the available list of languages, you will retrieve your site as it was before you removed the language.