> 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/ko/configuration/overleaf-toolkit/localization.md).

# 지역화

### Overleaf i18n 구성

{% hint style="info" %}
이 문서는 자체 호스팅된 **Overleaf** 인스턴스의 국제화(i18n)를 구성하는 방법을 설명합니다.
{% endhint %}

Overleaf는 여러 언어로 번역되어 있습니다. 적절한 구성을 사용하면 다음을 수행할 수 있습니다:

* Overleaf 인스턴스를 **하나의 고정된 언어로 실행하거나**, 또는
* 사용 **다중 언어를**하여 사용자가 `www.overleaf.com`.

***

#### 단일 언어 구성

사이트 언어는 환경 변수 `OVERLEAF_SITE_LANGUAGE`(또는 `SHARELATEX_SITE_LANGUAGE` 를 사용하여 구성합니다. Overleaf 버전 **4.x 및 이전 버전의 경우**).

지원되는 언어 코드는 다음과 같습니다:

* `en` - 영어(기본값)
* `es` - 스페인어
* `pt` - 포르투갈어
* `de` - 독일어
* `fr` - 프랑스어
* `cs` - 체코어
* `nl` - 네덜란드어
* `sv` - 스웨덴어
* `it` - 이탈리아어
* `tr` - 터키어
* `zh-CN` - 중국어(간체)
* `no` - 노르웨이어
* `da` - 덴마크어
* `ru` - 러시아어
* `ko` - 한국어
* `ja` - 일본어
* `pl` - 폴란드어
* `fi` - 핀란드어

영어가 기본 언어입니다. 인터페이스 언어를 변경하려면(예: 중국어 간체로), 다음 줄을 `config/variables.env`:

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

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

{% endcode %}

에 추가한 다음 구성을 적용하세요:

```bash
bin/up
```

서비스가 다시 시작되면 웹 UI 메뉴의 인터페이스 언어가 새 설정을 반영해야 합니다.

#### 다중 언어 구성

사용자가 **로그아웃하지 않고 언어를 전환할 수 있도록**, Overleaf 인스턴스는 도메인 이름에 따라 서로 다른 언어를 제공하도록 구성되어야 합니다.

이 섹션에서는 다음을 가정합니다:

* 주 도메인은 `overleaftest.com`
* 와일드카드 TLS 인증서가 **있으며** (예: `*.overleaftest.com`)
* 사용하지 **않습니다 `localhost`** (하위 도메인 기반 언어 라우팅을 지원할 수 없기 때문입니다)

로컬 테스트의 경우, 다음과 같은 도메인을 사용할 수 있습니다: `dev-overleaf.com`.

{% stepper %}
{% step %}

### TLS 프록시 구성(Nginx)

TLS 역방향 프록시는 원래의 `Host` 헤더를 전달해야 Overleaf가 사용자가 접근한 언어 도메인을 확인할 수 있습니다.

다음 지시문이 있는지 확인하세요:

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

다음은 Nginx 구성 예시입니다:

<pre class="language-nginx"><code class="lang-nginx">server {
    listen 443 ssl;
    server_name    _; # 모두 포착, 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;
    # 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;

    # HSTS(HTTP Strict Transport Security)를 활성화하는 구성 https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
    # 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; # 도커 컨테이너가 수신 중인 호스트/포트에 맞게 변경하세요.
        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;
        
        # nginx 설정에 이 내용을 추가하세요
<strong>        proxy_set_header Host $host;
</strong>    }
}
</code></pre>

{% endstep %}

{% step %}

### 쿠키 도메인 구성

언어를 전환할 때 사용자가 로그아웃되지 않도록 하려면, 언어 하위 도메인 간에 쿠키가 공유되어야 합니다.

다음 줄을 `config/variables.env`:

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

```env
# 앞의 점에 유의하세요
COOKIE_DOMAIN=.overleaftest.com
```

{% endcode %}

이를 통해 인증 쿠키가 다음 아래의 모든 하위 도메인에서 유효해집니다 `overleaftest.com`.
{% endstep %}

{% step %}

### 언어–도메인 매핑

다음으로, 언어 코드를 하위 도메인에 매핑하는 방법을\
`OVERLEAF_LANG_DOMAIN_MAPPING`.

#### 예시 구성

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

이 구성에서는:

* `https://www.overleaftest.com` → 영어 인터페이스
* `https://cn.overleaftest.com` → 중국어 간체 인터페이스

필요에 따라 이 매핑을 추가 언어 및 하위 도메인으로 확장할 수 있습니다.
{% endstep %}

{% step %}

### apex 도메인 리디렉션

마지막으로, apex 도메인(`overleaftest.com`)을 기본 언어 도메인(`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/ko/configuration/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.
