# Add localizable strings to themes and theme components

**URL:** https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867
**Category:** Developer Guides
**Tags:** how-to, theme-guides
**Created:** [2월 22, 2019, 10:21오후 UTC](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867 "2019-02-22T22:21:45Z")
**Posts on this page:** 3
**Page:** 2

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [7월 1, 2024, 1:33오후 UTC](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867/22 "2024-07-01T13:33:43Z")

</div>

네, 정확합니다. `.gjs` 파일에서는 특별한 `.hbs` 시스템이 아닌, 일반 `.js` 파일과 동일한 기법을 사용합니다 💯

OP를 이에 맞게 업데이트했습니다:

> [@Discourse](#):
>
> `.hbs` 파일에서는 전용 헬퍼를 사용할 수 있습니다.
> 
> ```js
> {{theme-i18n "my_translation_key"}}
> 
> ```
> 
> 또는 번역 키를 다른 컴포넌트로 전달해야 하는 경우, `theme-prefix` 헬퍼를 사용할 수 있습니다:
> 
> ```js
> <DButton @label={{theme-prefix "my_translation_key"}} />
> 
> ```
> 
> JavaScript 또는 `.gjs` 파일에서는 themePrefix 함수를 사용할 수 있습니다. 이 함수는 자동으로 주입되므로 가져오기(import)할 필요가 없습니다:
> 
> ```gjs
> const result = I18n.t(themePrefix("my_translation_key"))
> 
> <template>
> {{i18n (themePrefix "blah")}}
> </template>
> 
> ```

불분명한 부분이 있으면 @merefield에게 알려주세요.

---

<div class="post-metadata">

### Author: ![Jukebo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jukebo/32/423583_2.png) [@Jukebo](https://meta.discourse.org/u/Jukebo)
#### Post date: [8월 9, 2024, 6:28오전 UTC](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867/23 "2024-08-09T06:28:08Z")

</div>

기존 로케일을 오버라이드하는 것도 가능한가요, 아니면 새로운 로케일에서만 작동하나요?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [8월 9, 2024, 7:58오후 UTC](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867/24 "2024-08-09T19:58:55Z")

</div>

이 파일은 테마 전용 번역에만 사용됩니다.

다른 문자열의 번역을 재정의하려면 [Customize text in Discourse](https://meta.discourse.org/t/customize-text-in-discourse/36092) 를 참고하세요.

[이전 페이지](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867.md?page=1)
