Skip to content
This repository has been archived by the owner. It is now read-only.

6. Locale

LaraHack edited this page Mar 18, 2016 · 9 revisions

The interface of Accurator can show text in different languages, depending on the locale specified by the user and the available translations. There are labels for the generic interface and labels used for specific domains, like bible and birds. This is useful as there are labels that are particular for a certain domain and they can be used together with the ones of the generic interface.

The labels for the generic interface are in the folder cpack/accurator/rdf/ui/. Here the general label schema is defined in cpack/accurator/rdf/ui/labels_schema.ttl. The default language for the labels is English and the English labels for the generic interface can be found in cpack/accurator/rdf/ui/labels.ttl. New languages can be added by creating a new label definition file in cpack/accurator/rdf/ui/labels_[2_letters_language_code].ttl. An example for the Dutch language is cpack/accurator/rdf/ui/labels_nl.ttl.

The labels that are domain specific are in the folder cpack/accurator/rdf/[domain_name]/ui/. The naming of the files in this folder follows the convention for the general interface. Thus, for the bible domain, the labels that are specific for this interface are in cpack/accurator/rdf/bible/ui/labels.ttl for English and cpack/accurator/rdf/bible/ui/labels_nl.ttl for Dutch.

Adding translations can be done by adding literals with language tags in the label files mentioned above. This is the RDF with the interface labels for the intro page for English labels:

###### Intro Screen #####
aui:intro a auis:UI ;
	dcterms:title "Accurator intro UI"@en ;
	aui:introHdrSlogan "Accurate Art Annotations"@en ;
	aui:introHdrSubSlogan "Help us add information to artworks"@en ;
	aui:introBtnRegister "Register"@en ;
	aui:introBtnLogin "or Log in"@en ;
	aui:introLnkAbout "About Accurator"@en .

If a completely new locale is added, it should be included as an option in the flag selection menu (flag image should be added in cpack/accurator/web/img/flags) and locale switching mechanism (in cpack/accurator/web/html/accurator_utilities.js).