Translations - softwareloop/alfresco-inboxes GitHub Wiki

Alfresco-inboxes uses a number of labels (for group and inbox names, metadata information and buttons) all of which are internationalised. English, Italian, and Brazilian Portuguese are supported out of the box. This page explains how to add support for other languages.

The messages.properties file

Locate the src/main/amp/web/js/softwareloop/inboxes/i18n/ folder in the source distribution. The folder contains three files:

  • messages.properties : for the default language, i.e. English
  • messages_it.properties : for Italian
  • messages_pt_BR.properties : for Brazilian Portuguese

To add support for another language, copy "messages.properties" to a new file called "messages_xx.properties" in the same folder. Instead of "xx", use the two letter ISO 639-1 code of the language, e.g., "fr" for French.

Then edit the new file.

my-documents = My documents
drafts = Drafts
for-my-approval = For my approval
overdue = Overdue
high-priority = High priority

archive = Archive
invoices = Invoices
purchase-orders = Purchase orders
quotations = Quotations
marketing-documents = Marketing documents

modified.on.by = Modified on {date} by {user}
download.size = Download ({size})
approve = Approve
reject = Reject

One by one, translate every string on the right side of the "=" sign.

There is only one exception: if you find a word enclosed in brackets ("{date}, "{user}", "{size}") it must not be translated. Such words are template placeholders and have a special meaning.

Which language will be displayed?

Alfresco Share automatically picks up the language according to your browser settings. If the language is one for which a translation file is available, that translation will be used, otherwise it will use the default translation, i.e. English.

References from the code

The string on the left side of the "=" sign in the properties file is the "key" of the message. Keys are referenced from other files in the code as here explained.

The group and inbox names (the first 10 keys, from "my-documents" to "marketing-documents") are referenced from the "inboxes.get.config.xml" file located at src/main/amp/config/alfresco/web-extension/site-webscripts/softwareloop/inboxes/, specifically from the "id" attributes of the group and inbox elements. If you configure different groups or inboxes remember to keep these references aligned.

"modified.on.by", "download.size", "approve" and "reject" are referenced from "Item.js" located at src/main/amp/web/js/softwareloop/inboxes/. If you customise the results view remember to keep these references aligned.