postgresql_16:8.6.1.3 Creating and Maintaining Message Catalogs
PostgreSQL 16 > Internals > Native Language Support > For the Translator > Creating and Maintaining Message Catalogs
OK, so how does one create a “blank” message catalog? First, go into the directory that contains the program whose messages you want to translate. If there is a file nls.mk, then this program has been prepared for translation.
If there are already some .po files, then someone has already done some translation work. The files are named *language*.po, where *language* is the ISO 639-1 two-letter language code (in lower case), e.g., fr.po for French. If there is really a need for more than one translation effort per language then the files can also be named *language*_*region*.po where *region* is the ISO 3166-1 two-letter country code (in upper case), e.g., pt_BR.po for Portuguese in Brazil. If you find the language you wanted you can just start working on that file.
If you need to start a new translation effort, then first run the command: make init-po This will create a file *progname*.pot. (.pot to distinguish it from PO files that are “in production”. The T stands for “template”.) Copy this file to *language*.po and edit it. To make it known that the new language is available, also edit the file po/LINGUAS and add the language (or language and country) code next to languages already listed, like: de fr (Other languages can appear, of course.)
As the underlying program or library changes, messages might be changed or added by the programmers. In this case you do not need to start from scratch. Instead, run the command: make update-po which will create a new blank message catalog file (the pot file you started with) and will merge it with the existing PO files. If the merge algorithm is not sure about a particular message it marks it “fuzzy” as explained above. The new PO file is saved with a .po.new extension.