summaryrefslogtreecommitdiff
path: root/src/nls-global.mk
Commit message (Collapse)AuthorAgeFilesLines
* Fix for make unportabilityPeter Eisentraut2022-07-131-1/+1
| | | | | | | | | | | 88dad06b47eb80f699211c9b0b7a1c6d9016ad19 contains a make $(shell) construct that apparently confuses older GNU make versions (possibly because of the # inside the shell command?). This construct, which would allow # comments inside LINGUAS files, was adapted from gettext recommendations, but we don't actually need that functionality, so sidestep this whole issue by just using plain "cat". In passing, make this code work with vpath.
* NLS: Put list of available languages into LINGUAS filesPeter Eisentraut2022-07-131-1/+5
| | | | | | | | | | | | | | | | | | | | | 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
* Improve frontend error logging style.Tom Lane2022-04-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Get rid of the separate "FATAL" log level, as it was applied so inconsistently as to be meaningless. This mostly involves s/pg_log_fatal/pg_log_error/g. Create a macro pg_fatal() to handle the common use-case of pg_log_error() immediately followed by exit(1). Various modules had already invented either this or equivalent macros; standardize on pg_fatal() and apply it where possible. Invent the ability to add "detail" and "hint" messages to a frontend message, much as we have long had in the backend. Except where rewording was needed to convert existing coding to detail/hint style, I have (mostly) resisted the temptation to change existing message wording. Patch by me. Design and patch reviewed at various stages by Robert Haas, Kyotaro Horiguchi, Peter Eisentraut and Daniel Gustafsson. Discussion: https://postgr.es/m/1363732.1636496441@sss.pgh.pa.us
* Add errhint_plural() function and make use of itPeter Eisentraut2021-03-311-2/+2
| | | | | Similar to existing errmsg_plural() and errdetail_plural(). Some errhint() calls hadn't received the proper plural treatment yet.
* NLS: Fix backend gettext triggersPeter Eisentraut2019-09-231-0/+2
| | | | | The backend also needs to pull in translations from the frontend pg_log_*() functions, since some files in src/common/ use those.
* Move logging.h and logging.c from src/fe_utils/ to src/common/.Tom Lane2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The original placement of this module in src/fe_utils/ is ill-considered, because several src/common/ modules have dependencies on it, meaning that libpgcommon and libpgfeutils now have mutual dependencies. That makes it pointless to have distinct libraries at all. The intended design is that libpgcommon is lower-level than libpgfeutils, so only dependencies from the latter to the former are acceptable. We already have the precedent that fe_memutils and a couple of other modules in src/common/ are frontend-only, so it's not stretching anything out of whack to treat logging.c as a frontend-only module in src/common/. To the extent that such modules help provide a common frontend/backend environment for the rest of common/ to use, it's a reasonable design. (logging.c does not yet provide an ereport() emulation, but one can dream.) Hence, move these files over, and revert basically all of the build-system changes made by commit cc8d41511. There are no places that need to grow new dependencies on libpgcommon, further reinforcing the idea that this is the right solution. Discussion: https://postgr.es/m/a912ffff-f6e4-778a-c86a-cf5c47a12933@2ndquadrant.com
* Unified logging system for command-line programsPeter Eisentraut2019-04-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This unifies the various ad hoc logging (message printing, error printing) systems used throughout the command-line programs. Features: - Program name is automatically prefixed. - Message string does not end with newline. This removes a common source of inconsistencies and omissions. - Additionally, a final newline is automatically stripped, simplifying use of PQerrorMessage() etc., another common source of mistakes. - I converted error message strings to use %m where possible. - As a result of the above several points, more translatable message strings can be shared between different components and between frontends and backend, without gratuitous punctuation or whitespace differences. - There is support for setting a "log level". This is not meant to be user-facing, but can be used internally to implement debug or verbose modes. - Lazy argument evaluation, so no significant overhead if logging at some level is disabled. - Some color in the messages, similar to gcc and clang. Set PG_COLOR=auto to try it out. Some colors are predefined, but can be customized by setting PG_COLORS. - Common files (common/, fe_utils/, etc.) can handle logging much more simply by just using one API without worrying too much about the context of the calling program, requiring callbacks, or having to pass "progname" around everywhere. - Some programs called setvbuf() to make sure that stderr is unbuffered, even on Windows. But not all programs did that. This is now done centrally. Soft goals: - Reduces vertical space use and visual complexity of error reporting in the source code. - Encourages more deliberate classification of messages. For example, in some cases it wasn't clear without analyzing the surrounding code whether a message was meant as an error or just an info. - Concepts and terms are vaguely aligned with popular logging frameworks such as log4j and Python logging. This is all just about printing stuff out. Nothing affects program flow (e.g., fatal exits). The uses are just too varied to do that. Some existing code had wrappers that do some kind of print-and-exit, and I adapted those. I tried to keep the output mostly the same, but there is a lot of historical baggage to unwind and special cases to consider, and I might not always have succeeded. One significant change is that pg_rewind used to write all error messages to stdout. That is now changed to stderr. Reviewed-by: Donald Dong <xdong@csumb.edu> Reviewed-by: Arthur Zakirov <a.zakirov@postgrespro.ru> Discussion: https://www.postgresql.org/message-id/flat/6a609b43-4f57-7348-6480-bd022f924310@2ndquadrant.com
* Replace @postgresql.org with @lists.postgresql.org for mailinglistsMagnus Hagander2019-01-191-1/+1
| | | | | | Commit c0d0e54084 replaced the ones in the documentation, but missed out on the ones in the code. Replace those as well, but unlike c0d0e54084, don't backpatch the code changes to avoid breaking translations.
* nls-global.mk: search build dir for source files, tooAlvaro Herrera2016-06-071-2/+2
| | | | | | | | | | In VPATH builds, the build directory was not being searched for files in GETTEXT_FILES, leading to failure to construct the .pot files. This has bit me all along, but never hard enough to get it fixed; I suppose not a lot of people uses VPATH and NLS-enabled builds, and those that do, don't do "make update-po" often. This is a longstanding problem, so backpatch all the way back.
* Setup error context callback for transaction lock waitsAlvaro Herrera2014-03-191-1/+4
| | | | | | | | | | | | | | | | | | With this in place, a session blocking behind another one because of tuple locks will get a context line mentioning the relation name, tuple TID, and operation being done on tuple. For example: LOG: process 11367 still waiting for ShareLock on transaction 717 after 1000.108 ms DETAIL: Process holding the lock: 11366. Wait queue: 11367. CONTEXT: while updating tuple (0,2) in relation "foo" STATEMENT: UPDATE foo SET value = 3; Most usefully, the new line is displayed by log entries due to log_lock_waits, although of course it will be printed by any other log message as well. Author: Christian Kruse, some tweaks by Álvaro Herrera Reviewed-by: Amit Kapila, Andres Freund, Tom Lane, Robert Haas
* Remove maintainer-check target, fold into normal buildPeter Eisentraut2013-10-101-9/+2
| | | | | | | | | | | | | | | | | | make maintainer-check was obscure and rarely called in practice, and many breakages were missed. Fold everything that make maintainer-check used to do into the normal build. Specifically: - Call duplicate_oids when genbki.pl is called. - Check for tabs in SGML files when the documentation is built. - Run msgfmt with the -c option during the regular build. Add an additional configure check to see whether we are using the GNU version. (make maintainer-check probably used to fail with non-GNU msgfmt.) Keep maintainer-check as around as phony target for the time being in case anyone is calling it. But it won't do anything anymore.
* NLS: Use msgmerge --previous optionPeter Eisentraut2012-12-131-1/+1
| | | | It provides some additional help to translators.
* Lots of doc corrections.Robert Haas2012-04-231-1/+1
| | | | Josh Kupershmidt
* NLS: Initialize Project-Id-Version field by xgettextPeter Eisentraut2012-04-101-1/+1
| | | | | Since xgettext provides options to do this now, we might as well use them.
* NLS: Use msgmerge/xgettext --no-wrap and --sort-by-filePeter Eisentraut2012-04-051-1/+5
| | | | | | The option --no-wrap prevents wars with (most?) editors about proper line wrapping. --sort-by-file ensures consistent file order, for easier diffing.
* NLS: Seed Language field in PO headerPeter Eisentraut2012-04-021-2/+2
| | | | | Use msgmerge --lang option to seed the Language field, recently introduced by gettext, in the header of the new PO file.
* Run maintainer-check on all PO files, not only configured onesPeter Eisentraut2012-03-281-1/+2
| | | | | | The intent is to allow configure --enable-nls=xx for installation speed and size, but have maintainer-check check all source files regardless.
* Sort compendium lists for msgmergePeter Eisentraut2011-12-271-2/+2
| | | | | That way, the result of a msgmerge is more deterministic and not dependent on the order in which the files are found.
* Add the possibility to pass --flag arguments to xgettext callsPeter Eisentraut2011-06-271-2/+11
| | | | | | | | | | | | The --flag argument can be used to tell xgettext the arguments of which functions should be flagged with c-format in the PO files, instead of guessing based on the presence of format specifiers, which fails if no format specifiers are present but the translation accidentally introduces one. Appropriate flag settings have been added for each message catalog. based on a patch by Christoph Berg for bug #6066
* Refactor common gettext triggersPeter Eisentraut2011-06-271-0/+8
| | | | | | Put gettext trigger words that are common to the backend and backend modules into a makefile variable to include everywhere, to avoid error-prone repetitions.
* Replace tabs by spaces in makefile commentPeter Eisentraut2011-06-261-5/+5
|
* Make _ be automatically included in GETTEXT_TRIGGERSPeter Eisentraut2011-06-261-0/+3
| | | | | Since it's globally defined in c.h, it should be treated as a gettext trigger everywhere.
* Fix makefile logic to not break the build when xgettext is missingPeter Eisentraut2010-10-141-4/+8
| | | | | | xgettext is only required when make init-po is run manually; it is not required for a build. The intent to handle that was already there, but the ifdef's were in the wrong place.
* Remove cvs keywords from all files.Magnus Hagander2010-09-201-1/+1
|
* Avoid error from mkdir if no languages are to be installedPeter Eisentraut2010-05-131-4/+3
| | | | | | | mkinstalldirs used to handle no arguments, but mkdir doesn't. Also remove the .SILENT setting, that was previously removed from Makefile.global as well.
* Update of install-sh, mkinstalldirs, and associated configuryPeter Eisentraut2009-08-261-3/+3
| | | | | | | | | | | | | | Update install-sh to that from Autoconf 2.63, plus our Darwin-specific changes (which I simplified a bit). install-sh is now able to install multiple files in one run, so we could simplify our makefiles sometime. install-sh also now has a -d option to create directories, so we don't need mkinstalldirs anymore. Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available instead of install-sh -d. For consistency with the rest of the world, the corresponding make variable has been renamed from $(mkinstalldirs) to $(MKDIR_P).
* Do not msgmerge against /dev/null; merge against the pot file itselfPeter Eisentraut2009-01-201-4/+6
| | | | instead.
* Make .pot files depend on the makefiles, so that they are updated when thePeter Eisentraut2009-01-151-3/+3
| | | | file or trigger function lists are changed.
* More portable use of "find".Peter Eisentraut2009-01-091-3/+3
|
* Rewrite update-po target, so that it works less like a shell script and morePeter Eisentraut2009-01-091-19/+24
| | | | | | | | | | | like a makefile with real dependencies. Instead of overwriting the old po file, write the new one to .po.new. This is less annoying and integrates better with the NLS web site. Also, we can now merge languages that don't have a po file yet, by merging against all other po files of that language, to pick up recurring translations automatically. This previously only worked when a po file already existed.
* Initialize .pot files with some useful default values.Peter Eisentraut2009-01-021-3/+4
|
* Append major version number and for libraries soname major version numberPeter Eisentraut2008-12-111-3/+4
| | | | | | | to the gettext domain name, to simplify parallel installations. Also, rename set_text_domain() to pg_bindtextdomain(), because that is what it does.
* Another fix for compiles on an empty 'po' directory.Bruce Momjian2008-05-171-2/+2
|
* Don't call rm with empty file list.Peter Eisentraut2008-05-171-2/+2
|
* When merging PO files, take into consideration translations in other POPeter Eisentraut2006-04-051-12/+15
| | | | | | files of the same languages. That way, similar or equal translations in different programs are automatically propagated and the life of translators becomes a little bit easier.
* Allow installation into directories containing spaces in the name.Peter Eisentraut2005-12-091-4/+4
|
* More locale fixes for pg_ctl.Bruce Momjian2004-06-011-5/+5
|
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-291-1/+1
|
* Run distprep target before creating list of files that contain translatablePeter Eisentraut2003-09-141-13/+8
| | | | | strings in the backend, so that .l and .y files are included. To that end, don't make the .pot file a prerequisite on distprep.
* Avoid shell syntax error if list of languages is empty.Peter Eisentraut2002-09-021-1/+3
|
* Create "po" subdirectory before writing there.Peter Eisentraut2002-08-291-1/+2
|
* Move PO files into subdirectories separate from the source code.Peter Eisentraut2002-08-211-15/+16
|
* NLS updates, most notably fixed zh_TW translationsPeter Eisentraut2001-11-291-3/+2
|
* Change xgettext rule to run in the source tree, so we don't have thePeter Eisentraut2001-07-151-3/+5
| | | | | absolute paths of the source tree in the po files. Also, run msgfmt with -c option in maintainer-check.
* Add missing dependency and fix thinko.Peter Eisentraut2001-06-301-5/+7
|
* Native Language Support (NLS)Peter Eisentraut2001-06-021-0/+119
Use --enable-nls to turn it on; see installation instructions for details. See developer's guide how to make use of it in programs and how to add translations. psql sources have been almost fully prepared and an incomplete German translation has been provided. In the backend, only elog() calls are currently translatable, and the provided German translation file is more of a placeholder.