커스텀 헤더 링크를 위한 테마 번역 만들기

안녕하세요 친구, 이 컴포넌트에 대한 테마 번역을 만들어 보고 싶어요.
Add settings to your Discourse theme 의 여러 언어 지원 문서를 읽어 보았으며,

이 테마 GitHub - discourse/DiscoTOC: A Discourse theme component that generates a table of contents for topics with one click · GitHub 에 테마 번역 기능이 있다는 것을 알게 되었어요.

하지만 이 테마 컴포넌트에 대한 번역을 어떻게 시작해야 할지 모르겠어요.

가이드라인을 알려줄 수 있을까요?

I’m trying to change this use David Taylor’s topic

 I18n.t(themePrefix("my_translation_key"))

in Add localizable strings to themes and theme components

<script type="text/discourse-plugin" version="0.8.20">
  // Add an attribute to the <html> tag. This might help the user to style
  // his header links 
  $('html').attr('dhp-locale', I18n.locale)

  const customHeaderLinks = I18n.t(themePrefix("header_nav_link"));
  if (!customHeaderLinks.length) return;

  const h = require("virtual-dom").h;
  const headerLinks = [];

  const mobileView = api.container.lookup("site:main").mobileView;

and add a locales/en.yml

but get the [en.theme_translations.87.header_nav_link] resuilt


…so, i do someting wrong?

아니요, 잘못하고 있는 것이 아닙니다. 이 컴포넌트는 아직 테마 번역을 지원하지 않지만, 업데이트는 제 작업 목록에 올라가 있습니다.

각 링크의 텍스트를 번역해서 사용자가 설정한 언어 환경에 따라 표시되도록 하려는 건가요?

네, Johani, 이 컴포넌트를 메뉴로 사용하고 있어요.
말씀하신 대로 각 링크의 텍스트를 번역하고 싶은 거예요.
목록에 있는 거죠, 정말 기뻐요. 할 수 있겠어요. :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

하하, 아이디어가 하나 생겼어.
이 컴포넌트를 사용해 이중 언어 웹사이트를 만들 수 있을 것 같아.
중국어 카테고리 몇 개와 영어 카테고리 몇 개를 만들고,
이 컴포넌트를 메인 내비게이션으로 사용할 수 있어.
제목 링크는 번역 로케일 파일인 en.yml과 zh_CN.yml에 포함시키면 돼.

홈페이지와 카테고리 페이지는 번역된 테마 컴포넌트(정적 페이지일 경우에도)를 사용해 구현할 수 있어.

그리고 기본 카테고리 드롭다운을 숨기면 되고,
내 생각에는 우리 웹사이트에 두 가지 언어만 사용하는 것이 가장 좋겠어.

하하, 알겠어. 그냥 header.html의 내용을 head_tag.html로 옮기면 되는 거구나.

이 주제를 다시 한번 읽어보니까 알겠어.

https://meta.discourse.org/t/how-to-add-settings-to-your-discourse-theme/82557/14?u=aksoforever

johani와 그 joe라는 분께 감사해. :blush: :blush: :blush: :blush: