[Archivesspace_Users_Group] how to add a new locale to ArchivesSpace?

Christine Di Bella christine.dibella at lyrasis.org
Wed Dec 6 10:42:05 EST 2023


Hello Ron,

It's great to hear that you're working on customizing your interfaces to have the option of providing labels in Dutch. I believe there are some institutions in the Netherlands, Belgium, and Luxembourg that have already done that, and you may hear from them here or directly. That would likely give you a very significant head start on your customization.

The Dutch translations themselves have not been contributed to the core ArchivesSpace yet, but we would be very interested in having them. We have a few options for contributing translations to ArchivesSpace, including using the Weblate service. If you are comfortable working directly with the .yml files, however, you need to first grab the ones from our GitHub repository itself. If you only use the ones in a release distribution file, your interface will be only partially translated.

These are the six directories to look for:
https://github.com/archivesspace/archivesspace/tree/master/common/locales
https://github.com/archivesspace/archivesspace/tree/master/common/locales/enums
https://github.com/archivesspace/archivesspace/tree/master/frontend/config/locales
https://github.com/archivesspace/archivesspace/tree/master/frontend/config/locales/help
https://github.com/archivesspace/archivesspace/tree/master/public/config/locales

https://github.com/archivesspace/archivesspace/tree/master/reports (there are locale files for each of the reports in the subdirectories under this main directory)

It's probably easiest to use the en.yml ones as your starting point since the labels in the file (the text that appears before the colons) need to stay in English. Follow the pattern you see and make a set where each file is named nl.yml. Within the files, change the text that appears after the colon for each entry you want to be in Dutch. (Don't change any of the formatting or line spacing since a computer is very literal.)

Once you've made all the changes you want, you can pull request the new files to us via GitHub, we can review, and then when all is correct and working like it should we will include them in a future release of ArchivesSpace.

There's plenty more to say, but I'll start there and see if anyone who's currently working with a translated interface or with translations has advice to offer. We're always interested in people submitting more languages for the ArchivesSpace application or improving the ones we have.

Christine

Christine Di Bella
ArchivesSpace Senior Program Manager
christine.dibella at lyrasis.org<mailto:christine.dibella at lyrasis.org>

[cid:image001.jpg at 01DA282F.D73F8850]



From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> On Behalf Of Ron Van den Branden
Sent: Wednesday, December 6, 2023 9:51 AM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] how to add a new locale to ArchivesSpace?

Hi all,
We're in the process of customizing the ArchivesSpace (3.4.1) staff interface for use in a Dutch-speaking context. We would like to translate the back-end user interface to Dutch. So far, in order to gain speed, we've resorted to tweaking the en.yml localization files with Dutch labels. In the longer run, hijacking "English" for another language feels like a hack, though.
The documentation for "customizing text" at https://archivesspace.github.io/tech-docs/customization/locales.html  does mention where strings can be customized in current locales, but not how new locales can be added. Simply adding new locale files for new languages, with according names and language codes, at the right locations doesn't seem to do the trick:

  *   either the language is not being offered in the list of available languages
  *   when additionally the new language is specified explicitly in the config/config.rb file as AppConfig[:locale] = :nl , this yields following error at startup:

JSONModel::ValidationException: #<:ValidationException: {:errors=>{"defaults/locale"=>["Invalid value 'nl'.  Must be one of: en, fr, de, ja, es"]}}>

                      validate at uri:classloader:/jsonmodel_type.rb:385

            with_validator_for at uri:classloader:/validator_cache.rb:41
...so there must be more to adding a new locale. Yet, we can't find where in the ArchivesSpace distribution code such a list of default locales can be found or edited.
We did find the file in the ArchivesSpace source tree at https://github.com/archivesspace/archivesspace/blob/master/common/aspace_i18n.rb#L28 which defines above list of locales This file can't be found in the distribution code, however, so it's not clear how it relates to the distribution code. The commit history also shows commits from the Weblate project at https://hosted.weblate.org/projects/archivesspace-interfaces/#languages, which contains additional languages Portuguese and Italian.
This leads to following questions:

  *   what's the mechanism for adding a new locale to an ArchivesSpace instance?
  *   if our translations would reach a stage of being of broader interest, what would be the procedure for contributing them?
Kind regards,
Ron


Ron Van den Branden | functioneel analist - applicatiebeheerder Letterenhuis

Stad Antwerpen | Talentontwikkeling en Vrijetijdsbeleving |  Boeken en Letteren

Minderbroedersstraat 22, 2000 Antwerpen

Grote Markt 1, 2000 Antwerpen

gsm +32 0485 02 80 50 | tel. +32 3 222 93 30

letterenhuis.be<http://www.letterenhuis.be/> | instagram<https://www.instagram.com/letterenhuis/> | facebook<https://www.facebook.com/Letterenhuis>



Proclaimer

Vergissen is menselijk. Dus als deze e-mail, samen met eventuele bijlagen, niet voor u bestemd is, vragen we u vriendelijk om dat te melden aan de afzender. Deze e-mail en de bijlagen zijn namelijk officiële documenten van de stad Antwerpen. Ze kunnen vertrouwelijke of persoonlijke informatie bevatten. Als stad nemen we privacy heel serieus en willen we als een goede huisvader waken over de vertrouwelijkheid van documenten. Als u dit bericht per vergissing hebt ontvangen of ergens hebt gevonden, wees dan zo eerlijk om het meteen te verwijderen en het niet verder te verspreiden of te kopiëren.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20231206/ffbce0b7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 56099 bytes
Desc: image001.jpg
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20231206/ffbce0b7/attachment.jpg>


More information about the Archivesspace_Users_Group mailing list