globe-pointerLocalization

Overleaf i18 Configuration

circle-info

This document describes how to configure internationalization (i18n) for a self-hosted Overleaf instance.

Overleaf has been translated into multiple languages. With the appropriate configuration, you can:

  • Run your Overleaf instance in a single fixed language, or

  • Enable multiple languages, allowing users to switch languages dynamically, similar to www.overleaf.com.


Single Language Configuration

The site language is configured using the environment variable OVERLEAF_SITE_LANGUAGE(or SHARELATEX_SITE_LANGUAGE for Overleaf versions 4.x and earlier).

Supported language codes include:

  • en - English (default)

  • es - Spanish

  • pt - Portuguese

  • de - German

  • fr - French

  • cs - Czech

  • nl - Dutch

  • sv - Swedish

  • it - Italian

  • tr - Turkish

  • zh-CN - Chinese (simplified)

  • no - Norwegian

  • da - Danish

  • ru - Russian

  • ko - Korean

  • ja - Japanese

  • pl - Polish

  • fi - Finnish

English is the default language. To change the interface language (for example, to Simplified Chinese), add the following line to config/variables.env:

Then apply the configuration:

After the services restart, the interface language in the web UI menus should reflect the new setting.

Multiple Language Configuration

To allow users to switch languages without logging out, your Overleaf instance must be configured to serve different languages based on domain names.

This section assumes:

  • Your primary domain is overleaftest.com

  • You have a wildcard TLS certificate (e.g. *.overleaftest.com)

  • You are not using localhost (since it cannot support subdomain-based language routing)

For local testing, you may use a domain such as dev-overleaf.com.

1

TLS Proxy Configuration (Nginx)

Your TLS reverse proxy must forward the original Host header so that Overleaf can determine which language domain the user accessed.

Make sure the following directive is present:

Here is an example Nginx configuration:

2

To prevent users from being logged out when switching languages, cookies must be shared across language subdomains.

Add the following line to config/variables.env:

This ensures that authentication cookies are valid for all subdomains under overleaftest.com.

3

Language–Domain Mapping

Next, define how language codes map to subdomains using OVERLEAF_LANG_DOMAIN_MAPPING.

Example Configuration

With this configuration:

  • https://www.overleaftest.com → English interface

  • https://cn.overleaftest.com → Simplified Chinese interface

You can extend this mapping with additional languages and subdomains as needed.

4

Redirect the Apex Domain

Finally, redirect the apex domain (overleaftest.com) to the default language domain (www.overleaftest.com).

Last updated

Was this helpful?