I suspect an info field can’t be broken in 2 lines as usual for translation:
This doesn’t work:
fields:
info:
label: Info
type: info
text: >
en: Hello friend
es: Hola amigo
How to do that?
I suspect an info field can’t be broken in 2 lines as usual for translation:
This doesn’t work:
fields:
info:
label: Info
type: info
text: >
en: Hello friend
es: Hola amigo
How to do that?
Hm, it should actually work and does in my test install. Have you changed the user language in user settings? These language settings only work for the user language, not by changing the language in the select in the upper right corner.
Let’s not change language settings yet.
Let’s just add the afore mentioned snippet.
After I add the snippet to the blueprint, I get the 2 values returned as a whole string in the panel.
Something like:
Info
en: Hello friend es: Hola amigo
Other fields render without problems.
Does
fields:
info:
label: Info
type: info
text:
en: >
Hello friend
es: >
Hola amigo
work?
Holy cow! It works!
I knew it had to be a silly error
I didn’t know where to put the angle bracket (I tried other positions).
Thank you both!
I think adding an example snippet to docs wouldn’t be hurt, right?
For other folks reading:
How to translate info field (for which there is no example in docs):
fields:
info:
label: Info
type: info
text:
en: >
Hello friend
es: >
Hola amigo
How to translate select field (for which there is no example in docs either):
fields:
fruits:
label: Fruits
type: select
options
a:
en: Orange
es: Naranja
b:
en: Apple
es: Manzana
ist for completeness: The >
goes alway behind the deepest level of fields, which is in this case the language code. Otherwise all deeper levels are treated as text. If the info text is single lined you can simply use
fields:
info:
label: Info
type: info
text:
en: Hello friend
es: Hola amigo
The >
can be used id the content is longer than one line in the .yml
file but the line breaks should be ignored. Another way is to use |
instead where line breaks in the .yml
are preserved. That means
en: This is some very long content. This is some very long content. This is some very long content. This is some very long content. This is some very long content.
is equivalent to
en: >
This is some very long content. This is some very long content.
This is some very long content. This is some very long content.
This is some very long content.
but
en: |
This is some very long content. This is some very long content.
This is some very long content. This is some very long content.
This is some very long content.
is output as
This is some very long content. This is some very long content.<br>
This is some very long content. This is some very long content.<br>
This is some very long content.
This applies for all YML structured files like blueprints but content files too.
That’s Awesome