<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
하하, 아이디어가 하나 생겼어.
이 컴포넌트를 사용해 이중 언어 웹사이트를 만들 수 있을 것 같아.
중국어 카테고리 몇 개와 영어 카테고리 몇 개를 만들고,
이 컴포넌트를 메인 내비게이션으로 사용할 수 있어.
제목 링크는 번역 로케일 파일인 en.yml과 zh_CN.yml에 포함시키면 돼.
홈페이지와 카테고리 페이지는 번역된 테마 컴포넌트(정적 페이지일 경우에도)를 사용해 구현할 수 있어.
그리고 기본 카테고리 드롭다운을 숨기면 되고,
내 생각에는 우리 웹사이트에 두 가지 언어만 사용하는 것이 가장 좋겠어.