> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/on-premises/de/konfiguration/overleaf-toolkit/localization.md).

# Lokalisierung

### Overleaf-i18n-Konfiguration

{% hint style="info" %}
Dieses Dokument beschreibt, wie die Internationalisierung (i18n) für eine selbst gehostete **Overleaf** Instanz.
{% endhint %}

Overleaf wurde in mehrere Sprachen übersetzt. Mit der entsprechenden Konfiguration können Sie:

* Betreiben Sie Ihre Overleaf-Instanz in **einer einzelnen festen Sprache**, oder
* Aktivieren Sie **mehrere Sprachen**, sodass Benutzer die Sprache dynamisch wechseln können, ähnlich wie bei `www.overleaf.com`.

***

#### Einsprachige Konfiguration

Die Seitensprache wird über die Umgebungsvariable konfiguriert `OVERLEAF_SITE_LANGUAGE`(oder `SHARELATEX_SITE_LANGUAGE` für Overleaf-Versionen **4.x und früher**).

Unterstützte Sprachcodes sind:

* `en` - Englisch (Standard)
* `es` - Spanisch
* `pt` - Portugiesisch
* `de` - Deutsch
* `fr` - Französisch
* `cs` - Tschechisch
* `nl` - Niederländisch
* `sv` - Schwedisch
* `it` - Italienisch
* `tr` - Türkisch
* `zh-CN` - Chinesisch (vereinfacht)
* `no` - Norwegisch
* `da` - Dänisch
* `ru` - Russisch
* `ko` - Koreanisch
* `ja` - Japanisch
* `pl` - Polnisch
* `fi` - Finnisch

Englisch ist die Standardsprache. Um die Oberflächensprache zu ändern (zum Beispiel auf vereinfachtes Chinesisch), fügen Sie die folgende Zeile zu `config/variables.env`:

{% code title="config/variables.env" %}

```bash
OVERLEAF_SITE_LANGUAGE=zh-CN
```

{% endcode %}

Wenden Sie dann die Konfiguration an:

```bash
bin/up
```

Nach dem Neustart der Dienste sollte die Oberflächensprache in den Menüs der Weboberfläche die neue Einstellung widerspiegeln.

#### Mehrsprachige Konfiguration

Damit Benutzer **die Sprache wechseln können, ohne sich abzumelden**, muss Ihre Overleaf-Instanz so konfiguriert sein, dass sie je nach Domainnamen unterschiedliche Sprachen bereitstellt.

Dieser Abschnitt setzt voraus:

* Ihre primäre Domain ist `overleaftest.com`
* Sie verfügen über ein **Wildcard-TLS-Zertifikat** (z. B. `*.overleaftest.com`)
* Sie verwenden **nicht `localhost`** (da es kein auf Subdomains basierendes Sprach-Routing unterstützt)

Für lokale Tests können Sie eine Domain wie `dev-overleaf.com`.

{% stepper %}
{% step %}

### TLS-Proxy-Konfiguration (Nginx)

Ihr TLS-Reverse-Proxy muss den ursprünglichen `Host` Header weiterleiten, damit Overleaf erkennen kann, über welche Sprachdomain der Nutzer zugegriffen hat.

Stellen Sie sicher, dass die folgende Direktive vorhanden ist:&#x20;

```nginx
proxy_set_header Host $host;
```

Hier ist ein Beispiel für eine Nginx-Konfiguration:&#x20;

<pre class="language-nginx"><code class="lang-nginx">server {
    listen 443 ssl;
    server_name    _; # Alles abfangen, siehe http://nginx.org/en/docs/http/server_names.html
    server_name *.overleaftest.com;
    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
    ssl_protocols               TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers   on;
    # verwendete Cloudflare-Cipher-Suiten https://github.com/cloudflare/sslconfig/blob/master/conf
    ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;

    # Konfiguration zum Aktivieren von HSTS (HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
    # um SSL-Stripping zu vermeiden https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping	
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
    server_tokens off;
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    client_max_body_size 50M;

    location / {
        proxy_pass http://localhost:5000; # ändern Sie es auf den Host/Port, auf dem der Docker-Container lauscht.
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 3m;
        proxy_send_timeout 3m;
        
        # Fügen Sie dies zu Ihrer Nginx-Konfiguration hinzu
<strong>        proxy_set_header Host $host;
</strong>    }
}
</code></pre>

{% endstep %}

{% step %}

### Cookie-Domain konfigurieren

Um zu verhindern, dass Benutzer beim Wechseln der Sprache abgemeldet werden, müssen Cookies über Sprach-Subdomains hinweg gemeinsam genutzt werden.

Fügen Sie die folgende Zeile zu `config/variables.env`:

{% code title="config/variables.env" %}

```env
# Beachten Sie den führenden Punkt
COOKIE_DOMAIN=.overleaftest.com
```

{% endcode %}

Dies stellt sicher, dass Authentifizierungs-Cookies für alle Subdomains unter `overleaftest.com`.
{% endstep %}

{% step %}

### Sprach-Domain-Zuordnung

Definieren Sie als Nächstes, wie Sprachcodes auf Subdomains abgebildet werden mit\
`OVERLEAF_LANG_DOMAIN_MAPPING`.

#### Beispielkonfiguration

{% code title="config/variables.env" overflow="wrap" %}

```dotenv
OVERLEAF_LANG_DOMAIN_MAPPING='{"www": {"lngCode": "en","url": "https://www.overleaftest.com"},"cn": {"lngCode": "zh-CN","url": "https://cn.overleaftest.com"}}'
```

{% endcode %}

Mit dieser Konfiguration:

* `https://www.overleaftest.com` → englische Oberfläche
* `https://cn.overleaftest.com` → vereinfachte chinesische Oberfläche

Sie können diese Zuordnung bei Bedarf um weitere Sprachen und Subdomains erweitern.
{% endstep %}

{% step %}

### Apex-Domain weiterleiten

Leiten Sie abschließend die Apex-Domain (`overleaftest.com`) an die Standardsprachdomain (`www.overleaftest.com`).

<pre class="language-nginx"><code class="lang-nginx">server{
    listen 80;
    server_name overleaftest.com;
<strong>    return 301 https://www.overleaftest.com$request_uri;
</strong>}

server {
    listen 443 ssl http2;
    server_name overleaftest.com;
    ssl_certificate     /<a data-footnote-ref href="#user-content-fn-1">p</a>ath/to/fullchain.cer;
    ssl_certificate_key /path/to/overleaftest.com.key;
<strong>    return 301 https://www.overleaftest.com$request_uri;
</strong>}
</code></pre>

{% endstep %}
{% endstepper %}

[^1]:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/on-premises/de/konfiguration/overleaf-toolkit/localization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
