Hey, On Thu, Mar 07, 2019 at 02:42:45PM +0000, Daniel P. Berrangé wrote: > After investigating in more detail it seems you can provide custom rules > for XML files by setting GETTEXTDATADIR, so I can support mime files with > this extra diff: Ah indeed, nice finding. Seeing what is shipped in https://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-tools/its (gsettings, glade, ... rules), this mime rule could probably go there as well. > > diff --git a/data/Makefile.am b/data/Makefile.am > index 0e50f3d..d4089be 100644 > --- a/data/Makefile.am > +++ b/data/Makefile.am > @@ -4,6 +4,8 @@ MANUFACTURER = Virt Manager Project > > EXTRA_DIST = \ > virt-viewer.wxs.in \ > + gettext/its/mime.its \ > + gettext/its/mime.loc \ > $(NULL) > > # this make sure those files are regenerated when they change > @@ -71,8 +73,11 @@ desktop_DATA = $(DESKTOPFILES:.desktop.in=.desktop) > %.desktop: %.desktop.in > $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ > > +MIMEFILES = virt-viewer-mime.xml.in > mimedir = $(datadir)/mime/packages > mime_DATA = virt-viewer-mime.xml > +%-mime.xml: %-mime.xml.in > + $(AM_V_GEN)GETTEXTDATADIR=$(srcdir)/gettext $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ Something I just noticed (but which is related to the initial patch rather than this one) is that the .xml.in -> .xml rule is no longer triggered when one of the .po file changes (same for the .desktop file). I tried adding $(wildcard $(top_srcdir)/po/*.po) as a dependency, and as far as I can tell, this is giving the behaviour I want. A similar change is needed in po/Makefile.am in the call to xgettext, and virt-viewer-mime.xml.in needs to be listed in POTFILES, with these changes I can now translate the mime file! Thanks, Christophe
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list