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

2018-05-03 Thread Daniel P . Berrangé
On Thu, May 03, 2018 at 02:19:27PM +0200, Martin Kletzander wrote:
> 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é 
> > ---
> > .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 12 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/configure.ac b/configure.ac
> > index ae798faa54..0aecf68c38 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -732,33 +734,7 @@ if test "$enable_test_locking" = "yes"; then
> > fi
> > AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"])
> > 
> > -dnl Check for gettext - don't go any newer than what RHEL 5 supports
> > -dnl
> > -dnl save and restore CPPFLAGS around gettext check as the internal iconv
> > -dnl check might leave -I/usr/local/include in CPPFLAGS on FreeBSD resulting
> > -dnl in the build picking up previously installed libvirt/libvirt.h instead
> > -dnl of the correct one from the source tree.
> > -dnl compute the difference between save_CPPFLAGS and CPPFLAGS and append it
> > -dnl to INCLUDES in order to preserve changes made by gettext but in a place
> > -dnl that does not break the build
> > -save_CPPFLAGS="$CPPFLAGS"
> > -AM_GNU_GETTEXT_VERSION([0.17])
> > -AM_GNU_GETTEXT([external])
> > -GETTEXT_CPPFLAGS=
> > -if test "x$save_CPPFLAGS" != "x$CPPFLAGS"; then
> > - set dummy $CPPFLAGS; shift
> > - for var
> > - do
> > -   case " $var " in
> > - " $save_CPPFLAGS ") ;;
> > - *) GETTEXT_CPPFLAGS="$GETTEXT_CPPFLAGS $var" ;;
> > -   esac
> > - done
> > -fi
> > -CPPFLAGS="$save_CPPFLAGS"
> > -AC_SUBST([GETTEXT_CPPFLAGS])
> > -
> > -ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'`
> > +LIBVIRT_GETTEXT
> > 
> 
> This is defined nowhere and each configure now gives me anthe following error:
> 
>  ./configure: line 75099: LIBVIRT_GETTEXT: command not found
> 
> It does not fail the configure, however, so the build continues and that's
> probably why nobody noticed.  I'm not sure what this was supposed to do, but 
> I'm
> not sure if we just want to remove it, so that's why I'm replying here.

Oh that's left over cruft. I changed to LIBVIRT_CHECK_NLS in the end

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

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

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

2018-05-03 Thread Martin Kletzander

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é 
---
.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 12 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/configure.ac b/configure.ac
index ae798faa54..0aecf68c38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -732,33 +734,7 @@ if test "$enable_test_locking" = "yes"; then
fi
AM_CONDITIONAL([WITH_CIL],[test "$enable_test_locking" = "yes"])

-dnl Check for gettext - don't go any newer than what RHEL 5 supports
-dnl
-dnl save and restore CPPFLAGS around gettext check as the internal iconv
-dnl check might leave -I/usr/local/include in CPPFLAGS on FreeBSD resulting
-dnl in the build picking up previously installed libvirt/libvirt.h instead
-dnl of the correct one from the source tree.
-dnl compute the difference between save_CPPFLAGS and CPPFLAGS and append it
-dnl to INCLUDES in order to preserve changes made by gettext but in a place
-dnl that does not break the build
-save_CPPFLAGS="$CPPFLAGS"
-AM_GNU_GETTEXT_VERSION([0.17])
-AM_GNU_GETTEXT([external])
-GETTEXT_CPPFLAGS=
-if test "x$save_CPPFLAGS" != "x$CPPFLAGS"; then
- set dummy $CPPFLAGS; shift
- for var
- do
-   case " $var " in
- " $save_CPPFLAGS ") ;;
- *) GETTEXT_CPPFLAGS="$GETTEXT_CPPFLAGS $var" ;;
-   esac
- done
-fi
-CPPFLAGS="$save_CPPFLAGS"
-AC_SUBST([GETTEXT_CPPFLAGS])
-
-ALL_LINGUAS=`cd "$srcdir/po" > /dev/null && ls *.po | sed 's+\.po$++'`
+LIBVIRT_GETTEXT



This is defined nowhere and each configure now gives me anthe following error:

 ./configure: line 75099: LIBVIRT_GETTEXT: command not found

It does not fail the configure, however, so the build continues and that's
probably why nobody noticed.  I'm not sure what this was supposed to do, but I'm
not sure if we just want to remove it, so that's why I'm replying here.

Martin

signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2018-04-19 Thread Ján Tomko

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é 
---
.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 12 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 00..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 00..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 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list