Codebase list virt-viewer / 8089cdd
po: provide custom make rules for po file management Historically we have relied on intltool to install a standard po/Makefile.in.in which has very limited scope for customization. intltool is deprecated in favour of standard gettextize tools, but these share the same disadvantages. Writing make rules for po file management is no more difficult than any other rules virt-viewer has, so stop using intltool and don't use gettextize ether. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Daniel P. Berrangé 5 years ago
15 changed file(s) with 250 addition(s) and 51 deletion(s). Raw diff Collapse all Expand all
77 EXTRA_DIST = \
88 $(PACKAGE).spec $(PACKAGE).spec.in \
99 mingw-$(PACKAGE).spec.in \
10 intltool-extract.in \
11 intltool-merge.in \
12 intltool-update.in \
1310 GNUmakefile \
1411 maint.mk \
1512 cfg.mk \
2320 DISTCLEAN_FILES = \
2421 $(PACKAGE).spec \
2522 mingw-$(PACKAGE).spec \
26 intltool-extract \
27 intltool-merge \
28 intltool-update \
2923 $(NULL)
3024
3125 MAINTAINERCLEANFILES = \
3327 $(srcdir)/INSTALL \
3428 $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
3529 $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
36 $(srcdir)/m4/intltool.m4 \
3730 $(NULL)
3831
3932 dist-hook: gen-ChangeLog gen-AUTHORS
2828
2929 mkdir -p m4
3030 autoreconf -vfi
31 intltoolize --force
3231
3332 cd $THEDIR
3433
9595 AC_SUBST(GETTEXT_PACKAGE)
9696 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [GETTEXT package name])
9797
98 AM_GLIB_GNU_GETTEXT
99 IT_PROG_INTLTOOL([0.35.0])
98 VIRT_VIEWER_ARG_NLS
99 VIRT_VIEWER_CHECK_NLS
100100
101101 PKG_PROG_PKG_CONFIG
102102 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
260260 icons/256x256/Makefile
261261 man/Makefile
262262 mingw-virt-viewer.spec
263 po/Makefile.in
263 po/Makefile
264264 src/Makefile
265265 src/virt-viewer.rc
266266 tests/Makefile
33
44 EXTRA_DIST = \
55 virt-viewer.wxs.in \
6 gettext/its/mime.its \
7 gettext/its/mime.loc \
68 $(NULL)
9
10 PO_FILES = $(wildcard $(srcdir)/../po/*.po)
711
812 # this make sure those files are regenerated when they change
913 # (in maintainer-mode)
6771 desktopdir = $(datadir)/applications
6872 DESKTOPFILES = remote-viewer.desktop.in
6973 desktop_DATA = $(DESKTOPFILES:.desktop.in=.desktop)
70 @INTLTOOL_DESKTOP_RULE@
74 %.desktop: %.desktop.in $(PO_FILES)
75 $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
7176
7277 MIMEFILES = virt-viewer-mime.xml.in
7378 mimedir = $(datadir)/mime/packages
7479 mime_DATA = virt-viewer-mime.xml
75 @INTLTOOL_XML_RULE@
80 %-mime.xml: %-mime.xml.in $(PO_FILES)
81 $(AM_V_GEN)GETTEXTDATADIR=$(srcdir)/gettext $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
7682
7783 appdatadir = $(datadir)/appdata
7884 APPDATAFILES = remote-viewer.appdata.xml.in
7985 appdata_DATA = $(APPDATAFILES:.xml.in=.xml)
80 @INTLTOOL_XML_RULE@
86 %.appdata.xml: %.appdata.xml.in $(PO_FILES)
87 $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
8188
8289 install-data-hook:
8390 if ENABLE_UPDATE_MIMEDB
0 <?xml version="1.0"?>
1 <its:rules xmlns:its="http://www.w3.org/2005/11/its"
2 version="2.0">
3 <its:translateRule selector="/mime-info" translate="no"/>
4 <its:translateRule selector="//comment" translate="yes"/>
5 </its:rules>
0 <?xml version="1.0"?>
1 <locatingRules>
2 <locatingRule name="mime" pattern="*.xml">
3 <documentRule localName="mime-info" target="mime.its"/>
4 </locatingRule>
5 </locatingRules>
00 <?xml version="1.0" encoding="UTF-8"?>
1 <application>
1 <component type="desktop">
22 <id type="desktop">remote-viewer.desktop</id>
33 <metadata_license>CC0-1.0</metadata_license>
44 <project_license>GPL-2.0+</project_license>
5 <_name>Remote Viewer</_name>
6 <_summary>Remotely access virtual machines</_summary>
5 <name>Remote Viewer</name>
6 <summary>Remotely access virtual machines</summary>
77 <description>
8 <_p>
8 <p>
99 Remote Viewer provides a graphical viewer for the guest OS
1010 display. At this time it supports guest OS using the VNC
1111 or SPICE protocols. Further protocols may be supported in
1212 the future as user demand dictates. The viewer can connect
1313 directly to both local and remotely hosted guest OS, optionally
1414 using SSL/TLS encryption.
15 </_p>
15 </p>
1616 </description>
1717 <screenshots>
1818 <screenshot type="default">https://virt-manager.org/appdata/en_US/virt-viewer/general.png</screenshot>
2525 </provides>
2626 <url type="homepage">https://virt-manager.org/</url>
2727 <updatecontact>virt-tools-list_at_redhat.com</updatecontact>
28 </application>
28 </component>
00 [Desktop Entry]
1 _Name=Remote Viewer
2 _Comment=Access remote desktops
1 Name=Remote Viewer
2 Comment=Access remote desktops
33 Exec=remote-viewer %u
44 Type=Application
55 Terminal=false
0 dnl gettext utilities
1 dnl
2 dnl Copyright (C) 2018 Red Hat, Inc.
3 dnl
4 dnl This library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU Lesser General Public
6 dnl License as published by the Free Software Foundation; either
7 dnl version 2.1 of the License, or (at your option) any later version.
8 dnl
9 dnl This library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl Lesser General Public License for more details.
13 dnl
14 dnl You should have received a copy of the GNU Lesser General Public
15 dnl License along with this library. If not, see
16 dnl <http://www.gnu.org/licenses/>.
17 dnl
18
19 AC_DEFUN([VIRT_VIEWER_ARG_NLS],[
20 m4_divert_text([DEFAULTS], [[enable_nls=yes]])
21 AC_ARG_ENABLE([nls],
22 [AS_HELP_STRING([--enable-nls],
23 [NLS @<:@default=yes@:>@])])
24 ])
25
26 AC_DEFUN([VIRT_VIEWER_CHECK_NLS],[
27 dnl GNU gettext tools (optional).
28 AC_CHECK_PROG([XGETTEXT], [xgettext], [xgettext], [no])
29 AC_CHECK_PROG([MSGFMT], [msgfmt], [msgfmt], [no])
30 AC_CHECK_PROG([MSGMERGE], [msgmerge], [msgmerge], [no])
31
32 dnl Check they are the GNU gettext tools.
33 AC_MSG_CHECKING([msgfmt is GNU tool])
34 if $MSGFMT --version >/dev/null 2>&1 && $MSGFMT --version | grep -q 'GNU gettext'; then
35 msgfmt_is_gnu=yes
36 else
37 msgfmt_is_gnu=no
38 fi
39 AC_MSG_RESULT([$msgfmt_is_gnu])
40 AM_CONDITIONAL([ENABLE_NLS], [test "x$enable_nls" = "xyes"])
41 AM_CONDITIONAL([HAVE_GNU_GETTEXT_TOOLS],
42 [test "x$XGETTEXT" != "xno" && test "x$MSGFMT" != "xno" && \
43 test "x$MSGMERGE" != "xno" && test "x$msgfmt_is_gnu" != "xno"])
44 ])
5858 BuildRequires: mingw64-usbredir
5959 BuildRequires: pkgconfig
6060 BuildRequires: /usr/bin/pod2man
61 BuildRequires: intltool
61 BuildRequires: gettext
6262 BuildRequires: icoutils
6363 BuildRequires: dos2unix
6464 BuildRequires: hwdata
0 DOMAIN = $(PACKAGE_NAME)
1 COPYRIGHT_HOLDER = The Virt Viewer authors
2 MSGID_BUGS_ADDRESS = https://virt-manager.org/bugs/
3
4 MAINTAINERCLEANFILES = $(GMOFILES) $(POTFILE)
5
6 LANGS := \
7 af am anp ar as ast bal be bg \
8 bn_IN bn bo br brx bs ca cs cy da \
9 de_CH de el en_GB eo es et eu fa fi \
10 fr gl gu he hi hr hu ia \
11 id ilo is it ja ka kk km kn ko \
12 kw_GB kw@kkcor kw kw@uccor ky lt lv mai mk ml \
13 mn mr ms nb nds ne nl nn nso \
14 or pa pl pt_BR pt ro ru si sk sl \
15 sq sr@latin sr sv ta te tg th tr tw \
16 uk ur vi wba yo zh_CN zh_HK zh_TW zu
17
18
19 POTFILE_DEPS := $(shell $(SED) 's,^,$(top_srcdir)/,' $(srcdir)/POTFILES)
20 POTFILE := $(srcdir)/$(DOMAIN).pot
21 POFILES := $(LANGS:%=$(srcdir)/%.po)
22 GMOFILES := $(LANGS:%=$(srcdir)/%.gmo)
23
24 EXTRA_DIST = \
25 POTFILES \
26 $(POTFILE) \
27 $(POFILES) \
28 $(GMOFILES)
29
30 if HAVE_GNU_GETTEXT_TOOLS
31
32 XGETTEXT_ARGS = \
33 --default-domain=$(DOMAIN) \
34 --from-code=utf-8 \
35 --add-comments=TRANSLATORS: \
36 --keyword=_ --keyword=N_ \
37 --copyright-holder='$(COPYRIGHT_HOLDER)' \
38 --package-name="$(PACKAGE_NAME)" \
39 --package-version="$(PACKAGE_VERSION)" \
40 --msgid-bugs-address="$(MSGID_BUGS_ADDRESS)" \
41 --directory=$(top_srcdir) \
42 $(NULL)
43
44 SED_PO_FIXUP_ARGS = \
45 -e "s|text/plain; charset=CHARSET|text/plain; charset=UTF-8|g" \
46 -e "s|SOME DESCRIPTIVE TITLE|Virt Viewer package strings|g" \
47 -e "s|Copyright (C) YEAR|Copyright (C) $$(date +'%Y')|" \
48 $(NULL)
49
50
51 # Although they're in EXTRA_DIST, we still need to
52 # copy these again, because update-gmo will change
53
54 # their content, and dist-hook runs after the
55 # things in EXTRA_DIST are copied.
56 dist-hook: $(GMOFILES)
57 cp -f $(POTFILE) $(distdir)/
58 cp -f $(POFILES) $(distdir)/
59 cp -f $(GMOFILES) $(distdir)/
60
61 update-po: $(POFILES)
62
63 update-gmo: $(GMOFILES)
64
65 $(POTFILE): POTFILES $(POTFILE_DEPS)
66 $(XGETTEXT) -o $@-t $(XGETTEXT_ARGS) \
67 --files-from=$(abs_srcdir)/POTFILES
68 $(SED) $(SED_PO_FIXUP_ARGS) < $@-t > $@
69 rm -f $@-t
70
71 $(srcdir)/%.po: $(POTFILE)
72 $(MSGMERGE) --backup=off --no-fuzzy-matching --update $@ $(POTFILE)
73
74 $(srcdir)/%.gmo: $(srcdir)/%.po
75 rm -f $@ $@-t
76 $(MSGFMT) -c -o $@-t $<
77 mv $@-t $@
78
79 .PRECIOUS: $(POTFILE) $(POFILES)
80
81 endif HAVE_GNU_GETTEXT_TOOLS
82
83 if ENABLE_NLS
84
85 # Cannot use 'localedir' since this conflicts with autoconf.
86 langinstdir = $(datadir)/locale
87
88 install-data-hook: $(GMOFILES)
89 mkdir -p $(DESTDIR)$(langinstdir)
90 for lang in $(LANGS); do \
91 d=$(DESTDIR)$(langinstdir)/$$lang/LC_MESSAGES; \
92 mkdir -p $$d; \
93 install -m 0644 $(srcdir)/$$lang.gmo $$d/$(DOMAIN).mo; \
94 done
95
96 uninstall-hook:
97 for lang in $(LANGS); do \
98 d=$(DESTDIR)$(langinstdir)/$$lang/LC_MESSAGES; \
99 rm -f $$d/$(DOMAIN).mo; \
100 done
101
102 endif ENABLE_NLS
103
104 -include $(top_srcdir)/git.mk
0 data/remote-viewer.appdata.xml.in
1 data/remote-viewer.desktop.in
2 data/virt-viewer-mime.xml.in
3 src/remote-viewer-iso-list-dialog.c
4 src/remote-viewer-main.c
5 src/remote-viewer.c
6 src/resources/ui/remote-viewer-connect.ui
7 src/resources/ui/remote-viewer-iso-list.ui
8 src/resources/ui/virt-viewer-about.ui
9 src/virt-viewer-app.c
10 src/virt-viewer-auth.c
11 src/resources/ui/virt-viewer-auth.ui
12 src/virt-viewer-display-vnc.c
13 src/virt-viewer-display-vte.c
14 src/virt-viewer-file-transfer-dialog.c
15 src/virt-viewer-main.c
16 src/virt-viewer-session-spice.c
17 src/virt-viewer-session-vnc.c
18 src/virt-viewer-vm-connection.c
19 src/virt-viewer-window.c
20 src/virt-viewer-file.c
21 src/virt-viewer.c
22 src/resources/ui/virt-viewer.ui
23 src/resources/ui/virt-viewer-guest-details.ui
24 src/resources/ui/virt-viewer-vm-connection.ui
25 src/resources/ui/virt-viewer-preferences.ui
26 src/resources/ui/virt-viewer-file-transfer-dialog.ui
+0
-27
po/POTFILES.in less more
0 data/remote-viewer.appdata.xml.in
1 data/remote-viewer.desktop.in
2 data/virt-viewer-mime.xml.in
3 src/remote-viewer-iso-list-dialog.c
4 src/remote-viewer-main.c
5 src/remote-viewer.c
6 [type: gettext/glade] src/resources/ui/remote-viewer-connect.ui
7 [type: gettext/glade] src/resources/ui/remote-viewer-iso-list.ui
8 [type: gettext/glade] src/resources/ui/virt-viewer-about.ui
9 src/virt-viewer-app.c
10 src/virt-viewer-auth.c
11 [type: gettext/glade] src/resources/ui/virt-viewer-auth.ui
12 src/virt-viewer-display-vnc.c
13 src/virt-viewer-display-vte.c
14 src/virt-viewer-file-transfer-dialog.c
15 src/virt-viewer-main.c
16 src/virt-viewer-session-spice.c
17 src/virt-viewer-session-vnc.c
18 src/virt-viewer-vm-connection.c
19 src/virt-viewer-window.c
20 src/virt-viewer-file.c
21 src/virt-viewer.c
22 [type: gettext/glade] src/resources/ui/virt-viewer.ui
23 [type: gettext/glade] src/resources/ui/virt-viewer-guest-details.ui
24 [type: gettext/glade] src/resources/ui/virt-viewer-vm-connection.ui
25 [type: gettext/glade] src/resources/ui/virt-viewer-preferences.ui
26 [type: gettext/glade] src/resources/ui/virt-viewer-file-transfer-dialog.ui
0 Virt-Viewer Message Translation
1 ===========================
2
3 Virt-Viewer translatable messages are maintained using the GNU Gettext tools
4 and file formats, in combination with the Zanata web service.
5
6 Source repository
7 =================
8
9 The virt-viewer GIT repository stores the master "virt-viewer.pot" file and
10 full "po" files for translations. The master "virt-viewer.pot" file can be
11 re-generated using
12
13 make virt-viewer.pot
14
15 The full po files can have their source locations and msgids updated using
16
17 make update-po
18
19 Normally these updates are only done when either refreshing translations from
20 Zanata, or when creating a new release.
21
22 Zanata web service
23 ==================
24
25 The translation of virt-viewer messages has been outsourced to the Fedora
26 translation team using the Zanata web service:
27
28 https://fedora.zanata.org/project/view/virt-viewer
29
30 As such, changes to translations will generally NOT be accepted as patches
31 directly to virt-viewer GIT. Any changes made to "$LANG.mini.po" files in
32 virt-viewer GIT will be overwritten and lost the next time content is imported
33 from Zanata.
34
35 The master "virt-viewer.pot" file is periodically pushed to Zanata to provide
36 the translation team with content changes. New translated text is then
37 periodically pulled down from Zanata to update the po files.
4646 BuildRequires: pkgconfig(spice-protocol) >= @SPICE_PROTOCOL_REQUIRED@
4747 %endif
4848 BuildRequires: /usr/bin/pod2man
49 BuildRequires: intltool
49 BuildRequires: gettext
5050 %if %{with_govirt}
5151 BuildRequires: pkgconfig(govirt-1.0) >= @GOVIRT_REQUIRED@
5252 %endif