The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Tip: How to add new strings when using translations

fileeefileee Member
The documentation explains how to translate existing strings, however, if you want to introduce new elements with new strings, then you need to not only add this to your translated json, but also add this to the english language object. How to do this? Do this:

Just add the following code BEFORE your custom language inclusion snippet (which you include on cart, checkout, receipt... etc. - see documentation)

{% set config = config|merge({'lang': config.lang|merge(
'my_new_custom_string': 'This is the english translation',
'my_new_custom_string2': 'This is another english translation',
})}) %}

{% set custom_lang = {
"DE": {
'my_new_custom_string': 'This is the german translation',
'my_new_custom_string2': 'This is another german translation',
} %}

Sign In or Register to comment.