3.4.2 Registering a Domain

Domains are based on package name. Let's say I want to translate the DrGeoII application. All DrGeoII classes are in the class category prefixed DrGeoII, to register these classes in one domain, you execute:

registerCategoryPrefix: 'DrGeoII'
domain: 'DrGeoII'.

To export as a POT file template all the messages coming from this domain (i.e. the strings receiving the #translated message), you execute:

GetTextExporter exportTemplate.

In the folder containing the Pharo image, a new folder named po is created, it will contains two folders pharo and DrGeoII. Each one come with a POT file template, for DrGeoII it is named DrGeoII.pot. To translate your application in French, just copy this file as fr.po in another place, then start translating. To learn more about translating, jump to the next section.

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |