Skip to content
romsson edited this page Nov 3, 2014 · 3 revisions

Translations

Languages appear in different locations in the code repository.

HTML Template

In the HTML code (e.g. /srv/atlas/html/) using Django Localization

For example, to translate "Trade Flow", here is what to insert in the html document:

{% trans "Trade Flow" %}

And it uses the dictionary files, e.g. /srv/atlas/django_files/locale/fr/LC_MESSAGES for French

msgid "Trade Flow" msgstr "Flux du commerce"

Once one of those files has been changed, then it requires re-compilation:

/srv/atlas/django_files/manage.py compilemessages

..and to restart django to see the result.

In the Database

The observatory_country database contains country names.

The name_en is the column of reference to translate in other languages. This column is usually a shorter version than the name.

In the Server Files

E.g. the files that generate the titles /srv/atlas/django_files/observatory/views.py

In the JavaScript

Textual elements that require a translation also appear in the JavaScript code e.g. /srv/atlas/media/js/libs

In the Search Feature

An elastic search script creates the index, it should be updated with the title names.

Next Steps

Next step is to find a mechanism to systematically translate the atlas

  • Check quality of current translation
  • Complete missing translations and/or fill with english words by default (instead of ???)
  • Understand the grammatical structure of every language to
  • Anticipate further updates with an automated workflow
  • Make sure the translation matches the role of words in the interface: glossary in a different ways than menus and country/products
Clone this wiki locally