> 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/id/konfigurasi/overleaf-toolkit/localization.md).

# Lokalisasi

### Konfigurasi i18 Overleaf

{% hint style="info" %}
Dokumen ini menjelaskan cara mengonfigurasi internasionalisasi (i18n) untuk instans yang di-host sendiri **Overleaf** instans.
{% endhint %}

Overleaf telah diterjemahkan ke dalam berbagai bahasa. Dengan konfigurasi yang tepat, Anda dapat:

* Menjalankan instans Overleaf Anda dalam **satu bahasa tetap**, atau
* Mengaktifkan **beberapa bahasa**, sehingga pengguna dapat mengganti bahasa secara dinamis, mirip dengan `www.overleaf.com`.

***

#### Konfigurasi Satu Bahasa

Bahasa situs dikonfigurasi menggunakan variabel lingkungan `OVERLEAF_SITE_LANGUAGE`(atau `SHARELATEX_SITE_LANGUAGE` untuk versi Overleaf **4.x dan sebelumnya**).

Kode bahasa yang didukung meliputi:

* `en` - Inggris (default)
* `es` - Spanyol
* `pt` - Portugis
* `de` - Jerman
* `fr` - Prancis
* `cs` - Ceko
* `nl` - Belanda
* `sv` - Swedia
* `it` - Italia
* `tr` - Turki
* `zh-CN` - Tionghoa (sederhana)
* `no` - Norwegia
* `da` - Denmark
* `ru` - Rusia
* `ko` - Korea
* `ja` - Jepang
* `pl` - Polandia
* `fi` - Finlandia

Bahasa Inggris adalah bahasa default. Untuk mengubah bahasa antarmuka (misalnya, ke Bahasa Tionghoa Sederhana), tambahkan baris berikut ke `config/variables.env`:

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

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

{% endcode %}

Lalu terapkan konfigurasi:

```bash
bin/up
```

Setelah layanan dimulai ulang, bahasa antarmuka di menu UI web seharusnya mencerminkan pengaturan baru.

#### Konfigurasi Banyak Bahasa

Agar pengguna dapat **beralih bahasa tanpa keluar**, instans Overleaf Anda harus dikonfigurasi untuk melayani bahasa yang berbeda berdasarkan nama domain.

Bagian ini mengasumsikan:

* Domain utama Anda adalah `overleaftest.com`
* Anda memiliki **sertifikat TLS wildcard** (mis. `*.overleaftest.com`)
* Anda **tidak menggunakan `localhost`** (karena tidak dapat mendukung perutean bahasa berbasis subdomain)

Untuk pengujian lokal, Anda dapat menggunakan domain seperti `dev-overleaf.com`.

{% stepper %}
{% step %}

### Konfigurasi Proxy TLS (Nginx)

Proxy balik TLS Anda harus meneruskan `Host` header asli agar Overleaf dapat menentukan domain bahasa mana yang diakses pengguna.

Pastikan direktif berikut ada:&#x20;

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

Berikut contoh konfigurasi Nginx:&#x20;

<pre class="language-nginx"><code class="lang-nginx">server {
    listen 443 ssl;
    server_name    _; # Menangkap semua, lihat 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;
    # menggunakan cipher Cloudflare 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;

    # konfigurasi untuk mengaktifkan HSTS (HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
    # untuk menghindari ssl stripping 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; # ubah ke host/port apa pun tempat kontainer docker mendengarkan.
        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;
        
        # tambahkan ini ke conf nginx Anda
<strong>        proxy_set_header Host $host;
</strong>    }
}
</code></pre>

{% endstep %}

{% step %}

### Konfigurasikan Domain Cookie

Untuk mencegah pengguna keluar saat mengganti bahasa, cookie harus dibagikan di seluruh subdomain bahasa.

Tambahkan baris berikut ke `config/variables.env`:

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

```env
# Perhatikan titik di awal
COOKIE_DOMAIN=.overleaftest.com
```

{% endcode %}

Ini memastikan bahwa cookie autentikasi valid untuk semua subdomain di bawah `overleaftest.com`.
{% endstep %}

{% step %}

### Pemetaan Bahasa–Domain

Selanjutnya, definisikan bagaimana kode bahasa dipetakan ke subdomain menggunakan\
`OVERLEAF_LANG_DOMAIN_MAPPING`.

#### Contoh Konfigurasi

{% 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 %}

Dengan konfigurasi ini:

* `https://www.overleaftest.com` → Antarmuka bahasa Inggris
* `https://cn.overleaftest.com` → Antarmuka Bahasa Tionghoa Sederhana

Anda dapat memperluas pemetaan ini dengan bahasa dan subdomain tambahan sesuai kebutuhan.
{% endstep %}

{% step %}

### Arahkan Ulang Domain Apex

Terakhir, arahkan ulang domain apex (`overleaftest.com`) ke domain bahasa default (`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/id/konfigurasi/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.
