Skip to content

Commit 3604d80

Browse files
committed
Revert "build/i18n: migrate from intltool to gettext (#552)"
This reverts commit bbac596. makepot is used during releases by the Mint team only, it doesn't nor shouldn't require any build. This is also overly complicated and tied to the build system. If the only issue is to translate the backend strings, then we can fix that in the UI. I assume it's only used in the open file dialog when changing the formats.
1 parent b74c567 commit 3604d80

27 files changed

+72
-97
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=comicsdocument
3-
TypeDescription=Comic Books
3+
_TypeDescription=Comic Books
44
MimeType=application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/vnd.comicbook+zip;

backend/comics/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ shared_module(
2020
install_dir: backendsdir,
2121
)
2222

23-
i18n.merge_file(
24-
input: 'comicsdocument.xreader-backend.desktop.in',
23+
custom_target(
24+
'comics_backend',
25+
input: 'comicsdocument.xreader-backend.in',
2526
output: 'comicsdocument.xreader-backend',
26-
po_dir: po_dir,
27-
type: 'desktop',
28-
args: ['--keyword=TypeDescription'],
27+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
2928
install: true,
3029
install_dir: backendsdir,
3130
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=djvudocument
3-
TypeDescription=DjVu Documents
3+
_TypeDescription=DjVu Documents
44
MimeType=image/vnd.djvu;image/vnd.djvu+multipage

backend/djvu/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ shared_module(
2626
install_dir: backendsdir,
2727
)
2828

29-
i18n.merge_file(
30-
input: 'djvudocument.xreader-backend.desktop.in',
29+
custom_target(
30+
'djvu_backend',
31+
input: 'djvudocument.xreader-backend.in',
3132
output: 'djvudocument.xreader-backend',
32-
po_dir: po_dir,
33-
type: 'desktop',
34-
args: ['--keyword=TypeDescription'],
33+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3534
install: true,
3635
install_dir: backendsdir,
3736
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=dvidocument
3-
TypeDescription=DVI Documents
3+
_TypeDescription=DVI Documents
44
MimeType=application/x-dvi;application/x-bzdvi;application/x-gzdvi

backend/dvi/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ shared_module(
3131
install_dir: backendsdir,
3232
)
3333

34-
i18n.merge_file(
35-
input: 'dvidocument.xreader-backend.desktop.in',
34+
custom_target(
35+
'dvi_backend',
36+
input: 'dvidocument.xreader-backend.in',
3637
output: 'dvidocument.xreader-backend',
37-
po_dir: po_dir,
38-
type: 'desktop',
39-
args: ['--keyword=TypeDescription'],
38+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
4039
install: true,
4140
install_dir: backendsdir,
4241
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=epubdocument
3-
TypeDescription=epub Documents
3+
_TypeDescription=epub Documents
44
MimeType=application/epub+zip;

backend/epub/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ shared_module(
2525
install_dir: backendsdir,
2626
)
2727

28-
i18n.merge_file(
29-
input: 'epubdocument.xreader-backend.desktop.in',
28+
custom_target(
29+
'epub_backend',
30+
input: 'epubdocument.xreader-backend.in',
3031
output: 'epubdocument.xreader-backend',
31-
po_dir: po_dir,
32-
type: 'desktop',
33-
args: ['--keyword=TypeDescription'],
32+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3433
install: true,
3534
install_dir: backendsdir,
3635
)

backend/pdf/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ shared_module(
2020
install_dir: backendsdir,
2121
)
2222

23-
i18n.merge_file(
24-
input: 'pdfdocument.xreader-backend.desktop.in',
23+
custom_target(
24+
'pdf_backend',
25+
input: 'pdfdocument.xreader-backend.in',
2526
output: 'pdfdocument.xreader-backend',
26-
po_dir: po_dir,
27-
type: 'desktop',
28-
args: ['--keyword=TypeDescription'],
27+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
2928
install: true,
3029
install_dir: backendsdir,
3130
)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Xreader Backend]
22
Module=pdfdocument
33
Resident=true
4-
TypeDescription=PDF Documents
4+
_TypeDescription=PDF Documents
55
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/x-ext-pdf;

backend/pixbuf/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ shared_module(
2020
install_dir: backendsdir,
2121
)
2222

23-
i18n.merge_file(
24-
input: 'pixbufdocument.xreader-backend.desktop.in',
23+
custom_target(
24+
'pixbuf_backend',
25+
input: 'pixbufdocument.xreader-backend.in',
2526
output: 'pixbufdocument.xreader-backend',
26-
po_dir: po_dir,
27-
type: 'desktop',
28-
args: ['--keyword=TypeDescription'],
27+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
2928
install: true,
3029
install_dir: backendsdir,
3130
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=pixbufdocument
3-
TypeDescription=Images
3+
_TypeDescription=Images
44
MimeType=image/*;

backend/ps/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ shared_module(
2121
install_dir: backendsdir,
2222
)
2323

24-
i18n.merge_file(
25-
input: 'psdocument.xreader-backend.desktop.in',
24+
custom_target(
25+
'ps_backend',
26+
input: 'psdocument.xreader-backend.in',
2627
output: 'psdocument.xreader-backend',
27-
po_dir: po_dir,
28-
type: 'desktop',
29-
args: ['--keyword=TypeDescription'],
28+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3029
install: true,
3130
install_dir: backendsdir,
3231
)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Xreader Backend]
22
Module=psdocument
33
Resident=true
4-
TypeDescription=PostScript Documents
4+
_TypeDescription=PostScript Documents
55
MimeType=application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps

backend/tiff/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ shared_module(
2424
install_dir: backendsdir,
2525
)
2626

27-
i18n.merge_file(
28-
input: 'tiffdocument.xreader-backend.desktop.in',
27+
custom_target(
28+
'tiff_backend',
29+
input: 'tiffdocument.xreader-backend.in',
2930
output: 'tiffdocument.xreader-backend',
30-
po_dir: po_dir,
31-
type: 'desktop',
32-
args: ['--keyword=TypeDescription'],
31+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3332
install: true,
3433
install_dir: backendsdir,
3534
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[Xreader Backend]
22
Module=tiffdocument
3-
TypeDescription=Tiff Documents
3+
_TypeDescription=Tiff Documents
44
MimeType=image/tiff

backend/xps/meson.build

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ shared_module(
2121
install_dir: backendsdir,
2222
)
2323

24-
i18n.merge_file(
25-
input: 'xpsdocument.xreader-backend.desktop.in',
24+
custom_target(
25+
'xps_backend',
26+
input: 'xpsdocument.xreader-backend.in',
2627
output: 'xpsdocument.xreader-backend',
27-
po_dir: po_dir,
28-
type: 'desktop',
29-
args: ['--keyword=TypeDescription'],
28+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3029
install: true,
3130
install_dir: backendsdir,
3231
)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Xreader Backend]
22
Module=xpsdocument
33
Resident=true
4-
TypeDescription=XPS Documents
4+
_TypeDescription=XPS Documents
55
MimeType=application/oxps;application/vnd.ms-xpsdocument

data/meson.build

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ desktop = configure_file(
3131
configuration: desktop_conf,
3232
)
3333

34-
i18n.merge_file(
34+
custom_target(
35+
'desktop',
3536
input: desktop,
3637
output: 'xreader.desktop',
37-
po_dir: po_dir,
38-
type: 'desktop',
38+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
3939
install: true,
4040
install_dir: desktopdir,
4141
)
4242

43-
i18n.merge_file(
43+
appdata = custom_target(
44+
'appdata',
4445
input: 'xreader.appdata.xml.in',
4546
output: 'xreader.appdata.xml',
46-
po_dir: po_dir,
47-
type: 'xml',
47+
command: [intltool_merge, '-x', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
4848
install: true,
4949
install_dir: join_paths(datadir, 'metainfo'),
5050
)

data/xreader.appdata.xml.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<metadata_license>CC0-1.0</metadata_license>
55
<project_license>GPL-2.0+</project_license>
66
<name>Document Viewer</name>
7-
<summary>A Document Viewer</summary>
8-
<description>
7+
<_summary>A Document Viewer</_summary>
8+
<_description>
99
<p>
1010
Xreader is a simple multi-page document viewer. It can display and
1111
print PostScript (PS), Encapsulated PostScript (EPS), DJVU, DVI,
@@ -14,7 +14,7 @@
1414
searching for text, copying text to the clipboard, hypertext navigation
1515
and table-of-contents bookmarks.
1616
</p>
17-
</description>
17+
</_description>
1818
<url type="homepage">http://github.com/linuxmint/xreader</url>
1919
<project_group>Linux Mint</project_group>
2020
</component>

data/xreader.desktop.in.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Desktop Entry]
2-
Name=Document Viewer
3-
Comment=View multi-page documents
2+
_Name=Document Viewer
3+
_Comment=View multi-page documents
44
TryExec=xreader
55
Exec=xreader %U
66
StartupNotify=true

debian/control

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Section: x11
33
Priority: optional
44
Maintainer: Linux Mint <[email protected]>
55
Build-Depends: debhelper-compat (= 12),
6-
gettext,
76
gobject-introspection,
7+
intltool,
88
libdjvulibre-dev,
99
libgail-3-dev,
1010
libgirepository1.0-dev,

makepot

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
#!/usr/bin/sh
1+
cd po
2+
INTLTOOL_EXTRACT="/usr/bin/intltool-extract" XGETTEXT="/usr/bin/xgettext" srcdir=. /usr/bin/intltool-update --gettext-package xreader --pot
3+
mv xreader.pot ..
24

3-
usage() {
4-
echo "Usage: $0 [--help | <meson build dir>]"
5-
}
6-
7-
if [ $# -ne 1 ] || [ $1 = "--help" ]; then
8-
usage
9-
exit 1
10-
fi
11-
12-
if ! [ -d "$1" ]; then
13-
echo "meson build dir '$1' does not exist"
14-
exit 2
15-
fi
16-
17-
echo "Generating po/xreader.pot ..."
18-
ninja -C "$1" xreader-pot || exit 1
19-
20-
echo "Done. To update .po files run:\t ninja -C "$1" xreader-update-po"

meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ xreader_conf.set_quoted('SUPPORTED_MIMETYPES', xreader_mime_types) # This is gen
121121
# on some systems we need to find the math lib to make sure it builds
122122
math = cc.find_library('m', required: false)
123123

124+
intltool_merge = find_program('intltool-merge')
125+
124126
mathjax_directory = get_option('mathjax-directory')
125127
if mathjax_directory == ''
126128
foreach dir: [

po/POTFILES.in

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# List of source files containing translatable strings.
22
# Please keep this file sorted alphabetically.
3+
[encoding: UTF-8]
34
backend/comics/comics-document.c
4-
backend/comics/comicsdocument.xreader-backend.desktop.in
5+
[type: gettext/ini] backend/comics/comicsdocument.xreader-backend.in
56
backend/djvu/djvu-document.c
6-
backend/djvu/djvudocument.xreader-backend.desktop.in
7+
[type: gettext/ini] backend/djvu/djvudocument.xreader-backend.in
78
backend/dvi/dvi-document.c
8-
backend/dvi/dvidocument.xreader-backend.desktop.in
9+
[type: gettext/ini] backend/dvi/dvidocument.xreader-backend.in
910
backend/epub/epub-document.c
10-
backend/epub/epubdocument.xreader-backend.desktop.in
11+
[type: gettext/ini] backend/epub/epubdocument.xreader-backend.in
1112
backend/pdf/ev-poppler.cc
12-
backend/pdf/pdfdocument.xreader-backend.desktop.in
13+
[type: gettext/ini] backend/pdf/pdfdocument.xreader-backend.in
1314
backend/ps/ev-spectre.c
14-
backend/ps/psdocument.xreader-backend.desktop.in
15+
[type: gettext/ini] backend/ps/psdocument.xreader-backend.in
1516
backend/tiff/tiff-document.c
16-
backend/tiff/tiffdocument.xreader-backend.desktop.in
17-
backend/xps/xps-document.c
18-
backend/xps/xpsdocument.xreader-backend.desktop.in
1917
libdocument/ev-attachment.c
2018
libdocument/ev-document-factory.c
2119
libdocument/ev-file-helpers.c
@@ -45,7 +43,7 @@ shell/ev-keyring.c
4543
shell/ev-open-recent-action.c
4644
shell/ev-password-view.c
4745
shell/ev-preferences-dialog.c
48-
shell/ev-preferences-dialog.ui
46+
[type: gettext/glade]shell/ev-preferences-dialog.ui
4947
shell/ev-properties-dialog.c
5048
shell/ev-properties-fonts.c
5149
shell/ev-properties-license.c

po/POTFILES.skip

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
data/xreader.desktop.in
12
backend/dvi/mdvi-lib/dviread.c
23
backend/dvi/mdvi-lib/font.c
34
backend/dvi/mdvi-lib/fontmap.c

po/meson.build

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
i18n.gettext(meson.project_name(),
2-
preset: 'glib',
3-
args: ['--keyword=TypeDescription'],
2+
preset: 'glib'
43
)

0 commit comments

Comments
 (0)