Postgresql 中文操作指南
57.2. For the Programmer #
57.2.1. Mechanics #
本节介绍如何在 PostgreSQL 分发版的一部分程序或库中实现本机语言支持。当前这仅适用于 C 程序。
This section describes how to implement native language support in a program or library that is part of the PostgreSQL distribution. Currently, it only applies to C programs.
Adding NLS Support to a Program
-
CATALOG_NAME
-
The program name, as provided in the textdomain() call.
-
-
GETTEXT_FILES
-
List of files that contain translatable strings, i.e., those marked with gettext or an alternative solution. Eventually, this will include nearly all source files of the program. If this list gets too long you can make the first “file” be a + and the second word be a file that contains one file name per line.
-
-
GETTEXT_TRIGGERS
-
The tools that generate message catalogs for the translators to work on need to know what function calls contain translatable strings. By default, only gettext() calls are known. If you used _ or other identifiers you need to list them here. If the translatable string is not the first argument, the item needs to be of the form func:2 (for the second argument). If you have a function that supports pluralized messages, the item should look like func:1,2 (identifying the singular and plural message arguments).
-
构建系统将自动负责构建和安装邮件目录。
The build system will automatically take care of building and installing the message catalogs.
57.2.2. Message-Writing Guidelines #
以下是编写可轻松翻译的消息的一些准则。
Here are some guidelines for writing messages that are easily translatable.