Contribute to the DSpace Development Fund
The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.
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.
Originating in the Linux world, the GNU gettext tools and the PO file format is also the backbone of localization support in Wordpress, django and Drupal
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.
Accounts for the DuraSpace wiki are free as well and can be requested in an email to sysadmin@duraspace.org, indicating that you wish to contribute to DSpace 7 Translations.
Make yourself familiar with the new .pot catalog of DSpace messages, as well the .po file format with the translations for the catalog.
- 2019-05-20 DRAFT dspace.pot
- In this catalog, all msgstr entries are empty. This is because the catalog is the authoritative place for the original keys, not for any translations.
- the English messages ARE they keys. There is no intermediate concept of opaque keys anymore. The English messages are used throughout the code, and are the basis for providing the translations.
- 2019-05-20 DRAFT en.po or the older DRAFT de.po
- Both the msgids and the msgstr entries are in English in en.po.
- The msgids are in English, and the msgstr are in German in de.po
- Purely as comment, the old intermediate keys are still referenced in comments
Explore tools that can help you with the management of .pot and .po files. https://poedit.net/ is one widely used desktop application.
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.
As long as DSpace 7 is still in development, it is expected that the dspace.pot catalog, as well as the different translations, will continue to be extended and evolved.
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
Translator documentation
Translation files (.po)
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.
As a translator, you add the translation into the msgstr variable.
As demonstrated in the example below, you are required to wrap your translation in double quotes.
#: .item.edit.withdraw.description msgid "Are you sure this item should be withdrawn from the archive?" msgstr "Ben je zeker dat je dit item wil terugtrekken uit het archief?"
Following multi-line example shows that both the original key, as well as the translation, can be split over multiple lines.
#: .submission.sections.upload.info msgid "" "Here you will find all the files currently in the item. You can update the " "file metadata and access conditions or <strong>upload additional files just " "dragging & dropping them everywhere in the page</strong>" msgstr "" "Hier vind je alle bestanden momenteel opgeladen in het item. Je kan hier de " "bestands metadata en toegangsvoorwaarden aanpassen. Je kan ook <strong>extra" "bestanden toevoegen door ze eender waar naar de pagina te slepen</strong>"
Dynamic key example
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
Developer How-to
Escaping
In Angular files (.html, .ts, ...) you need to escape
- Single quotes (') with \
- Double curly braces
{{ 'copyright © 2002-{'+'{ year }'+'}' | translate:{year : dateObj | date:'y'} }}
In .po/.pot files 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.
grep -snRHIiE "'.*\.[^\s]+\.[^']+' \| translate" *
Sample output looks like:
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>