CollectiveAccess currently supports multi-lingual cataloging in a variety of languages including English, German, French, Dutch and Swedish. Software translations allow localization of notification messages as the software runs (i.e. “Saved changes to user") as well as installation-specific vocabulary used in customized profiles, including metadata elements, controlled lists, relationship qualifiers and more. Translations also affect the system’s date and time parser settings, the piece of code that interprets and outputs dates. Creating a translation is relatively simple and can be performed for nearly any language.
Translations are not only useful for polyglot users, however. They also control the display of default terminology system wide. If, for example, a user decides to include the “collection” table in their system configuration but decides they would like to refer to collections as projects, altering the installation profile alone is not sufficient to make this change. Notification messages, menu navigation, widgets and other software components need to be “translated” from the default term to the custom one.
Creating a non-English translation
Before you begin creating your translation, check the CollectiveAccess wiki to make sure one isn’t currently in development. When you’re ready to begin, you’ll need to locate the locale directory at app/locale in the Providence directory. Inside each locale folder are two files: messages.po and messgages.mo
If you are starting a new translation you need to do the following:
- Create a directory in app/locale for your new locale.
- Copy the messages.po file from the en_US directory to your new locale directory.
- Open and edit messages.po using a GetText-compatible editor such as POEdit and translate each English string into your target language. If using POEdit, the .mo file will be automatically created or updated every time you save your .po file.
Creating a localization file for the date/time parser
The next step is to localize the date/time parser. To do so copy the English language date/time parser settings file in app/lib/core/Parsers/TimeExpressionParser/en_US.lang to a file with your locale in the name in app/lib/core/Parsers/TimeExpressionParser and edit to suit. The file includes comments describing the meaning and format of various settings.
Localizing an installation profile
At this point you have a translated application. You still need a translated configuration, however. All display text in a profile is tagged with a locale string and supports specification of multiple locales. Simply add your translation alongside the existing text tagged with your selected locale.
<labels> <label locale="en_US"> <name>Item description</name> <description>Narrative description for item in this set. This is the primary text used when publicly presenting the item in the context of this set.</description> </label> <label locale="fr_FR"> <name>Description de l\'objet</name> <description>Description narrative pour un élément de cet ensemble. Il s\'agit du texte principal utilisé lors d\'un affichage public d\'un élément dans le contexte de cet ensemble.</description> </label> </labels>
Translating system terminology
To translate a CollectiveAccess default term to a custom one, follow direction #3 for non-English translations, but simply work with the files already in the English locale folder: app/locale/en_US.