I'm working on a site where i in twig renders content that gets set via ACF-fields. Currently i'm implementing translations and was wondering how i would do it since it not really strings, its twig.
Php file:
$context = Timber::get_context();
$context['header'] = array(
'title' => get_field('header_title')
);
Timber::render('/templates/index.twig', $context);
My template looks like this.
<header>
{% if header.title %}
<h1>
{{ header.title }}
</h1>
{% endif %}
</header>
But for the translation tool (po files) want the syntax to be:
{{ __("string to translate") }}
So how can i instead pass in {{ header.title }}
into that?