Translating template

Hi,

I have some difficulties with translating the months (januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december) and quarters (kw. 1|kw. 2|kw. 3|kw. 4) in the code below. I guess it has something to do with the split function?

{% t= "januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december" fr:"janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|decembre" %}
{% t= "kw. 1|kw. 2|kw. 3|kw. 4" fr:"trim. 1|trim. 2|trim. 3|trim. 4" %}
{% t= "Loonadministratie" fr:"Salaire administratif" %}
{% t= "Kwartalen|Maanden" fr:" Trimestres|Mois" %}
{% t= "Kwartalen" fr:"Trimestres" %}
{% t= "Belastbaar" fr:"Imposable" %}
{% t= "Bedrijfsvoorheffing" fr:"Précompte professionnel" %}
{% t= "Bijkomende aangifte" fr:"Déclaration supplémentaire" %}
{% t= "Kalenderjaar" fr:"Année calendrier" %}
{% t= "TOTAAL BOEKJAAR" fr:"TOTAL EXERCICE COMPTABLE" %}
{% t= "Boekhouding" fr:"Comptabilité" %}
{% t= "Onuitgelegd" fr:"Inexpliqué" %}
{% t= "Totaal" fr:"Total" %}
{% t= "Netto wedde" fr:"Rémunération nette" %}
{% t= "Sociaal statuut" fr:"Statut social" %}
{% t= "V.A.A." fr:"A.T.N. " %}

{% if custom.config.periods == 'Maanden' or custom.config.periods == 'Mois' %}{% assign periods = 'januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december' | split:'|' %}{% else %}{% assign periods = 'kw. 1|kw. 2|kw. 3|kw. 4' | split:'|' %}{% endif %}

{% assign year_first_year = period.year_start_date | date:'%Y'%}{% assign split_on_month = period.year_start_date | date:'%-m' %}{% assign split_on_index_first_year = split_on_month-1 | divided_by:12/periods.size %}
{% assign year_second_year = period.year_end_date | date:'%Y' %}{% assign split_on_month = period.year_end_date | date:'%-m' %}{% assign split_on_index_second_year = split_on_month | divided_by:12/periods.size %}

|---------|---|---:|---:+
| **{% if period.custom.bundel.gent == 'true' %}<font color="of75ae">{% else %}<font color="c4017b">{% endif %}1. {% t "Loonadministratie" %}</font>**
|
| **{% input custom.config.periods as:select options:'Kwartalen|Maanden' default:'Kwartalen'%}**| | **{% t "Belastbaar" %}** | **{% t "Bedrijfsvoorheffing" %}**| {% 
if year_first_year == year_second_year %}{% for month_or_quarter in periods %}
| {{ year_first_year }} {{ month_or_quarter }} | | {% $0+input custom.explanations_first_year[forloop.index].value as:currency %}|{% $10+input custom.explanations_first_year[forloop.index].voorheffing as:currency %}{% if forloop.last %}
| {% t "Bijkomende aangifte" %} {{ year_first_year }} | | {% $0+input custom.bijkomend_first_year.[forloop.index].value as:currency %}|{% $10+input custom.bijkomend_first_year.[forloop.index].voorheffing as:currency %}{% endif %}{% endfor %}
|      ||**{{$0 | currency}}**|**{{$10 | currency}}**{% 
else 
%}{% assign $1 = 0 %}{% assign $11 = 0 %}{% assign $2 = 0 %}{% for month_or_quarter in periods %}
| {{ year_first_year }} {{ month_or_quarter }} | | {% $2+input custom.explanations_first_year[forloop.index].value as:currency %}|{% $12+input custom.explanations_first_year[forloop.index].voorheffing as:currency %}{% if forloop.index == split_on_index_first_year or forloop.last %}
| {% t "Bijkomende aangifte" %} {{ year_first_year }} | | {% $2+input custom.bijkomend_first_year.[forloop.index].value as:currency %}|{% $12+input custom.bijkomend_first_year.[forloop.index].voorheffing as:currency %}    {% if forloop.last %}{% assign boekjaar_belastbaar = $2%}{% assign boekjaar_voorheffing = $12 %}{% endif %}
|                                    | | **{{ $2 | currency }}** | **{{ $12 | currency }}**{%$1+ $2%}{%$11+ $12%}{% assign $2 = 0 %}{% assign $12 = 0 %}{% endif %}{% endfor %}
|
| **{% t "Kalenderjaar" %} {{ year_first_year }}** || **{{ $1 | currency }}**| **{{ $11 | currency }}**
|{% assign $1 = 0 %}{% assign $11 = 0 %}{% assign $2 = 0 %}{% for month_or_quarter in periods limit:split_on_index_second_year %}
| {{ year_second_year }} {{ month_or_quarter }} | | {% $2+input custom.explanations_second_year[forloop.index].value as:currency %}|{% $12+input custom.explanations_second_year[forloop.index].voorheffing as:currency %}{% if forloop.index == split_on_index_second_year or forloop.last %}
| {% t "Bijkomende aangifte" %} {{ year_second_year }} | | {% $2+input custom.bijkomend_second_year.[forloop.index].value as:currency %}|{% $12+input custom.bijkomend_second_year.[forloop.index].voorheffing as:currency %}
|                                    | | **{{ $2 | currency }}** | **{{ $12 | currency }}**{%$1+ $2%}{%$11+ $12%}{% if forloop.index == split_on_index_second_year %}
|
| _**{% t "TOTAAL BOEKJAAR" %} {{ period.year_end_date | date:'%d/%m/%Y' }}**_ | | **_{%=$0+ boekjaar_belastbaar+$2 %}_**|**{%=$10+ boekjaar_voorheffing+$12 %}**
|{% endif %}{% assign $2 = 0 %}{% assign $12 = 0 %}{% endif %}{% endfor %}{% endif %}
| 
| **{% if period.custom.bundel.gent == 'true' %}<font color="of75ae">{% else %}<font color="c4017b">{% endif %}2. {% t "Boekhouding" %}</font>** {% input custom.account.numbers as:account_collection range:6,7 %}{% assign accounts = period.accounts | range: custom.account.numbers %}{%
for account in accounts %}
| {{ account.number }} {{ account.name }} | | {%=$20+ account.value %}{% endfor %}{% fori extra in custom.extra_explanations %}
| {% input extra.description %} || {%$20+input extra.value as:currency %}{% endfori %}
|     | |**{{ $20 | currency }}**{% ic %}
|
| *{% t "Onuitgelegd" %}* || *{%=unexplained $0-$20 | currency%}*{% endic %}
|

{% nic %}
{:/group}
{::group}
{% endnic %}

|---------------------|{% fori persoon in custom.personen %}------:|{% endfori %}------:+
| **{% if period.custom.bundel.gent == 'true' %}<font color="of75ae">{% else %}<font color="c4017b">{% endif %}3. Fiche 281.20</font>** |{% fori persoon in custom.personen %}**{% input persoon.naam %}**|{% endfori %}**{% t "Totaal" %}**
| {% t "Netto wedde" %}         |{% fori persoon in custom.personen %}{%$14+input persoon.netto_wedde as:currency%}|{% endfori %}{{ $14 | currency }}
| {% t "Bedrijfsvoorheffing" %} |{% fori persoon in custom.personen %}{%$15+input persoon.bedrijfsvoorheffing as:currency %}|{% endfori %}{{ $15 | currency }}
| {% t "Sociaal statuut" %}     |{% fori persoon in custom.personen %}{%$16+input persoon.sociaal_statuut as:currency %}|{% endfori %}{{ $16 | currency }}
| {% t "V.A.A." %}               |{% fori persoon in custom.personen %}{%$17+input persoon.vaa as:currency %}|{% endfori %}{{ $17 | currency }}
|                     |{% fori persoon in custom.personen %}**{{ persoon.netto_wedde+persoon.bedrijfsvoorheffing+persoon.sociaal_statuut+persoon.vaa | currency}}**|{% endfori %}**{{ $14+$15+$16+$17 | currency }}**```

Thanks in advance!

Hi @Ward,

In your current code the months/quarters are not being translated. In order to make sure the translation is done, you should amend your code as follows (also see following case for more information on how to translate templates for use in other language https://community.silverfin.com/t/case-how-to-translate-templates-for-use-in-other-language-fr-en/185):

{% t= “maanden” nl:“januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december” fr:“janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|decembre” %}
{% t= “kwartalen” nl:“kw. 1|kw. 2|kw. 3|kw. 4” fr:“trim. 1|trim. 2|trim. 3|trim. 4” %}
{% t= “Loonadministratie” fr:“Salaire administratif” %}
{% t= “Kwartalen|Maanden” fr:" Trimestres|Mois" %}
{% t= “Kwartalen” fr:“Trimestres” %}
{% t= “Belastbaar” fr:“Imposable” %}
{% t= “Bedrijfsvoorheffing” fr:“Précompte professionnel” %}
{% t= “Bijkomende aangifte” fr:“Déclaration supplémentaire” %}
{% t= “Kalenderjaar” fr:“Année calendrier” %}
{% t= “TOTAAL BOEKJAAR” fr:“TOTAL EXERCICE COMPTABLE” %}
{% t= “Boekhouding” fr:“Comptabilité” %}
{% t= “Onuitgelegd” fr:“Inexpliqué” %}
{% t= “Totaal” fr:“Total” %}
{% t= “Netto wedde” fr:“Rémunération nette” %}
{% t= “Sociaal statuut” fr:“Statut social” %}
{% t= “V.A.A.” fr:"A.T.N. " %}

{% capture maanden %}{% t “maanden” %}{% endcapture %}
{% capture kwartalen %}{% t “kwartalen” %}{% endcapture %}

{% assign value_periods = custom.config.periods | default:1 %}
{% if value_periods == 2 %}{% assign periods = maanden | split:’|’ %}{% else %}{% assign periods = kwartalen | split:’|’ %}{% endif %}

{% assign year_first_year = period.year_start_date | date:’%Y’%}{% assign split_on_month = period.year_start_date | date:’%-m’ %}{% assign split_on_index_first_year = split_on_month-1 | divided_by:12/periods.size %}
{% assign year_second_year = period.year_end_date | date:’%Y’ %}{% assign split_on_month = period.year_end_date | date:’%-m’ %}{% assign split_on_index_second_year = split_on_month | divided_by:12/periods.size %}

|---------|—|---:|—:+
| {% if period.custom.bundel.gent == ‘true’ %}{% else %}{% endif %}1. {% t “Loonadministratie” %}
|
| {% input custom.config.periods as:select options:‘Kwartalen|Maanden’ option_values:‘1|2’ default:‘2’%}| | {% t “Belastbaar” %} | {% t “Bedrijfsvoorheffing” %}|

Kindly note that we have also declared option_values for the select to make sure the value ‘Kwartalen/Trimestres’ is selected as default.

Hope this answers your question!

Kind regards,
Robin