---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.4
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/hi/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/ko/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/ru/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/tr/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/vi/sdk/cocos/localization.md
  - https://yandex.com/dev/games/doc/zh/sdk/cocos/localization.md
  - href: ko/sdk/cocos/localization.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/ko/llms.txt

# 현지화

## 현지화 편집기

번역은 프로젝트 내 JSON 형식으로 저장되며, 이를 편집하는 데 사용하는 것을 강력히 권장합니다.

플러그인을 설치한 후, Yandex Games의 SDK 섹션에서 **Localization Editor** 옵션을 클릭하세요.

처음에는 편집기가 꽤 비어 보일 것입니다. 이는 상단 왼쪽 모서리에 있는 **Create** 버튼을 눌러 첫 번째 현지화를 생성해야 하기 때문입니다.

![](../../_images/cocos/loc-1.png)

언어를 선택할 수 있는 모달 창이 나타납니다. 완성되면 **Create JSON file**을 클릭하세요.

![](../../_images/cocos/loc-2.png)

예를 들어, _English (en)_ 를 선택하고 편집기에 다음 내용을 입력해 봅시다.

```json
{
  "title": "best game in the world 2"
}
```

**Save** 버튼을 눌러 로컬리제이션을 저장하고 게임에서 테스트하세요.

![](../../_images/cocos/loc-3.png)

### 로컬리제이션 적용하기

로컬리제이션은 두 가지 방법으로 적용할 수 있습니다: `l10n.t()` 메서드를 사용하거나 스마트 로컬리제이션 컴포넌트를 통해서.

#### l10n.t 메서드

우선 `l10n.t()` 메서드를 사용하는 방법을 살펴보겠습니다. 새 컴포넌트를 생성하고 다음 내용을 삽입하세요:

```tsx
import { _decorator, Component, Label } from "cc";
import { l10n } from "db://yandex-games-sdk/ysdk";
const { ccclass, requireComponent } = _decorator;

@ccclass("ButtonLocalizationTest") // 컴포넌트 이름.
@requireComponent(Label) // Label 컴포넌트에 대한 의존성.
export class ButtonLocalizationTest extends Component {
  onLoad() {
    const label = this.getComponent(Label); // Label 컴포넌트를 가져옵니다.
    label.string = l10n.t("title"); // 이전에 설정한 키를 기반으로 Label의 텍스트를 설정합니다.
  }
}
```

장면에 Label 컴포넌트가 있는 노드를 만든 후, 노드에 컴포넌트를 드래그하여 로컬라이즈할 수 있습니다.

![](../../_images/cocos/cocos-creator-2.gif)

#### 준비된 L10nLabel 컴포넌트

바퀴를 다시 발명하고 싶지 않다면, 플러그인에는 편집기에서 키를 직접 표시하는 준비된 컴포넌트가 있습니다. 번역 편집기에서 변경 사항이 있을 때 자동으로 업데이트되므로, 변경 사항을 보기 위해 프로젝트를 컴파일할 필요가 없습니다.

관심 있는 노드에 **Add Component** 버튼을 클릭하고, **YandexGamesSDK** 그룹으로 스크롤한 후 **L10nLabel**을 선택하십시오.

![](../../_images/cocos/loc-3.gif)

이제 **Key** 필드에 키를 입력하고 결과를 즐길 수 있습니다. 로컬라이제이션을 어떻게 변경하더라도, 변경 사항은 여기에서 즉시 볼 수 있습니다.

![](../../_images/cocos/cocos-creator-1.gif)


---


<!-- source: ko/_includes/button-git-cocos.md -->
<a href="https://github.com/yandex-games-plugins/cocos">
  <span class="button">저장소</span>
</a>
<!-- endsource: ko/_includes/button-git-cocos.md -->
