Skip to main content

Overleaf i18 Configuration

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. 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:
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

Configure Cookie Domain

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:
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

config/variables.env
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.
We recommend serving the main site on www and always including a www key: set OVERLEAF_SITE_URL to the www address (for example https://www.overleaftest.com), point the www key at it, and redirect the apex domain to it as shown below. The www key is the main site and can use any language. Without it, the default www entry stays, and the language picker shows an extra English item that links to http://127.0.0.1:3000.
4

Redirect the Apex Domain

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

Q&A

Answer: The language button (translate icon) is in the page footer, for example at the bottom of the project list. It is not shown in the editor.The button appears only when OVERLEAF_LANG_DOMAIN_MAPPING maps two or more languages, as described in Multiple Language Configuration. With only OVERLEAF_SITE_LANGUAGE set, the whole site uses that one language and there is no button.Choosing a language opens the same page on that language’s domain, for example cn.overleaftest.com. It is not saved as a user setting.
Answer: OVERLEAF_LANG_DOMAIN_MAPPING has no www key. The mapping is merged into the default one, which has a www entry for English with the internal address http://127.0.0.1:3000. If your mapping uses other keys only, such as cn and en, that default entry is kept and shows up in the picker.Add a www key with the address of OVERLEAF_SITE_URL, and drop a second entry for the same language, then run bin/up -d:
Last modified on October 29, 2026