gparted/po/Makevars

79 lines
3.3 KiB
Text
Raw Normal View History

Migrate build from intltool to gettext translation (!107) [0] GNOME Goal: Gettext Migration https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration This goal from 2016 is to migrate away from using intltool to help translate especially GNOME application related files, and instead use gettext directly now that gettext can handle a lot more file formats [1][2][3]. The GNOME Goal: Gettext Migration [0] says: "With gettext 0.19.8, there is really no need anymore to use intltool or GLib's dated gettext glue (AM_GLIB_GNU_GETTEXT and glib-gettextize)." This version or later of gettext is available in the oldest supported distributions except for SLES 12: Distribution EOL gettext -V Debian 10 2022-Aug 0.19.8.1 RHEL / CentOS 7 2024-Jun 0.19.8.1 Ubuntu 18.04 LTS 2023-Apr 0.19.8.1 SLES 12 SP5 2024-Oct 0.19.2 [4][5] As SLES 12 SP5 doesn't contain GParted and SLES 15 contains GParted 0.31.0 [6] loosing the ability to compile future GParted 1.5 release on SLES 12 SP5 is acceptable. Additionally the use of intltool and the associated GLib provided macro AM_GLIB_GNU_GETTEXT was the source of the remaining warnings from autoconf 2.71 seen in Fedora 36 and Ubuntu 22.04 LTS about the use of obsolete macros: $ ./autogen.sh ... autoreconf: running: /usr/bin/autoconf --force configure.ac:59: warning: The macro `GLIB_GNU_GETTEXT' is obsolete. configure.ac:59: You should run autoupdate. aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from... lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from... lib/m4sugar/m4sh.m4:699: AS_IF is expanded from... ./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from... ./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from... aclocal.m4:111: GLIB_LC_MESSAGES is expanded from... aclocal.m4:426: GLIB_GNU_GETTEXT is expanded from... >> aclocal.m4:526: AM_GLIB_GNU_GETTEXT is expanded from... >> configure.ac:59: the top level configure.ac:59: warning: The macro `AC_TRY_LINK' is obsolete. configure.ac:59: You should run autoupdate. ... Note that use of AM_GLIB_GNU_GETTEXT was deprecated in GLib 2.47.5 released 2016-01-18 [7]. Newer versions of GLib are included in the oldest supported distributions: Distro Package containing Version glib-gettext.m4 Debian 10 libglib2.0-dev-bin 2.58.3 RHEL / CentOS 7 glib2-devel 2.56.1 Ubuntu 18.04 LTS libglib2.0-dev-bin 2.56.4 SLES 12 SP5 glib2-devel 2.48.2 Therefore perform the migration described in the GNOME wiki documents [0][1]. This involves: 1. Replacing the macros used in configure.ac; 2. Copying Makevars.template to po/Makevars and setting PO_DEPENDS_ON_POT and DIST_DEPENDS_ON_UPDATE_PO to "no"; 3. Replace @INTLTOOL_*@ macros in Makefile.am with rules to use gettext to directly translate the relevent GNOME application files; 4. Removing (_) underscore marking translation prefixes from XML tags in GNOME application files as gettext understands which tags of which files need translating. For reference are these commits in projects GNOME-System-Monitor [8], Reversi [9] and Evince [10] making the same transition. At this point "./autogen.sh && make" succeeds, at least on Ubuntu which provides the instructions gettext needs to correctly translate .policy files by default. These: /usr/share/gettext/its/polkit.its /usr/share/gettext/its/polkit.loc are included in the base policykit-1 package. [1] Migrating from Intltool to Gettext https://wiki.gnome.org/MigratingFromIntltoolToGettext [2] Using Modern Gettext https://blogs.gnome.org/mclasen/2016/07/21/using-modern-gettext/ [3] On the killing of intltool https://blogs.gnome.org/mcatanzaro/2016/07/27/on-the-killing-of-intltool/ [4] SUSE package search, SLES 12 SP5, gettext https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=12.5&arch=x86_64&query=gettext&module= [5] SUSE Long Term Service Pack Support https://links.imagerelay.com/cdn/3404/ql/f3a083e9bcd34c76addd096d7f60ec00/long_term_service_pack_support_flyer.pdf [6] SUSE package search, SLES 15, gparted https://scc.suse.com/packages?name=SUSE%20Linux%20Enterprise%20Server&version=15&arch=x86_64&query=gparted&module= [7] Deprecate GLIB_GNU_GETTEXT macro, use upstream gettext instead https://gitlab.gnome.org/GNOME/glib/-/commit/6b577196eed0754d2805fd48caa64f58f9bb8ee4 [8] [GNOME-System-Monitor] Migrate from intltool https://gitlab.gnome.org/GNOME/gnome-system-monitor/-/commit/9185b9c713980391a6f1a2377eb5ea249a0df182 [9] [Reversi] Gettext migration (bgo#793040) https://gitlab.gnome.org/GNOME/iagno/-/commit/d22f560ac80d0ded2cb3a38cb10a65e17ead3850 [10] [Evince] build: Migrate from Intltool to Gettext https://gitlab.gnome.org/GNOME/evince/-/commit/4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac Closes !107 - Migrate from intltool to gettext translation
2022-08-26 11:05:18 +00:00
# Makefile variables for PO directory in any package using GNU gettext.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Free Software Foundation, Inc.
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU =
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS =
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS =
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = no
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = no