diff --git a/NEWS b/NEWS index 2691f41ee..587c3a129 100644 --- 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 diff --git a/gettext-tools/doc/gettext.texi b/gettext-tools/doc/gettext.texi index d86a24e7a..9f683e6b3 100644 --- a/gettext-tools/doc/gettext.texi +++ b/gettext-tools/doc/gettext.texi @@ -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) diff --git a/gettext-tools/examples/hello-c++-qt/po/Makefile.am b/gettext-tools/examples/hello-c++-qt/po/Makefile.am index a405151a0..9ab8018c4 100644 --- a/gettext-tools/examples/hello-c++-qt/po/Makefile.am +++ b/gettext-tools/examples/hello-c++-qt/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am b/gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am index 848fd7c5e..6735330b7 100644 --- a/gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am +++ b/gettext-tools/examples/hello-c++-wxwidgets/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-clisp/po/Makefile.am b/gettext-tools/examples/hello-clisp/po/Makefile.am index ff21c1cd9..1a38e897d 100644 --- a/gettext-tools/examples/hello-clisp/po/Makefile.am +++ b/gettext-tools/examples/hello-clisp/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-csharp-forms/po/Makefile.am b/gettext-tools/examples/hello-csharp-forms/po/Makefile.am index e90ade686..76873691a 100644 --- a/gettext-tools/examples/hello-csharp-forms/po/Makefile.am +++ b/gettext-tools/examples/hello-csharp-forms/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-csharp/po/Makefile.am b/gettext-tools/examples/hello-csharp/po/Makefile.am index e90ade686..76873691a 100644 --- a/gettext-tools/examples/hello-csharp/po/Makefile.am +++ b/gettext-tools/examples/hello-csharp/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-d/po/Makefile.am b/gettext-tools/examples/hello-d/po/Makefile.am index 927f0c921..223e277e4 100644 --- a/gettext-tools/examples/hello-d/po/Makefile.am +++ b/gettext-tools/examples/hello-d/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-gawk/po/Makefile.am b/gettext-tools/examples/hello-gawk/po/Makefile.am index 5ddb939fb..ba6c18a90 100644 --- a/gettext-tools/examples/hello-gawk/po/Makefile.am +++ b/gettext-tools/examples/hello-gawk/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-go-http/po/Makefile.am b/gettext-tools/examples/hello-go-http/po/Makefile.am index f106f8cc7..bb0533e8a 100644 --- a/gettext-tools/examples/hello-go-http/po/Makefile.am +++ b/gettext-tools/examples/hello-go-http/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-go/po/Makefile.am b/gettext-tools/examples/hello-go/po/Makefile.am index 970badb3c..ea9a8ae46 100644 --- a/gettext-tools/examples/hello-go/po/Makefile.am +++ b/gettext-tools/examples/hello-go/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-guile/po/Makefile.am b/gettext-tools/examples/hello-guile/po/Makefile.am index 9d7264e30..96fae19ce 100644 --- a/gettext-tools/examples/hello-guile/po/Makefile.am +++ b/gettext-tools/examples/hello-guile/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-java-awt/po/Makefile.am b/gettext-tools/examples/hello-java-awt/po/Makefile.am index e4b41b36b..f6c468cc7 100644 --- a/gettext-tools/examples/hello-java-awt/po/Makefile.am +++ b/gettext-tools/examples/hello-java-awt/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am b/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am index e4b41b36b..f6c468cc7 100644 --- a/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am +++ b/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-java-swing/po/Makefile.am b/gettext-tools/examples/hello-java-swing/po/Makefile.am index e4b41b36b..f6c468cc7 100644 --- a/gettext-tools/examples/hello-java-swing/po/Makefile.am +++ b/gettext-tools/examples/hello-java-swing/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-java/po/Makefile.am b/gettext-tools/examples/hello-java/po/Makefile.am index e4b41b36b..f6c468cc7 100644 --- a/gettext-tools/examples/hello-java/po/Makefile.am +++ b/gettext-tools/examples/hello-java/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-librep/po/Makefile.am b/gettext-tools/examples/hello-librep/po/Makefile.am index e31baf86a..5aa2a6f69 100644 --- a/gettext-tools/examples/hello-librep/po/Makefile.am +++ b/gettext-tools/examples/hello-librep/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-modula2/po/Makefile.am b/gettext-tools/examples/hello-modula2/po/Makefile.am index 2d9eb0b88..ceae6c0fa 100644 --- a/gettext-tools/examples/hello-modula2/po/Makefile.am +++ b/gettext-tools/examples/hello-modula2/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile b/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile index eb9ffa697..020de2a0d 100644 --- a/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile +++ b/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-ocaml/po/Makefile.am b/gettext-tools/examples/hello-ocaml/po/Makefile.am index b14be32ef..57e327924 100644 --- a/gettext-tools/examples/hello-ocaml/po/Makefile.am +++ b/gettext-tools/examples/hello-ocaml/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-pascal/po/Makefile.am b/gettext-tools/examples/hello-pascal/po/Makefile.am index f9d70377e..b0cf5c7bc 100644 --- a/gettext-tools/examples/hello-pascal/po/Makefile.am +++ b/gettext-tools/examples/hello-pascal/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-perl/po/Makefile.am b/gettext-tools/examples/hello-perl/po/Makefile.am index 7dd4265f1..0d3918457 100644 --- a/gettext-tools/examples/hello-perl/po/Makefile.am +++ b/gettext-tools/examples/hello-perl/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-php/po/Makefile.am b/gettext-tools/examples/hello-php/po/Makefile.am index 32e97bf84..e9655d059 100644 --- a/gettext-tools/examples/hello-php/po/Makefile.am +++ b/gettext-tools/examples/hello-php/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-python/po/Makefile.am b/gettext-tools/examples/hello-python/po/Makefile.am index 8afec3d0c..8d55cb12e 100644 --- a/gettext-tools/examples/hello-python/po/Makefile.am +++ b/gettext-tools/examples/hello-python/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-ruby/po/Makefile.am b/gettext-tools/examples/hello-ruby/po/Makefile.am index 1a20e34d9..101651202 100644 --- a/gettext-tools/examples/hello-ruby/po/Makefile.am +++ b/gettext-tools/examples/hello-ruby/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-rust/po/Makefile.am b/gettext-tools/examples/hello-rust/po/Makefile.am index e1e13c25b..6247dc320 100644 --- a/gettext-tools/examples/hello-rust/po/Makefile.am +++ b/gettext-tools/examples/hello-rust/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-sh/po/Makefile.am b/gettext-tools/examples/hello-sh/po/Makefile.am index 0b1e69365..f3b13d9b1 100644 --- a/gettext-tools/examples/hello-sh/po/Makefile.am +++ b/gettext-tools/examples/hello-sh/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-smalltalk/po/Makefile.am b/gettext-tools/examples/hello-smalltalk/po/Makefile.am index f75c386b7..24922f768 100644 --- a/gettext-tools/examples/hello-smalltalk/po/Makefile.am +++ b/gettext-tools/examples/hello-smalltalk/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-tcl-tk/po/Makefile.am b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am index 88873929f..126736223 100644 --- a/gettext-tools/examples/hello-tcl-tk/po/Makefile.am +++ b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-tcl/po/Makefile.am b/gettext-tools/examples/hello-tcl/po/Makefile.am index 88873929f..126736223 100644 --- a/gettext-tools/examples/hello-tcl/po/Makefile.am +++ b/gettext-tools/examples/hello-tcl/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/hello-ycp/po/Makefile.am b/gettext-tools/examples/hello-ycp/po/Makefile.am index b14304827..29cff54c9 100644 --- a/gettext-tools/examples/hello-ycp/po/Makefile.am +++ b/gettext-tools/examples/hello-ycp/po/Makefile.am @@ -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,.*/,,'`; \ diff --git a/gettext-tools/examples/po/Makefile.am b/gettext-tools/examples/po/Makefile.am index 4b1860019..3eceeccc7 100644 --- a/gettext-tools/examples/po/Makefile.am +++ b/gettext-tools/examples/po/Makefile.am @@ -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: diff --git a/gettext-tools/wizard/Makefile.am b/gettext-tools/wizard/Makefile.am index 90d774487..4d462938a 100644 --- a/gettext-tools/wizard/Makefile.am +++ b/gettext-tools/wizard/Makefile.am @@ -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. diff --git a/gettext-tools/wizard/gettextize.in b/gettext-tools/wizard/gettextize.in index 11c31bf91..4af6e5bca 100644 --- a/gettext-tools/wizard/gettextize.in +++ b/gettext-tools/wizard/gettextize.in @@ -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 ;; diff --git a/gettext-tools/wizard/po-templates/traditional/Makefile.in.in b/gettext-tools/wizard/po-templates/traditional/Makefile.in.in index 2827d00e3..747248aea 100644 --- a/gettext-tools/wizard/po-templates/traditional/Makefile.in.in +++ b/gettext-tools/wizard/po-templates/traditional/Makefile.in.in @@ -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 index 000000000..1097573b3 --- /dev/null +++ b/gettext-tools/wizard/po-templates/traditional/fetch-po @@ -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 ...