Re: [PATCH 1/5] po: provide custom make rules for po file management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 12, 2018 at 02:28:18PM +0100, Daniel P. Berrangé wrote:
Historically we have relied on autopoint/gettextize to install a
standard po/Makefile.in.in. There is very limited scope for customizing
this and it also causes a bunch of extra stuff to be pulled into
configure.ac which potentially clashes with gnulib. Writing make rules
for po file management is no more difficult than any other rules libvirt
has, so stop using autopoint/gettextize.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
.gitignore                   |  6 +--
ABOUT-NLS                    |  1 +
autogen.sh                   |  3 +-
bootstrap.conf               | 38 -----------------
configure.ac                 | 33 +++------------
m4/virt-nls.m4               | 70 ++++++++++++++++++++++++++++++++
po/Makefile.am               | 97 ++++++++++++++++++++++++++++++++++++++++++++
po/{POTFILES.in => POTFILES} |  0
po/README.md                 | 36 ++++++++++++++++
src/internal.h               | 16 ++++----
src/libvirt-admin.c          |  2 +
src/libvirt.c                |  2 +
src/util/virgettext.c        |  3 +-
tools/virt-host-validate.c   |  4 +-
14 files changed, 228 insertions(+), 83 deletions(-)
create mode 120000 ABOUT-NLS
create mode 100644 m4/virt-nls.m4
create mode 100644 po/Makefile.am
rename po/{POTFILES.in => POTFILES} (100%)
create mode 100644 po/README.md

diff --git a/m4/virt-nls.m4 b/m4/virt-nls.m4
new file mode 100644
index 0000000000..d258d39506
--- /dev/null
+++ b/m4/virt-nls.m4
@@ -0,0 +1,70 @@

[...]

+
+  dnl GNU gettext tools (optional).
+  AC_CHECK_PROG([XGETTEXT],[xgettext],[xgettext],[no])
+  AC_CHECK_PROG([MSGFMT],[msgfmt],[msgfmt],[no])
+  AC_CHECK_PROG([MSGMERGE],[msgmerge],[msgmerge],[no])

These lines feel crowded with no spaces after commas.

+
+  dnl Check they are the GNU gettext tools.
+  AC_MSG_CHECKING([msgfmt is GNU tool])
+  if $MSGFMT --version >/dev/null 2>&1 && $MSGFMT --version | grep -q 'GNU gettext'; then
+    msgfmt_is_gnu=yes
+  else
+    msgfmt_is_gnu=no
+  fi
+  AC_MSG_RESULT([$msgfmt_is_gnu])
+  AM_CONDITIONAL([HAVE_GNU_GETTEXT_TOOLS],
+    [test "x$XGETTEXT" != "xno" && test "x$MSGFMT" != "xno" && test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"])

Can this long line be split?

+])
+

diff --git a/po/README.md b/po/README.md
new file mode 100644
index 0000000000..e46455e0c0
--- /dev/null
+++ b/po/README.md
@@ -0,0 +1,36 @@
+Libvirt Message Translation
+===========================
+
+Libvirt translatable messages are maintained using the GNU Gettext tools and
+file formats, in combination with the Zanata web service.
+
+Source repository
+=================
+
+The libvirt GIT repository stores the master "libvirt.pot" file and full "po"
+files for translations. The master "libvirt.pot" file can be re-generated using
+
+   make libvirt.pot
+
+The full po files can have their source locations and msgids updated using
+
+   make update-po
+
+Normally these updates are only done when either refreshing translations from
+Zanata, or when creating a new release.
+
+Zanata web service
+==================
+
+The translation of libvirt messages has been outsourced to the Fedora
+translation team using the Zanata web service:
+
+  https://fedora.zanata.org/project/view/libvirt
+
+As such, changes to translations will generally NOT be accepted as patches
+directly to libvirt GIT. Any changes made to "$LANG.mini.po" files in libvirt
+GIT will be overwritten & lost the next time content is imported from Zanata.

s/&/and/

+
+The master "libvirt.pot" file is periodically pushed to Zanata to provide the
+translation team with content changes. New translated text is then periodically
+pulled down from Zanata to update the po files.

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux