Meh components are displayed in English by default. Using the language
prop an existing different translation can be loaded. When no such translation exists, or you want to overwrite some of the labels, you can use the custom-translations
prop.
Meh comes with translations for several languages out of the box. You can activate these by setting the language
attribute:
<!-- Use German translations -->
<meh-comments
backend="https://comments.example.com"
language="de">
</meh-comments>
Currently supported languages include:
en
) - defaultde
)You can override specific translation strings by providing a JSON object through the custom-translations
attribute:
<meh-form
backend="https://comments.example.com"
custom-translations='{"formTitle": "Join the discussion", "submitButton": "Post Comment"}'>
</meh-form>
You only need to include the strings you want to override - any strings not specified will use the default translations for the selected language.
You can use both the language
and custom-translations
attributes together. In this case, Meh will:
<meh-comments
backend="https://comments.example.com"
language="de"
custom-translations='{"noComments": "Sei der Erste, der etwas sagt!"}'>
</meh-comments>
You can find the complete list of translation strings in several ways:
Properties
table lists all available translation string keys in the type
column.