1

Shopware only accept snippets files in .json format.

How to handle multiline text with different number of lines for different translations?

rammi22
  • 271
  • 1
  • 11

1 Answers1

3

If you want to have the different number of lines in each language(For example 10 lines in English and 2 in Spanish), you have to create only one snippet but with different text inside, using line break as @tinect wrote in this thread https://stackoverflow.com/a/75177091/21048350.

The English version will look like this: "text\ntext\n...\ntext" and Spanish: "text\ntext"

  • Ok, sorry, for a better understanding: Your answer offer a single line in **json** with linebreaks. My question apointed the **multiline** in the **json** file like an array for a better reading (80 chars in code line) – rammi22 Jan 20 '23 at 13:59
  • 1
    Okey so it isn't possible. Json [doesn't support](https://stackoverflow.com/questions/2392766/are-multi-line-strings-allowed-in-json/2392888#2392888) multilines strings. – Michał Jankowski Jan 20 '23 at 14:14