Skip to content

Commit 88dad06

Browse files
committed
NLS: Put list of available languages into LINGUAS files
This moves the list of available languages from nls.mk into a separate file called po/LINGUAS. Advantages: - It keeps the parts notionally managed by programmers (nls.mk) separate from the parts notionally managed by translators (LINGUAS). - It's the standard practice recommended by the Gettext manual nowadays. - The Meson build system also supports this layout (and of course doesn't know anything about our custom nls.mk), so this would enable sharing the list of languages between the two build systems. (The MSVC build system currently finds all po files by globbing, so it is not affected by this change.) Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/557a9f5c-e871-edc7-2f58-a4140fb65b7b@enterprisedb.com
1 parent f29199d commit 88dad06

File tree

54 files changed

+41
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+41
-40
lines changed

doc/src/sgml/nls.sgml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ make init-po
175175
Copy this file to
176176
<filename><replaceable>language</replaceable>.po</filename> and
177177
edit it. To make it known that the new language is available,
178-
also edit the file <filename>nls.mk</filename> and add the
179-
language (or language and country) code to the line that looks like:
178+
also edit the file <filename>po/LINGUAS</filename> and add the
179+
language (or language and country) code next to languages already listed,
180+
like:
180181
<programlisting>
181-
AVAIL_LANGUAGES := de fr
182+
de fr
182183
</programlisting>
183184
(Other languages can appear, of course.)
184185
</para>
@@ -375,16 +376,6 @@ fprintf(stderr, gettext("panic level %d\n"), lvl);
375376
</listitem>
376377
</varlistentry>
377378

378-
<varlistentry>
379-
<term><varname>AVAIL_LANGUAGES</varname></term>
380-
381-
<listitem>
382-
<para>
383-
List of provided translations &mdash; initially empty.
384-
</para>
385-
</listitem>
386-
</varlistentry>
387-
388379
<varlistentry>
389380
<term><varname>GETTEXT_FILES</varname></term>
390381

@@ -424,6 +415,12 @@ fprintf(stderr, gettext("panic level %d\n"), lvl);
424415
</para>
425416
</step>
426417

418+
<step>
419+
<para>
420+
Add a file <filename>po/LINGUAS</filename>, which will contain the list
421+
of provided translations &mdash; initially empty.
422+
</para>
423+
</step>
427424
</procedure>
428425

429426
<para>

src/backend/nls.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# src/backend/nls.mk
22
CATALOG_NAME = postgres
3-
AVAIL_LANGUAGES = de es fr id it ja ko pl pt_BR ru sv tr uk zh_CN
43
GETTEXT_FILES = + gettext-files
54
GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) \
65
GUC_check_errmsg \

src/backend/po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
de es fr id it ja ko pl pt_BR ru sv tr uk zh_CN

src/bin/initdb/nls.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# src/bin/initdb/nls.mk
22
CATALOG_NAME = initdb
3-
AVAIL_LANGUAGES = cs de el es fr he it ja ko pl pt_BR ru sv tr uk vi zh_CN
43
GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) findtimezone.c initdb.c ../../common/exec.c ../../common/fe_memutils.c ../../common/file_utils.c ../../common/pgfnames.c ../../common/restricted_token.c ../../common/rmtree.c ../../common/username.c ../../common/wait_error.c ../../port/dirmod.c
54
GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) simple_prompt
65
GETTEXT_FLAGS = $(FRONTEND_COMMON_GETTEXT_FLAGS)

src/bin/initdb/po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cs de el es fr he it ja ko pl pt_BR ru sv tr uk vi zh_CN

src/bin/pg_amcheck/nls.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# src/bin/pg_amcheck/nls.mk
22
CATALOG_NAME = pg_amcheck
3-
AVAIL_LANGUAGES = de el es fr ja ru sv uk zh_CN
43
GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) \
54
pg_amcheck.c \
65
../../fe_utils/cancel.c \

src/bin/pg_amcheck/po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
de el es fr ja ru sv uk zh_CN

src/bin/pg_archivecleanup/nls.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# src/bin/pg_archivecleanup/nls.mk
22
CATALOG_NAME = pg_archivecleanup
3-
AVAIL_LANGUAGES = cs de el es fr ja ko pl ru sv tr uk vi zh_CN
43
GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) pg_archivecleanup.c
54
GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
65
GETTEXT_FLAGS = $(FRONTEND_COMMON_GETTEXT_FLAGS)

src/bin/pg_archivecleanup/po/LINGUAS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cs de el es fr ja ko pl ru sv tr uk vi zh_CN

src/bin/pg_basebackup/nls.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# src/bin/pg_basebackup/nls.mk
22
CATALOG_NAME = pg_basebackup
3-
AVAIL_LANGUAGES = cs de es fr he it ja ko pl pt_BR ru sv tr uk vi zh_CN
43
GETTEXT_FILES = $(FRONTEND_COMMON_GETTEXT_FILES) \
54
bbstreamer_file.c \
65
bbstreamer_gzip.c \

0 commit comments

Comments
 (0)