Skip to content

Commit e653c1a

Browse files
committed
build: Migrate from Intltool to Gettext
Recent versions of Gettext are able to translate several formats without using Intltool tools. The build system has been migrated from Intltool to Gettext.
1 parent 702b37d commit e653c1a

9 files changed

Lines changed: 119 additions & 42 deletions

File tree

Makefile.am

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBDIRS=po
1+
SUBDIRS=. po
22

33
EXPORT_MODULES= \
44
cupshelpers/__init__.py \
@@ -228,14 +228,18 @@ nodist_dbusservices_DATA = \
228228
dbus/org.fedoraproject.Config.Printing.service
229229
dbusservicesdir = $(datadir)/dbus-1/services/
230230

231-
@INTLTOOL_DESKTOP_RULE@
232-
233231
desktop_DATA =\
234232
system-config-printer.desktop \
235233
print-applet.desktop
236234
desktopdir = $(datadir)/applications/
237235
autostartdir = $(sysconfdir)/xdg/autostart/
238236

237+
system-config-printer.desktop: system-config-printer.desktop.in
238+
$(AM_V_GEN)$(MSGFMT) --desktop --keyword=Name --keyword=GenericName --keyword=Comment --keyword=X-GNOME-FullName --template $< -d $(top_srcdir)/po -o $@
239+
240+
print-applet.desktop: print-applet.desktop.in
241+
$(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
242+
239243
DESKTOP_VENDOR=@DESKTOPVENDOR@
240244
DESKTOP_PREFIX=@DESKTOPPREFIX@
241245

@@ -263,12 +267,13 @@ uninstall-desktopDATA:
263267

264268
desktop_in_files = $(desktop_DATA:.desktop=.desktop.in)
265269

266-
@INTLTOOL_XML_RULE@
267-
268270
appdatadir = $(datadir)/metainfo
269271
appdata_in_files = system-config-printer.appdata.xml.in
270272
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
271273

274+
system-config-printer.appdata.xml: system-config-printer.appdata.xml.in
275+
$(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
276+
272277
EXTRA_DIST=\
273278
$(nobase_pkgdata_SCRIPTS) \
274279
$(nobase_pkgdata_DATA) \
@@ -284,9 +289,6 @@ EXTRA_DIST=\
284289
ChangeLog-OLD \
285290
README \
286291
$(desktop_in_files) \
287-
intltool-extract.in \
288-
intltool-merge.in \
289-
intltool-update.in \
290292
config.py.in \
291293
cupshelpers/config.py.in \
292294
profile-ppds.py \
@@ -320,8 +322,7 @@ update-po: missing-languages
320322

321323
missing-languages:
322324
bash -c '\
323-
eval $$(grep ALL_LINGUAS configure.ac); \
324-
diff -u <(echo $$ALL_LINGUAS | xargs -rn1 echo) \
325+
diff -u <(cat po/LINGUAS) \
325326
<(cd po; ls -1 *.po | sed -e "s,\.po$$,,")'
326327

327328
missing-imports:
@@ -385,11 +386,11 @@ TESTS = test-xml-validity.sh py.test.sh
385386

386387
CLEANFILES= \
387388
$(systemd_CLEANFILES) \
389+
$(desktop_DATA) \
388390
$(appdata_DATA)
389391

390392
DISTCLEANFILES=*.pyc *.pyo *~ *.bak \
391393
troubleshoot/*.pyc troubleshoot/*.pyo troubleshoot/*~ \
392-
intltool-extract intltool-merge intltool-update \
393394
*.desktop man/*.1 \
394395
test-ppd-module.sh test-xml-validity.sh py.test.sh pickled-ppds \
395396
config.py cupshelpers/config.py zanata.xml \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Build requirements:
1717
- systemd
1818
- tools:
1919
- autoconf
20+
- autoconf-archives
2021
- automake
2122
- desktop-file-install
2223
- intltool

bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
intltoolize --force --copy
2+
autopoint --force
33
aclocal
44
automake --foreign --copy --add-missing
55
autoconf

configure.ac

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
AC_INIT(system-config-printer, 1.5.15)
22
AC_CONFIG_SRCDIR(system-config-printer.py)
33
AM_INIT_AUTOMAKE([dist-xz dist-bzip2 subdir-objects 1.6])
4-
IT_PROG_INTLTOOL
5-
AM_GNU_GETTEXT_VERSION([0.18.3])
4+
AM_GNU_GETTEXT_VERSION(0.20)
5+
AX_REQUIRE_DEFINED([AM_GNU_GETTEXT])
66
AM_GNU_GETTEXT([external])
77
AM_PATH_PYTHON([3])
88
PACKAGE="AC_PACKAGE_NAME"
@@ -80,7 +80,6 @@ AC_ARG_WITH(xmlto,
8080
[Enable xmlto manual generation @<:@default=yes@:>@])])
8181
AM_CONDITIONAL([XMLTO], [test x$with_xmlto != xno])
8282

83-
ALL_LINGUAS="ar as ast bg bn bn_IN br bs ca cs cy da de el en_GB es et fa fi fr fur gu he hi hr hu id is it ja kn ko lt lv mai ml mr ms nb nds nl nn oc or pa pl pt pt_BR ro ru si sk sl sr sr@latin sv ta te th tr uk vi zh_CN zh_TW"
8483
AC_CONFIG_FILES([
8584
Makefile
8685
po/Makefile.in

po/LINGUAS

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ar
2+
as
3+
ast
4+
bg
5+
bn
6+
bn_IN
7+
br
8+
bs
9+
ca
10+
cs
11+
cy
12+
da
13+
de
14+
el
15+
en_GB
16+
es
17+
et
18+
fa
19+
fi
20+
fr
21+
fur
22+
gu
23+
he
24+
hi
25+
hr
26+
hu
27+
id
28+
is
29+
it
30+
ja
31+
kn
32+
ko
33+
lt
34+
lv
35+
mai
36+
ml
37+
mr
38+
ms
39+
nb
40+
nds
41+
nl
42+
nn
43+
oc
44+
or
45+
pa
46+
pl
47+
pt
48+
pt_BR
49+
ro
50+
ru
51+
si
52+
sk
53+
sl
54+
sr
55+
sr@latin
56+
sv
57+
ta
58+
te
59+
th
60+
tr
61+
uk
62+
vi
63+
zh_CN
64+
zh_TW

po/Makevars

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ subdir = po
88
top_builddir = ..
99

1010
# These options get passed to xgettext.
11-
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
11+
XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
1212

1313
# This is the copyright holder that gets inserted into the header of the
1414
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@@ -39,3 +39,15 @@ MSGID_BUGS_ADDRESS = https://bugzilla.redhat.com/bugzilla
3939
# This is the list of locale categories, beyond LC_MESSAGES, for which the
4040
# message catalogs shall be used. It is usually empty.
4141
EXTRA_LOCALE_CATEGORIES =
42+
43+
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
44+
# has changed. Possible values are "yes" and "no". Set this to no if
45+
# the POT file is checked in the repository and the version control
46+
# program ignores timestamps.
47+
PO_DEPENDS_ON_POT = no
48+
49+
# This tells whether or not to forcibly update $(DOMAIN).pot and
50+
# regenerate PO files on "make dist". Possible values are "yes" and
51+
# "no". Set this to no if the POT file and PO files are maintained
52+
# externally.
53+
DIST_DEPENDS_ON_UPDATE_PO = no

po/POTFILES.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# List of source files which contain translatable strings.
2-
[encoding: UTF-8]
2+
# Please keep this file sorted alphabetically.
33

4+
applet.py
45
asyncipp.py
56
authconn.py
67
errordialogs.py
@@ -10,29 +11,17 @@ options.py
1011
optionwidgets.py
1112
ppdippstr.py
1213
ppdsloader.py
14+
print-applet.desktop.in
1315
printerproperties.py
1416
probe_printer.py
1517
pysmb.py
1618
serversettings.py
17-
system-config-printer.py
18-
[type: gettext/glade] ui/AboutDialog.ui
19-
[type: gettext/glade] ui/ConnectDialog.ui
20-
[type: gettext/glade] ui/ConnectingDialog.ui
21-
[type: gettext/glade] ui/InstallDialog.ui
22-
[type: gettext/glade] ui/JobsWindow.ui
23-
[type: gettext/glade] ui/NewPrinterName.ui
24-
[type: gettext/glade] ui/NewPrinterWindow.ui
25-
[type: gettext/glade] ui/PrinterPropertiesDialog.ui
26-
[type: gettext/glade] ui/PrintersWindow.ui
27-
[type: gettext/glade] ui/ServerSettingsDialog.ui
28-
[type: gettext/glade] ui/SMBBrowseDialog.ui
29-
[type: gettext/glade] ui/statusicon_popupmenu.ui
30-
[type: gettext/glade] ui/WaitWindow.ui
31-
system-config-printer.desktop.in
3219
statereason.py
20+
system-config-printer.appdata.xml.in
21+
system-config-printer.desktop.in
22+
system-config-printer.py
3323
timedops.py
3424
ToolbarSearchEntry.py
35-
troubleshoot/__init__.py
3625
troubleshoot/base.py
3726
troubleshoot/CheckLocalServerPublishing.py
3827
troubleshoot/CheckNetworkServerSanity.py
@@ -44,6 +33,7 @@ troubleshoot/DeviceListed.py
4433
troubleshoot/ErrorLogCheckpoint.py
4534
troubleshoot/ErrorLogFetch.py
4635
troubleshoot/ErrorLogParse.py
36+
troubleshoot/__init__.py
4737
troubleshoot/Locale.py
4838
troubleshoot/LocalOrRemote.py
4939
troubleshoot/NetworkCUPSPrinterShared.py
@@ -56,6 +46,16 @@ troubleshoot/SchedulerNotRunning.py
5646
troubleshoot/ServerFirewalled.py
5747
troubleshoot/Shrug.py
5848
troubleshoot/Welcome.py
59-
applet.py
60-
print-applet.desktop.in
61-
system-config-printer.appdata.xml.in
49+
ui/AboutDialog.ui
50+
ui/ConnectDialog.ui
51+
ui/ConnectingDialog.ui
52+
ui/InstallDialog.ui
53+
ui/JobsWindow.ui
54+
ui/NewPrinterName.ui
55+
ui/NewPrinterWindow.ui
56+
ui/PrinterPropertiesDialog.ui
57+
ui/PrintersWindow.ui
58+
ui/ServerSettingsDialog.ui
59+
ui/SMBBrowseDialog.ui
60+
ui/statusicon_popupmenu.ui
61+
ui/WaitWindow.ui

print-applet.desktop.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Desktop Entry]
2-
_Name=Print Queue Applet
3-
_Comment=System tray icon for managing print jobs
2+
Name=Print Queue Applet
3+
Comment=System tray icon for managing print jobs
44
Exec=system-config-printer-applet
55
Terminal=false
66
Type=Application

system-config-printer.desktop.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[Desktop Entry]
2-
_Name=Print Settings
3-
_GenericName=Print Settings
4-
_X-GNOME-FullName=Print Settings
5-
_Comment=Configure printers
2+
Name=Print Settings
3+
GenericName=Print Settings
4+
X-GNOME-FullName=Print Settings
5+
Comment=Configure printers
66
Exec=system-config-printer
77
Terminal=false
88
Type=Application

0 commit comments

Comments
 (0)