]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
po: Add customizable 'fetch-po' script.
authorBruno Haible <bruno@clisp.org>
Fri, 24 Oct 2025 11:03:43 +0000 (13:03 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 24 Oct 2025 12:08:26 +0000 (14:08 +0200)
* gettext-tools/wizard/po-templates/traditional/fetch-po: New file.
* gettext-tools/wizard/Makefile.am (po_SCRIPTS): New variable.
(EXTRA_DIST): Add the po_SCRIPTS.
* gettext-tools/wizard/gettextize.in: Copy but don't overwrite po/fetch-po.
* gettext-tools/wizard/po-templates/traditional/Makefile.in.in (fetch-po): New
target.
* gettext-tools/examples/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-*/po/Makefile.am (fetch-po): New target.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile (fetch-po): New
target.
* gettext-tools/doc/gettext.texi (po/fetch-po): New subsection.
(po/LINGUAS): Explain how it related to the 'fetch-po' script.
(Release Management): Document how to fetch the PO files before a release.
* NEWS: Mention the change.

36 files changed:
NEWS
gettext-tools/doc/gettext.texi
gettext-tools/examples/hello-c++-qt/po/Makefile.am
gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am
gettext-tools/examples/hello-clisp/po/Makefile.am
gettext-tools/examples/hello-csharp-forms/po/Makefile.am
gettext-tools/examples/hello-csharp/po/Makefile.am
gettext-tools/examples/hello-d/po/Makefile.am
gettext-tools/examples/hello-gawk/po/Makefile.am
gettext-tools/examples/hello-go-http/po/Makefile.am
gettext-tools/examples/hello-go/po/Makefile.am
gettext-tools/examples/hello-guile/po/Makefile.am
gettext-tools/examples/hello-java-awt/po/Makefile.am
gettext-tools/examples/hello-java-qtjambi/po/Makefile.am
gettext-tools/examples/hello-java-swing/po/Makefile.am
gettext-tools/examples/hello-java/po/Makefile.am
gettext-tools/examples/hello-librep/po/Makefile.am
gettext-tools/examples/hello-modula2/po/Makefile.am
gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
gettext-tools/examples/hello-ocaml/po/Makefile.am
gettext-tools/examples/hello-pascal/po/Makefile.am
gettext-tools/examples/hello-perl/po/Makefile.am
gettext-tools/examples/hello-php/po/Makefile.am
gettext-tools/examples/hello-python/po/Makefile.am
gettext-tools/examples/hello-ruby/po/Makefile.am
gettext-tools/examples/hello-rust/po/Makefile.am
gettext-tools/examples/hello-sh/po/Makefile.am
gettext-tools/examples/hello-smalltalk/po/Makefile.am
gettext-tools/examples/hello-tcl-tk/po/Makefile.am
gettext-tools/examples/hello-tcl/po/Makefile.am
gettext-tools/examples/hello-ycp/po/Makefile.am
gettext-tools/examples/po/Makefile.am
gettext-tools/wizard/Makefile.am
gettext-tools/wizard/gettextize.in
gettext-tools/wizard/po-templates/traditional/Makefile.in.in
gettext-tools/wizard/po-templates/traditional/fetch-po [new file with mode: 0755]

diff --git a/NEWS b/NEWS
index 2691f41ee8c0acc53761354d237c179f4dca5b5f..587c3a12976a72fe15060ef106ee7c54ed5be5e3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,10 @@ Version 1.0 - October 2025
     PO files from a translation project's site on the internet, and
     updates the LINGUAS file accordingly.
 
+  * In a po/ directory, a new script 'fetch-po' is now added by 'gettextize'.
+    It provides the standard interface for fetching the translated PO files.
+    It typically either invokes the 'po-fetch' program or does nothing.
+
 # Improvements for translators:
   * msginit:
     - When the PO file already exists, 'msginit' now updates it w.r.t. the
index d86a24e7ab7360fe392d55973996442b318789da..9f683e6b342d8aced1ec7ef29d2c3ac669963ab4 100644 (file)
@@ -369,6 +369,7 @@ The Maintainer's View
 Files You Must Create or Alter
 
 * po/POTFILES.in::              @file{POTFILES.in} in @file{po/}
+* po/fetch-po::                 @file{fetch-po} in @file{po/}
 * po/LINGUAS::                  @file{LINGUAS} in @file{po/}
 * po/Makevars::                 @file{Makevars} in @file{po/}
 * po/Rules-*::                  Extending @file{Makefile} in @file{po/}
@@ -8983,6 +8984,7 @@ using GNU gettext functionality.
 
 @menu
 * po/POTFILES.in::              @file{POTFILES.in} in @file{po/}
+* po/fetch-po::                 @file{fetch-po} in @file{po/}
 * po/LINGUAS::                  @file{LINGUAS} in @file{po/}
 * po/Makevars::                 @file{Makevars} in @file{po/}
 * po/Rules-*::                  Extending @file{Makefile} in @file{po/}
@@ -9035,6 +9037,44 @@ it is recommended to list in @file{po/POTFILES.in} the real source file
 (ending in @file{.l} in the case of @code{flex}, or in @file{.y} in the
 case of @code{bison}), not the generated C file.
 
+@node po/fetch-po
+@subsection @file{fetch-po} in @file{po/}
+@cindex @file{fetch-po} file
+
+The @file{po/} directory should also contain
+an executable shell script named @file{fetch-po}.
+It is supposed to fetch the PO files, produced by translators,
+from a translations project's site on the internet,
+store them in the current directory,
+and generate a @file{LINGUAS} file accordingly.
+(More on that below.)
+
+This script does not take any arguments.
+
+An initial @file{fetch-po} file can be installed by @code{gettextize}.
+But you may need to customize it.
+
+There are two ways of implementing the @file{fetch-po} script:
+@itemize @bullet
+@item
+In packages whose translators commit their PO files
+directly into the version control of the package,
+or where a translations project's daemon does this automatically
+on behalf of the translators,
+this script does not do anything.
+@item
+In packages where the translations are collected by a translation project,
+it uses a @code{po-fetch} invocation.
+See @ref{po-fetch Invocation} for the possible arguments.
+@end itemize
+
+@cindex @code{fetch-po} target
+This script implements the @code{Makefile}'s target @code{fetch-po}.
+
+This script is not contained in distribution tarballs by default,
+because it is part of the maintainer's release management infrastructure
+and because it may, in rare cases, contains secrets (such as API keys).
+
 @node po/LINGUAS
 @subsection @file{LINGUAS} in @file{po/}
 @cindex @file{LINGUAS} file
@@ -9059,6 +9099,9 @@ languages, this should not be done by modifying the @file{LINGUAS} file,
 but rather by using the @code{LINGUAS} environment variable
 (@pxref{Installers}).
 
+In packages where the translations are collected by a translation project,
+this file is generated by the @code{fetch-po} script.
+
 It is recommended that you add the "languages" @samp{en@@quot} and
 @samp{en@@boldquot} to the @code{LINGUAS} file.  @code{en@@quot} is a
 variant of English message catalogs (@code{en}) which uses real quotation
@@ -10015,6 +10058,28 @@ recover the location comments by running @code{msgmerge} again.
 
 @cindex release
 @cindex distribution tarball
+
+First,
+in packages where the translations are collected by a translation project,
+before creating a distribution tarball,
+the maintainer should fetch the PO files from the translators.
+There are two ways to do this: Either
+
+@example
+$ (cd po; ./fetch-po)
+@end example
+
+@noindent
+or
+
+@cindex @code{fetch-po} target
+@example
+$ ./configure
+$ (cd po; make fetch-po)
+$ make distclean
+@end example
+
+Second, updating generated files.
 In projects that use GNU @code{automake}, the usual commands for creating
 a distribution tarball, @samp{make dist} or @samp{make distcheck},
 automatically update the generated files in the @file{po/} directories
@@ -10023,6 +10088,7 @@ as needed.
 If GNU @code{automake} is not used, the maintainer needs to perform this
 update before making a release:
 
+@cindex @code{update-po} target
 @example
 $ ./configure
 $ (cd po; make update-po)
index a405151a0cdc086083a7962194bd22f4e5bec646..9ab8018c4bbfa1e3638742d76d52389317dc34e0 100644 (file)
@@ -175,6 +175,15 @@ SUFFIXES = .po .qm .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 848fd7c5ea56418c6806c19ff2b79206ca6258fe..6735330b7db5f3bcebf7d25e5f8b68e3705a0603 100644 (file)
@@ -178,6 +178,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index ff21c1cd986ce0c2c1e73e248da9ef7db0181364..1a38e897d3f31e454d72d1fa18c894eaec3a152f 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e90ade6860786c28c9325fd91cb5325c75aec50b..76873691a7b7de8df69677e8e1c0cd7963df39b4 100644 (file)
@@ -183,6 +183,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e90ade6860786c28c9325fd91cb5325c75aec50b..76873691a7b7de8df69677e8e1c0cd7963df39b4 100644 (file)
@@ -183,6 +183,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 927f0c921b0161c2878df23fcc6166f8a3aeb50c..223e277e45e43ead64386d54465ca045083b5182 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 5ddb939fbd075e25d2aa4ac1be70a2b7b577476d..ba6c18a90fd35be1b2b783b49d522638279b5ddf 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index f106f8cc7c44a47450708700644a800ad47b75ef..bb0533e8ac8de1ec26bd05ce4b0c40bed68a823f 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 970badb3c70b6a9e4f290a90fe83e757b2cfd882..ea9a8ae469f63a1c243e14627667bd23a5c5ad16 100644 (file)
@@ -175,6 +175,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 9d7264e30c757ddb1c56ac0ca6df57ee1c657ded..96fae19ce06311b9693304becbbfb1abd7e6a37c 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e4b41b36b87108017778ea891819d873e7c1479f..f6c468cc736a6e17868c1e22016e308f99d45fb6 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e4b41b36b87108017778ea891819d873e7c1479f..f6c468cc736a6e17868c1e22016e308f99d45fb6 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e4b41b36b87108017778ea891819d873e7c1479f..f6c468cc736a6e17868c1e22016e308f99d45fb6 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e4b41b36b87108017778ea891819d873e7c1479f..f6c468cc736a6e17868c1e22016e308f99d45fb6 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e31baf86a24513a770854b7d958daf541f38cc5f..5aa2a6f6977f3fbad1467980d5a549da8c385438 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 2d9eb0b88e6b42430bb44b73fbee0dd4c29fb4e9..ceae6c0facc0989bbafa46591b7ffea43959e58b 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index eb9ffa6978f9de6ffca1f0b740017a91062c4b8a..020de2a0d514fe419cb2f9a2c01a986eed009d07 100644 (file)
@@ -91,6 +91,15 @@ CATALOGS = $(STRINGSFILES) $(ENSTRINGSFILES)
 
 .SUFFIXES: .po .gpo .nop .po-create
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index b14be32ef260705eac54b9ff17f7a4bdcc30043c..57e327924d0af46c283fddf16a81f6e2ebc85a09 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index f9d70377eed54a60cb3fecd70a62b5e808ec7a6d..b0cf5c7bcec596383188ed4d662b6a7a9b489a2f 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 7dd4265f185bffc51023450d6aa9380ffa2724e9..0d39184578f8ec7ca6530eef825b72060c783c74 100644 (file)
@@ -182,6 +182,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 32e97bf843ee183aea07daab518a57e74fa0fa3d..e9655d0599597ced420504cb39e195927849a918 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 8afec3d0c8b03ef9de5eb345d0d0e5e2e5e34557..8d55cb12e16b57873f286e705b94bf975f6e61c9 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 1a20e34d9f24a33313a214f8800211f0458ee357..101651202adb63c0d68f4ca1c8620352f9499f32 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index e1e13c25be1a25ec0e97e472ecc4a3d80665be5f..6247dc320cd551de12e04b7411b0f13f5362fe5d 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 0b1e69365c73a53ea3d80495c9e705d104d1a650..f3b13d9b1d3918d2bdd7a47486656f59133d703e 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index f75c386b7a4bcee1716925c004d460fb3f11f228..24922f7687411cd58fa136416827bd5af4db7a16 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 88873929f1fe4dc4f4475f028b4d76f2e2bff25f..1267362230b500a463b936cc28da01d5f06e5467 100644 (file)
@@ -181,6 +181,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 88873929f1fe4dc4f4475f028b4d76f2e2bff25f..1267362230b500a463b936cc28da01d5f06e5467 100644 (file)
@@ -181,6 +181,15 @@ SUFFIXES = .po .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index b14304827b21e8e61b98984fddcdf6bd87d40dbb..29cff54c935e00264fcf6e7d736aedea48ae9821 100644 (file)
@@ -172,6 +172,15 @@ SUFFIXES = .po .gmo .gpo .nop .po-create
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
index 4b18600190460b93d9eb80804dd8bbc5333b7f8d..3eceeccc74c3ab7278f53e3a7bba285084153892 100644 (file)
@@ -199,6 +199,15 @@ SUFFIXES = .po .gpo
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file.
 $(GPOFILES): $(srcdir)/$(DOMAIN).pot
 .po.gpo:
index 90d774487557f8bf52077914319cc8de451e7586..4d462938a46a74834f8bdaf27e9ea3a858e4a59f 100644 (file)
@@ -44,8 +44,10 @@ po_DATA = \
   po-templates/traditional/en@quot.header \
   po-templates/traditional/en@boldquot.header \
   po-templates/traditional/insert-header.sed
+po_SCRIPTS = \
+  po-templates/traditional/fetch-po
 
-EXTRA_DIST += $(po_DATA)
+EXTRA_DIST += $(po_DATA) $(po_SCRIPTS)
 
 
 # We don't install the source code in unpacked form any more.
index 11c31bf9107e61b95edcfb40df53b0093346a9b0..4af6e5bca57b93c06bef81b6f787ea897d19593e 100644 (file)
@@ -757,6 +757,20 @@ You can then remove $podir/Makevars.template.
           please="$please
 Please create $podir/Makevars from the template in $podir/Makevars.template.
 You can then remove $podir/Makevars.template.
+"
+        fi
+        ;;
+      fetch-po)
+        if test -f "$srcdir/$podir/$file"; then
+          # This file may already be customized. Don't overwrite it.
+          :
+        else
+          if $do_changelog; then
+            func_poChangeLog_add_entry "       * $file: New file, from gettext-${version}."
+          fi
+          func_linkorcopy $file "$gettext_datadir/po/$file" "$podir/$file"
+          please="$please
+Please customize $podir/fetch-po, if appropriate.
 "
         fi
         ;;
index 2827d00e31331a5b9763c9ca2cd6b9b2b27a2cb9..747248aeac1f94e76a011d6243ef426322da69ff 100644 (file)
@@ -207,6 +207,15 @@ all: all-@USE_NLS@
 #    source directory."
 # Therefore we put these files in the source directory, not the build directory.
 
+# This target fetches the PO files, produced by translators, from a
+# translations project's site on the internet, and generates the associated
+# LINGUAS file (for packages that use such a translations project and where
+# this translation project does not already commit the PO files and the LINGUAS
+# file into the version control repository of the package automatically).
+.PHONY: fetch-po
+fetch-po:
+       cd $(srcdir) && @SHELL@ ./fetch-po
+
 # This target creates a merged PO file (mostly for debugging purposes).
 .po.gpo:
        @lang=`echo $* | sed -e 's,.*/,,'`; \
diff --git a/gettext-tools/wizard/po-templates/traditional/fetch-po b/gettext-tools/wizard/po-templates/traditional/fetch-po
new file mode 100755 (executable)
index 0000000..1097573
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh
+# Script for fetching the PO files, produced by translators, from a
+# translations project's site on the internet, to the current directory.
+#
+# Copyright (C) 2025 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to use, copy, distribute, and modify it.
+
+# Usage: ./fetch-po
+#
+# This script is invoked from two locations:
+# 1. From the script that fetches auxiliary files that are omitted from
+#    the version control repository of this package, typically called
+#    'autopull.sh' or 'bootstrap --pull' or similar.
+# 2. From the Makefile in the po/ directory, target 'fetch-po'.
+
+# There are two ways to implement this script:
+#
+# In packages whose translators commit their PO files directly into
+# the version control of the package, or where a translations project's
+# daemon does this automatically on behalf of the translators, this
+# script does not do anything.
+echo "fetch-po: Nothing to do."
+#
+# In packages where the translations are collected by a translation project,
+# use a 'po-fetch' invocation.
+# See 'po-fetch --help' for the possible arguments.
+# If you want the fetched PO files to be added into the version control of
+# the package, use the option '--git'; otherwise, don't use this option.
+#po-fetch ...