aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-02-04 08:30:52 +0100
committerThomas White <taw@physics.org>2019-05-16 15:15:49 +0200
commita6bbd9c0db901859b8820c90b4b147ad36c52dc6 (patch)
tree320cd5c04fa39eadec866867c998546fcf241661
parenta21a13fe9a722b7d607c45fcbd19ff0bb154e621 (diff)
Localisation and other stuff
-rw-r--r--meson.build48
-rw-r--r--po/.gitignore7
-rw-r--r--po/Makefile.in.in271
-rw-r--r--po/Makevars41
-rw-r--r--po/meson.build8
5 files changed, 31 insertions, 344 deletions
diff --git a/meson.build b/meson.build
index b52c1edb..fa653a87 100644
--- a/meson.build
+++ b/meson.build
@@ -5,6 +5,12 @@ project('sylpheed', 'c',
license : ['GPL2+', 'LGPL2+'],
default_options : ['buildtype=debugoptimized'])
+gnome = import('gnome')
+
+
+# Localisation
+subdir('po')
+
# Dependency packages
@@ -148,39 +154,32 @@ libsylph_dep = declare_dependency(include_directories : libsylph_includes,
flex = find_program('flex')
bison = find_program('bison')
-quote_fmt_parse_c = custom_target('quote_fmt_parse.tab.c',
- output : ['quote_fmt_parse.tab.c', 'quote_fmt_parse.tab.h'],
- input : 'src/quote_fmt_parse.y',
- command : [bison, '--defines=@OUTPUT1@',
- '-p', 'quote_fmt',
- '--output=@OUTPUT0@',
- '@INPUT@'])
+quote_fmt_parse_tab_ch = custom_target('quote_fmt_parse.tab.c',
+ output : ['quote_fmt_parse.tab.c',
+ 'quote_fmt_parse.tab.h'],
+ input : 'src/quote_fmt_parse.y',
+ command : [bison, '--defines=@OUTPUT1@',
+ '-p', 'quote_fmt',
+ '--output=@OUTPUT0@',
+ '@INPUT@'])
quote_fmt_c = custom_target('quote_fmt.c',
output : ['quote_fmt.c', 'quote_fmt.h'],
- input : ['src/quote_fmt_lex.l', quote_fmt_parse_c],
+ input : ['src/quote_fmt_lex.l', quote_fmt_parse_tab_ch],
command : [flex, '--outfile=@OUTPUT0@',
'--header-file=@OUTPUT1@',
'-P', 'quote_fmt',
'@INPUT@'])
-glibgenmarshal = find_program('glib-genmarshal')
+plugin_marshal_ch = gnome.genmarshal('plugin-marshal',
+ prefix : 'syl_plugin_marshal',
+ sources : 'src/plugin-marshal.list')
+
-plugin_marshal_c = custom_target('plugin-marshal.c',
- output : ['plugin-marshal.c'],
- input : 'src/plugin-marshal.list',
- command : [glibgenmarshal, '--output=@OUTPUT@',
- '--body',
- '--prefix=syl_plugin_marshal',
- '@INPUT@'])
+gdk_pixbuf_source = find_program('gdk-pixbuf-csource')
-plugin_marshal_h = custom_target('plugin-marshal.h',
- output : ['plugin-marshal.h'],
- input : 'src/plugin-marshal.list',
- command : [glibgenmarshal, '--output=@OUTPUT@',
- '--header',
- '--prefix=syl_plugin_marshal',
- '@INPUT@'])
+#gen_icon = generator(gdk_pixbuf_source, output : '@BASENAME@.h'
+# arguments : ' [
executable('sylpheed',
['src/about.c',
@@ -234,8 +233,7 @@ executable('sylpheed',
'src/passphrase.c',
'src/plugin.c',
'src/plugin_manager.c',
- plugin_marshal_c,
- plugin_marshal_h,
+ plugin_marshal_ch,
'src/prefs_account_dialog.c',
'src/prefs_actions.c',
'src/prefs_common_dialog.c',
diff --git a/po/.gitignore b/po/.gitignore
deleted file mode 100644
index d7a44e87..00000000
--- a/po/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-/Makefile
-/Makefile.in
-/POTFILES
-/remove-potcdate.sed
-/sylpheed.pot
-/stamp-po
-/*.gmo
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
deleted file mode 100644
index 20e0752d..00000000
--- a/po/Makefile.in.in
+++ /dev/null
@@ -1,271 +0,0 @@
-# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-#
-# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
-# instead of PACKAGE and to look for po2tbl in ./ not in intl/
-#
-# - Modified by jacob berkman <jacob@ximian.com> to install
-# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
-
-GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datarootdir = @datarootdir@
-datadir = @datadir@
-libdir = @libdir@
-localedir = $(libdir)/locale
-gnulocaledir = $(datadir)/locale
-gettextsrcdir = $(datadir)/glib-2.0/gettext/po
-subdir = po
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
-
-CC = @CC@
-GENCAT = @GENCAT@
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-MSGFMT_OPTS = @MSGFMT_OPTS@
-XGETTEXT = @XGETTEXT@
-MSGMERGE = msgmerge
-
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-SOURCES =
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
-$(POFILES) $(GMOFILES) $(SOURCES)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
-
-.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
-
-.c.o:
- $(COMPILE) $<
-
-.po.pox:
- $(MAKE) $(GETTEXT_PACKAGE).pot
- $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
-
-.po.mo:
- $(MSGFMT) -c -o $@ $<
-
-.po.gmo:
- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -c --statistics -o $$file $<
-
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && $(GENCAT) $@ $*.msg
-
-
-all: all-@USE_NLS@
-
-all-yes: $(CATALOGS)
-all-no:
-
-$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
- $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
- --add-comments --keyword=_ --keyword=N_ \
- --flag=g_strdup_printf:1:c-format \
- --flag=g_string_printf:2:c-format \
- --flag=g_string_append_printf:2:c-format \
- --flag=g_error_new:3:c-format \
- --flag=g_set_error:4:c-format \
- --flag=g_markup_printf_escaped:1:c-format \
- --flag=g_log:3:c-format \
- --flag=g_print:1:c-format \
- --flag=g_printerr:1:c-format \
- --flag=g_printf:1:c-format \
- --flag=g_fprintf:2:c-format \
- --flag=g_sprintf:2:c-format \
- --flag=g_snprintf:3:c-format \
- --flag=g_scanner_error:2:c-format \
- --flag=g_scanner_warn:2:c-format \
- --files-from=$(srcdir)/POTFILES.in \
- && test ! -f $(GETTEXT_PACKAGE).po \
- || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
- && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
-install-data-no: all
-install-data-yes: all
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
- fi
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- case "$$cat" in \
- *.gmo) destdir=$(gnulocaledir);; \
- *) destdir=$(localedir);; \
- esac; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $$dir; \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
- fi; \
- if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
- fi; \
- if test -r $$cat.m; then \
- $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
- else \
- if test -r $(srcdir)/$$cat.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$cat.m \
- $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
- else \
- true; \
- fi; \
- fi; \
- done
- if test "$(PACKAGE)" = "glib"; then \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
- done
- if test "$(PACKAGE)" = "glib"; then \
- rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- fi
-
-check: all
-
-dvi info tags TAGS ID:
-
-mostlyclean:
- rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
- rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
-
-distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: update-po $(DISTFILES)
- dists="$(DISTFILES)"; \
- for file in $$dists; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
- done
-
-update-po: Makefile
- $(MAKE) $(GETTEXT_PACKAGE).pot
- tmpdir=`pwd`; \
- cd $(srcdir); \
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- echo "$$lang:"; \
- if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
- if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
- rm -f $$tmpdir/$$lang.new.po; \
- else \
- if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
- :; \
- else \
- echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
- rm -f $$tmpdir/$$lang.new.po; \
- exit 1; \
- fi; \
- fi; \
- else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$tmpdir/$$lang.new.po; \
- fi; \
- done
-
-# POTFILES is created from POTFILES.in by stripping comments, empty lines
-# and Intltool tags (enclosed in square brackets), and appending a full
-# relative path to them
-POTFILES: POTFILES.in
- ( if test 'x$(srcdir)' != 'x.'; then \
- posrcprefix='$(top_srcdir)/'; \
- else \
- posrcprefix="../"; \
- fi; \
- rm -f $@-t $@ \
- && (sed -e '/^#/d' \
- -e "s/^\[.*\] +//" \
- -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
- | sed -e '$$s/\\$$//') > $@-t \
- && chmod a-w $@-t \
- && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
- cd .. \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
deleted file mode 100644
index 524d2455..00000000
--- a/po/Makevars
+++ /dev/null
@@ -1,41 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
-# package. (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.) Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright. The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Hiroyuki Yamamoto
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-# in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-# understood.
-# - Strings which make invalid assumptions about notation of date, time or
-# money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS = hiro-y@kcn.ne.jp
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used. It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..ca0ae221
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,8 @@
+i18n = import('i18n')
+
+add_project_arguments('-DGETTEXT_PACKAGE="sylpheed"',
+ language : 'c')
+
+i18n.gettext(meson.project_name(),
+ preset : 'glib',
+ args : '--directory='+meson.source_root())