Translations

Contributing to translations Hyperlink to this header

You can join the BookWyrm translation project at translate.joinbookwyrm.com.

Making templates translatable Hyperlink to this header

Bookwyrm takes advantage of Django's translation functionality to enable page content to change depending on the user's chosen display language. The Django documentation provides a helpful explanation of how this works, but here is the short version:

  • all template text should include translation template tags
  • add {% load i18n %} at the top of your template to enable translations
  • If the text block is literal text, you can use the template tag {% trans %}
  • If the text block includes variables, you should use the template tag pair {% blocktrans %} and {% endblocktrans %}

Examples Hyperlink to this header

<p>{% trans "This list is currently empty" %}</p>

<p>
    {% blocktrans with username=item.user.display_name user_path=item.user.local_path %}
    Added by <a href="{{ user_path }}">{{ username }}</a>
    {% endblocktrans %}
</p>