The discussion revolves around detecting the user’s chosen language in Discourse. gberaudo asks if a custom attribute can be added to the page to reflect the selected language, necessary for translating UI customizations. jomaxro references a prior discussion on variable default interface languages. simon mentions a plugin that handles language detection but needs updating for the new plugin API. gberaudo clarifies that the plugin doesn’t add a custom attribute, but simon confirms this is possible. gberaudo explains the need for language detection to localize a custom menu. simon suggests using I18n.locale on the client side, which gberaudo acknowledges as helpful. gberaudo later praises the plugin’s functionality and requests assistance in updating it for the new API, highlighting its usefulness for their setup.
It seems possible to add a custom menu through admin->Customize->css_html section.
This menu must be localized. If I can find out the chosen language from the page, I can chose the correct translation for the menu.
Hi @simon, indeed your plugin is great. I gave it a try on my dev instance (v1.5.0.beta8 +164) and it was fantastic!
I found out about the new plugin API.
Indeed, it woud be great to be able to use the plugin with newer Discourse versions. Your help/guidance will be appreciated.