diff options
| author | Peter Eisentraut | 2022-07-13 05:51:43 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2022-07-13 06:19:17 +0000 |
| commit | 88dad06b47eb80f699211c9b0b7a1c6d9016ad19 (patch) | |
| tree | 8168c17cdfd7c3d960b8a530d2e43500b978e8f8 /src/nls-global.mk | |
| parent | f29199d3190ffdc48f40233f58a346bbb906c060 (diff) | |
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
Diffstat (limited to 'src/nls-global.mk')
| -rw-r--r-- | src/nls-global.mk | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nls-global.mk b/src/nls-global.mk index c1f7982300..ba4f569803 100644 --- a/src/nls-global.mk +++ b/src/nls-global.mk @@ -8,7 +8,6 @@ # # CATALOG_NAME -- name of the message catalog (xxx.po); probably # name of the program -# AVAIL_LANGUAGES -- list of languages that are provided/supported # GETTEXT_FILES -- list of source files that contain message strings # GETTEXT_TRIGGERS -- (optional) list of functions that contain # translatable strings @@ -16,6 +15,9 @@ # function arguments that contain C format strings # (functions must be listed in TRIGGERS and FLAGS) # +# Also, provide a text file 'po/LINGUAS' with a space-separated list +# of languages that are provided/supported. +# # That's all, the rest is done here, if --enable-nls was specified. # # The only user-visible targets here are 'init-po', to make an initial @@ -27,6 +29,8 @@ # existence checked by Makefile.global; otherwise we won't get here include $(srcdir)/nls.mk +AVAIL_LANGUAGES := $(shell sed -e "/^#/d" -e "s/#.*//" po/LINGUAS) + # If user specified the languages he wants in --enable-nls=LANGUAGES, # filter out the rest. Else use all available ones. ifdef WANTED_LANGUAGES |
