Can't find how to localize a theme component

Hi there…

I 've tried to use the Discourse Search Banner and localize it, so that the text on the banner shows up differently on different languates.

I 've read this post about theme components now can include localizable strings, and in fact this component includes localizable strings, and you can actually modify the strings from the discourse admin panel UI.

but… the theme component only offers an en.yml file with only english localizations… How am I supposed to be able to set a different header text for the banner when the user selects Spanish language for example?

I 've tried going into the general discourse Text localization feature but the keys from the theme components were not there, and I didn’t find another place where I could override the theme components localized string keys with different values per locale

is this possible?

or would I need to fork the theme component and modify it to support other locales?

thank you!

1 Like

Hi, welcome!

You can either propose your translations on the GitHub repository or if you want to customize them directly in the admin panel; if I’m not wrong, I believe you have no choice but to change your language first, then the translations in the component settings. And you repeat for the wanted languages.

2 Likes

Yes, this is accurate. We haven’t added an interface for editing theme translations, so you have to change your language first from your account preferences (community.example.com/my/preferences/interface). Then if you visit admin/customize/themes you’ll be editing the text for the currently selected locale.

3 Likes

I got it! Makes sense…
Just didn’t imagined it was that way

Thank you all!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.