commit 40d2d15977b4c39a1be66bc9009ba61bb8d105f8 Author: Ahmed Siam Date: Sat Aug 19 08:04:54 2023 +0300 init i18n diff --git a/.gitignore b/.gitignore index c1bc691..f6da214 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,9 @@ stamp-h1 /testing/*.output /compile_commands.json /.projectile + +/.vscode/ +/locales/Makefile +/locales/Makefile.in +*.res +*.dat diff --git a/Makefile.am b/Makefile.am index 14adbff..0b93c93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AM_LDFLAGS=$(LIBS) -SUBDIRS = src scripts +SUBDIRS = src scripts locales pkgconfigdir = $(libdir)/pkgconfig dist_pkgconfig_DATA = apertium-lex-tools.pc @@ -15,3 +15,7 @@ check: .PHONY: test test: check + +export LTTB_I18N_DATA=$(datadir)/lttoolbox/lttoolbox.dat +export LOCALES_DIR=$(datadir)/$(PACKAGE_NAME) +export APER_I18N_DATA=$(LOCALES_DIR)/apertium.dat diff --git a/configure.ac b/configure.ac index 0242a99..94568a6 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,7 @@ AM_CONDITIONAL([HAVE_YASMET], [test "x$yasmet" != "xno"]) PKG_CHECK_MODULES([LTTOOLBOX], [lttoolbox >= required_lttoolbox_version]) +PKG_CHECK_MODULES(I18N, [i18n], CPPFLAGS="$CPPFLAGS $I18N_CFLAGS"; LIBS="$LIBS $I18N_LIBS") AC_SUBST(LTTOOLBOX_CFLAGS) AC_SUBST(LTTOOLBOX_LIBS) @@ -112,5 +113,5 @@ then fi fi -AC_CONFIG_FILES([Makefile apertium-lex-tools.pc src/Makefile scripts/Makefile]) +AC_CONFIG_FILES([Makefile apertium-lex-tools.pc src/Makefile scripts/Makefile locales/Makefile]) AC_OUTPUT diff --git a/locales/Makefile.am b/locales/Makefile.am new file mode 100644 index 0000000..c22bf38 --- /dev/null +++ b/locales/Makefile.am @@ -0,0 +1,7 @@ +aplt.dat: root.txt en.txt + genrb -d . root.txt en.txt + echo root.res en.res > package_list.txt + pkgdata -p aplt --mode archive -d . package_list.txt + +localesdir = $(LOCALES_DIR) +dist_locales_DATA = aplt.dat diff --git a/locales/en.txt b/locales/en.txt new file mode 100644 index 0000000..0bd10e4 --- /dev/null +++ b/locales/en.txt @@ -0,0 +1,2 @@ +en{ +} \ No newline at end of file diff --git a/locales/package_list.txt b/locales/package_list.txt new file mode 100644 index 0000000..d5134dd --- /dev/null +++ b/locales/package_list.txt @@ -0,0 +1 @@ +root.res en.res diff --git a/locales/root.txt b/locales/root.txt new file mode 100644 index 0000000..546cf8b --- /dev/null +++ b/locales/root.txt @@ -0,0 +1,3 @@ +root{ + biltrans_without_queue_desc{Usage: {program} [--trimmed | -t]} +} diff --git a/src/Makefile.am b/src/Makefile.am index 17244db..baa788c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,6 +19,8 @@ multitrans_SOURCES = multitrans.cc process_tagger_output_SOURCES = process_tagger_output.cc +AM_CPPFLAGS = -DAPLT_I18N_DATA='"$(APLT_I18N_DATA)"' -DLTTB_I18N_DATA='"$(LTTB_I18N_DATA)"' + LDADD = -lapertium-lex-tools $(lib_LTLIBRARIES) if HAVE_YASMET