Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning
titleWARNING - Still under review

The proposed approach is still under review - there are still considerable technical hurdles to overcome in this area of work.

Introduction

Prior to DSpace 7, the DSpace XML and JSP User interfaces had different catalogs of interface messages. Unified on a single user interface, the DSpace community is transitioning to a widely adopted web standard for the translation of interface messages.

...

The DSpace community is actively seeking contributors to aid in the translation of DSpace interface messages, to ensure that DSpace 7 can benefit from the most extensive localization support in the history of the project.

Getting started

Contributing to translations requires a Github and a DuraSpace wiki account. Head over to www.github.com to create a free Github account.

...

Explore tools that can help you with the management of .pot and .po files. https://poedit.net/ is one widely used desktop application.

2019-07-25 State of development

The key challenges that are still being tackled are:

2019-05-20 State of development

As part of preview release 1, the developers are still using en.json catalogs. Once Pull Request 366 is accepted, the migration to the new .POT and .PO standard files will be official.

...

Together, we aim to release as many, as complete translations as possible, as part of the official DSpace 7.0 release.

Volunteer!

Please list your name, email address alongside any of the languages to which you wish to contribute. Also feel free to join the channel #translation on the DuraSpace Slack for assistance and discussion around DSpace 7 translations. 

Dutch (nl.po)

Bram Luyten - bram@atmire.com

Claudia Jürgen - claudia.juergen@tu-dortmund.de - German (de.po)

Translator documentation

Translation files (.po)

Comments - #

All lines in the translation files that start with # are comments, either aimed at helping developers or helping translators.

#: at the start of a line is a source reference, aimed at making it clear where in the source code this message IS or WAS used. Because the original po files were migrated from another, json based format, the old JSON keys have been added as source references, to make it clear where the message originally came from in the previous format.

Normal key / msgid examples

For most keys that need to be translated, the English original is part of the DSpace Angular source code. This original is then used as the msgid

...

Code Block
languagebash
titleEscaping of double quotes example
#: .submission.workflow.generic.delete-help
msgid ""
"If you would to discard this item, select \"Delete\".  You will then be "
"asked to confirm it."
msgstr ""
"If you would to discard this item, select \"Delete\".  You will then be "
"asked to confirm it."

Dynamic key example

In parts of the DSpace Angular code, a list of very similar objects is being built and displayed in the user interface, for example, the search filters. 

...

Notice how here, that the English translation is also added into the comments, because msgid needs to hold the key in order for the translation to work.

The Angular DSpace 7 message catalog (dspace.pot)

The format of the dspace.pot catalog file, is very similar to the format of the translations. 

The main difference is that this file does not contain actual translated strings (msgstr), because it serves as the authoritative catalog of the source messages, without translations.


Background reading

The PO Format

GNU gettext utilities

Developer How-to

Escaping

In Angular files (.html, .ts, ...) you need to escape

...

  • Double quotes (") with \
  • ...

Locating keys that have not been replaced

If you execute following command in the angular source directory, you get a list of keys that have not yet been replaced.

...

Code Block
languagebash
app/+community-page/delete-community-page/delete-community-page.component.html:5: <h2 id="header" class="border-bottom pb-2">{{ 'community.delete.head' | translate
app/+community-page/delete-community-page/delete-community-page.component.html:7: <p class="pb-2">{{ 'community.delete.text' | translate:{ dso: dso.name } }}</p>
app/+community-page/delete-community-page/delete-community-page.component.html:12: <button class="btn btn-primary" (click)="onCancel(dso)">{{'community.delete.cancel' | translate}}
app/+community-page/edit-community-page/edit-community-page.component.html:4: <h2 id="header" class="border-bottom pb-2">{{ 'community.edit.head' | translate }}</h2>


Future work

Message Context - msgctxt

Apart from comments, starting with #, the msgid lines representing the key, and the msgstr lines, representing the translations, an entry can also contain a msgctxt line.

...