Hi friend, I want to make a Theme Translations for this component
I have read the Multiple languages support in How to add settings to your Discourse theme
and i find this theme https://github.com/discourse/DiscoTOC have the theme translations functions.
but i don’t know how to start to make a translations for this theme component,
can you give me a guidelines
I’m trying to change this use David Taylor’s topic
in Adding 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
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?
No, you’re not doing anything wrong. This component does not support theme translations yet but updating it is on my list.
Are you trying to translate the text for each link so that it shows up based on the user’s language preference?
haha, I have an idea,
I can use this component to achieve a bilingual website,
I can creat some chinese categories and some english categories,
and ues this component as the main navigation,
the title link include in the translate locales file en.yml and zh_CN.yml
the homepage and categories page i can use a translated theme component( even it’s a static page, ) achieve.
and hide the default category-drop,
and in my think, it is good for me just use two language in our website.
haha, i get it, just move the header.html content to head_tag.html
get it from read again this topic
thanks johani and this joe guy.