Two language version in templates

Hello together,
is it possible to arrange it via an if statement to look up which language is used and then choose which language is used.
Because when I use an if statement where i have in one part the german e-mail and in one part the english e-mail I get the Error block ‘subject_message’ defined twice even if i don´t use one of those blocks.
Is it even possible in Indico?

Greetings

You mean when using custom template overrides? If yes, you could use session.lang to check it.

And about the error: Put the if inside the block instead of trying to define the block twice.

1 Like

Thanks for the help. It works in everything but not in subject because if I build up the if statement there, I get the “Email subject contains linebreaks” Error. Is it possible to repair that error?

You can use Jinja’s whitespace-collapsing option. For example. {%- else -%} instead of {% else %} - this will remove whitespace on both sides of the tag. Use this everywhere to make sure no whitespace/linebreaks get added.

1 Like