New Developers Working Group
Evergreen is designed to work in multiple languages, but it requires a bit of configuration to get it set up.
Prerequisite:
As root, install a translation tool:
make -f Open-ILS/src/extras/Makefile.install ubuntu-focal-translator
Prior to installing Evergreen:
As opensrf, navigate to Evergreen/build/i18n:
Repeat steps 2-4 for each additional language.
Copy Files
At this point, you should have PO files under:
Copy each of these folders to the corresponding location on your server.
All language files you use need to be present in the locales table, so any custom files or files that aren’t included in master will need to be added.
See if the one you need is already present:
SELECT * FROM config.i18n_locale;
Add an entry for each additional language you wish to add:
INSERT INTO config.i18n_locale VALUES ('cs-CZ','cze','Czech','Czech');
If you've created a local translation file to override the default strings, add that as well:
INSERT INTO config.i18n_locale (code, marc_code, name, description) VALUES ('en-PINES', 'eng', 'PINES', 'PINES English');
Add the generated seed data if it was not already installed. Navigate to /Evergreen/build/i18n/locale/cs-CZ and run:
psql -U evergreen -a -f 950.data.seed-values.sql
PerlAddVar OILSWebLocale "cs_cz" PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/cs-CZ.po"
PerlAddVar OILSWebDefaultLocale "cs-cz"
su - opensrf -c "bash -i -c '/openils/bin/osrf_control --localhost --restart-all'"
/etc/init.d/apache2 restart
The newer Angular administration interfaces provide a button to add translations (for example, the MARC Coded Value Map controls the Audience dropdown fields in the OPAC advanced search), but you will need to edit a file in order to enable it for each language.
Most strings only require the addition of "i18n" to the innermost tag surrounding text:
<button type="button" class="btn btn-success" (click)="close(true)" i18n>Confirm</button>
Tags that include the text rather than wrapping around the next need to be structured slightly differently.
Label example:
<eg-link-table-link i18n-label label="Claiming" routerLink="/staff/admin/acq/claiming"></eg-link-table-link>
Page banner example:
<eg-staff-banner bannerText="Acquisitions Administration" i18n-bannerText></eg-staff-banner>
Example of a patch that adds new strings:
When creating a message in TypeScript, use the $localize tag handler with backticks around the text.
Example:
warning_msg = $localize`Watch out!`;
Example:
warning_msg = $localize`There is a problem with ${this.barcode}`;
Template Toolkit pages (aka TT2 or .tt2 files) should wrap every display string with "l()" to indicate that it should be translated:
[% l('Library Hours') %]
Evergreen translation files are stored in Launchpad. They are downloaded and brought into Evergreen as PO files.
You can add or update translations directly in Launchpad one string at a time or edit them locally with POEditor and then upload them.