> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-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 konfiguriert wird.
{% endhint %}

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

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

***

#### Konfiguration für eine einzelne Sprache

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

Unterstützte Sprachcodes sind unter anderem:

* `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 %}

Dann wenden Sie 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.

#### Konfiguration für mehrere Sprachen

Um Benutzern zu ermöglichen, **die Sprache ohne Abmeldung zu wechseln**, muss Ihre Overleaf-Instanz so konfiguriert sein, dass sie je nach Domainnamen unterschiedliche Sprachen bereitstellt.

Dieser Abschnitt geht davon aus, dass:

* Ihre Hauptdomain ist `overleaftest.com`
* Sie haben ein **Wildcard-TLS-Zertifikat** (z. B. `*.overleaftest.com`)
* Sie **verwenden nicht `localhost`** (da es kein sprachbasiertes Routing über Subdomains unterstützen kann)

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, auf welche Sprachdomain der Benutzer zugegriffen hat.

Stellen Sie sicher, dass die folgende Direktive vorhanden ist:

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

Hier ist ein Beispiel für eine Nginx-Konfiguration:

<pre class="language-nginx"><code class="lang-nginx">server {
    listen 443 ssl;
    server_name    _; # Fängt alle ab, 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-Verschlüsselungen 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 dies in 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 %}

### Zuordnung von Sprache zu Domain

Definieren Sie als Nächstes, wie Sprachcodes mithilfe von\
`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` → Oberfläche auf Vereinfachtem Chinesisch

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

{% step %}

### Leiten Sie die Apex-Domain um

Leiten Sie abschließend die Apex-Domain (`overleaftest.com`) auf 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     /path/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 %}


---

# 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://ayakaleaf-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.
