Project

General

Profile

Actions

Feature #1924

closed

Unify translations, add missing table translations

Added by Alexander Watzinger over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:
Start date:
2023-01-08
Estimated time:

Description

Update: Translations are unified and table translation added, see Translations for details.

Enric, who kindly made Spanish and Catalan translations, noticed that translations for table labels are missing.
I already created the translations string in the develop branch and they were added to the translation files:
_('previous')
_('next')
_('show')
_('entries')
_('showing %(first)s to %(last)s of %(all)s entries', first=1, last=25, all=38)

It still has to be implemented so that they show up in the UI. At the moment we are using multiple translation system and it can get confusing:
  • .po files in openatlas/translations
    • used in the Python and HTML files with the _('string_to_translate') notation
    • used for the map and transformed to JavaScript variables in openatlas/templates/map.html
    • used for general UI translations and transformed to JavaScript variables at top of openatlas/templates/layout.html
  • JavaScript form error translations in openatlas/static/js/messages_de.js
    • I noticed it was broken, is fixed in develop and online on demo-dev. I also wrote a test for it to prevent this in the future.
    • It's the only one (I think) that is translated outside of the .po files, we may want to change that
    • Currently only German translations are available but I want to wait to ask e.g. Enric for translations until we decided, if/how we restructure it.

I hope I didn't missed anything.

Assigning this to our fronted expert Andi. It would be great if we could unify this while adding support for table labels translations . e.g.
  • All translations in .po files
  • Transformation to JavaScript at one place

Please let me know if/how we could solve this so that we can discuss it later.


Related issues 1 (0 open1 closed)

Related to OpenAtlas - Bug #1922: Missing user interface translationsClosedAlexander Watzinger2023-01-08Actions
Actions #1

Updated by Alexander Watzinger over 1 year ago

  • Related to Bug #1922: Missing user interface translations added
Actions #2

Updated by Enric Rodellas over 1 year ago

Alex,
If javascript translation must be done in files
  • openatlas/static/js/messages_de.js
  • openatlas/static/js/messages_es.js
  • openatlas/static/js/messages_ca.js
    go ahead and I would do translation for Spanish and Catalan

I will propose an example and do a pull request.

Actions #3

Updated by Alexander Watzinger over 1 year ago

Thank you Enric for the pull request, the merge went fine and changes are already in the develop branch.
The changes can be seen on the demo-dev version too, e.g. when inserting a person: https://demo-dev.openatlas.eu/insert/person and submitting the form without providing a name.
We will most likely rewrite the application so that all translation can be done in the .po files. But the provided files will work in the current system and when we do the rewriting, we already have the translations available.

Actions #4

Updated by Alexander Watzinger over 1 year ago

  • Subject changed from Unifying translations and missing table translations to Unify translations and missing table translations
Actions #5

Updated by Andreas Olschnögger over 1 year ago

  • Status changed from Acknowledged to In Progress
  • Assignee changed from Andreas Olschnögger to Alexander Watzinger

There is now only one file which contains the transformation to javascript (openatlas/templates/util/translations.html). This file is included in the openatlas/templates/layout.html.
It also contains the translations for the form validation, which need to be added to the .po files.
The openatlas/static/js/messages_[language].js files can then be deleted.

Changes are in the branch feature_unify_tanslation.
I assign this issue to Alex to add the missing validation translation to the .po files.

Actions #6

Updated by Andreas Olschnögger over 1 year ago

  • Status changed from In Progress to Closed
  • Assignee changed from Alexander Watzinger to Andreas Olschnögger

As discussed we will keep the translation files of jquery validation seperated from the .po files.
Changes are already in develop.

Actions #7

Updated by Alexander Watzinger over 1 year ago

  • Status changed from Closed to In Progress

Reopening this issue because I still miss the translations for table navigation, see top of description.
Not sure if this was the right approach but they are already included in the translation files e.g. German "weiter" for "next", but don't show up in the table navigation.

Actions #8

Updated by Andreas Olschnögger about 1 year ago

  • Status changed from In Progress to Closed

The translation files for the datatable and for the jquery validation plugin are now in openatlas/static/vendor/datatables_net and openatlas/static/vendor/jquery_validation_plugin. These folders contain readme files where a link is provided to download additional language files.

Actions #9

Updated by Alexander Watzinger about 1 year ago

  • Subject changed from Unify translations and missing table translations to Unify translations, add missing table translations
  • Description updated (diff)
Actions

Also available in: Atom PDF