Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Jinja i18n extension for translation #14

Open
haltode opened this issue Feb 9, 2022 · 0 comments
Open

Use the Jinja i18n extension for translation #14

haltode opened this issue Feb 9, 2022 · 0 comments

Comments

@haltode
Copy link
Owner

haltode commented Feb 9, 2022

Currently we have this sort of code for small translations:

{% if metadata['language'] == 'fr' %}
<p class="metadata">Publié : {{ metadata['published'] }} · Modifié : {{ metadata['modified'] }}</p>
{% else %}
<p class="metadata">Published: {{ metadata['published'] }} · Modified: {{ metadata['modified'] }}</p>
{% endif %}

This is totally reasonable for one or two translation block (as it is currently the case), but it might be a better idea to use Jinja i18n extension instead. Especially if in the future there are more translations to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant