changeset 15971:e27d9b9b71f4

gui: install translation files into $(datadir)/octave/$(version)/locale * build-aux/common.mk: define octlocaledir * configure.ac: default for octlocaledir is '$(datadir)/octave/$(version)/locale * libgui/Makefile.am: octlocale_DATA is the list of translation files * libinterp/interpfcn/defaults.cc: define Voct_locale_dir * libinterp/interpfcn/defaults.cc(set_default_oct_locale_dir): new function; * libinterp/interpfcn/defaults.cc(install_defaults): call set_default_oct_locale_dir () * libinterp/interpfcn/defaults.in.h: define OCTAVE_OCTLOCALEDIR, declare Voct_locale_dir * run-octave.in: set OCTAVE_LOCALE_DIR to $top_srcdir/libgui/languages * libgui/languages/generic.*: renamed into en_US.* * libgui/languages/translators: updated comment related to generic file
author Torsten <ttl@justmail.de>
date Sat, 19 Jan 2013 16:21:46 +0100
parents ca6202597201
children 22ab4fe661d7
files build-aux/common.mk configure.ac libgui/Makefile.am libgui/languages/en_US.qm libgui/languages/en_US.ts libgui/languages/generic.qm libgui/languages/generic.ts libgui/languages/translators libinterp/interpfcn/defaults.cc libinterp/interpfcn/defaults.in.h run-octave.in
diffstat 9 files changed, 33 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/common.mk
+++ b/build-aux/common.mk
@@ -342,6 +342,9 @@
 # Where to install and expect extra files like NEWS and doc-cache.
 octetcdir = @octetcdir@
 
+# Where to install and expect the language files for the gui.
+octlocaledir = @octlocaledir@
+
 # Where to install and expect libraries like liboctave.a, liboctinterp.a,
 # and other architecture-dependent data.
 octlibdir = @octlibdir@
@@ -673,6 +676,7 @@
   -e "s|%OCTAVE_OCTETCDIR%|\"${octetcdir}\"|" \
   -e "s|%OCTAVE_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
   -e "s|%OCTAVE_OCTLIBDIR%|\"${octlibdir}\"|" \
+  -e "s|%OCTAVE_OCTLOCALEDIR%|\"${octlocaledir}\"|" \
   -e "s|%OCTAVE_STARTUPFILEDIR%|\"${startupfiledir}\"|" \
   -e "s|%OCTAVE_PREFIX%|\"${prefix}\"|" \
   -e "s|%OCTAVE_API_VERSION%|\"${api_version}\"|" \
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,7 @@
   '$(datadir)/octave/site/$(api_version)/m')
 OCTAVE_SET_DEFAULT([localverfcnfiledir], '$(datadir)/octave/$(version)/site/m')
 OCTAVE_SET_DEFAULT([octetcdir], '$(datadir)/octave/$(version)/etc')
+OCTAVE_SET_DEFAULT([octlocaledir], '$(datadir)/octave/$(version)/locale')
 OCTAVE_SET_DEFAULT([doc_cache_file], '$(octetcdir)/doc-cache')
 OCTAVE_SET_DEFAULT([texi_macros_file], '$(octetcdir)/macros.texi')
 OCTAVE_SET_DEFAULT([imagedir], '$(datadir)/octave/$(version)/imagelib')
--- a/libgui/Makefile.am
+++ b/libgui/Makefile.am
@@ -26,8 +26,16 @@
 
 octlib_LTLIBRARIES = liboctgui.la
 
-EXTRA_DIST = default-qt-settings
+locales = \
+  languages/be_BY.qm \
+  languages/de_DE.qm \
+  languages/en_US.qm \
+  languages/es_ES.qm \
+  languages/pt_BR.qm \
+  languages/ru_RU.qm \
+  languages/uk_UA.qm
 
+EXTRA_DIST = default-qt-settings $(locales)
 CLEANFILES =
 
 BUILT_SOURCES =
@@ -70,6 +78,8 @@
 
 octetc_DATA = default-qt-settings
 
+octlocale_DATA = $(locales)
+
 moc-%.cc: %.h
 	@MOC@ -o$@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(MOC_CPPFLAGS) $(liboctgui_la_CPPFLAGS) $<
 
rename from libgui/languages/generic.qm
rename to libgui/languages/en_US.qm
rename from libgui/languages/generic.ts
rename to libgui/languages/en_US.ts
--- a/libgui/languages/translators
+++ b/libgui/languages/translators
@@ -1,5 +1,7 @@
 # Below Octave GUI translators are listed with their e-mails
-# to be able inform them about generic translation file changes
+# to be able to inform them about generic translation file changes.
+# The gerenic file that can be used as a template for new
+# translation files is en_US.ts
 be_BY Mihas Varantsou <meequz@gmail.com>
 de_DE Jacob Dawid <jacob.dawid@googlemail.com>
 en_US Jacob Dawid <jacob.dawid@googlemail.com>
--- a/libinterp/interpfcn/defaults.cc
+++ b/libinterp/interpfcn/defaults.cc
@@ -75,6 +75,7 @@
 std::string Vlocal_fcn_file_dir;
 
 std::string Voct_etc_dir;
+std::string Voct_locale_dir;
 
 std::string Voct_file_dir;
 std::string Vfcn_file_dir;
@@ -224,6 +225,12 @@
 }
 
 static void
+set_default_oct_locale_dir (void)
+{
+  Voct_locale_dir = subst_octave_home (OCTAVE_OCTLOCALEDIR);
+}
+
+static void
 set_default_oct_file_dir (void)
 {
   Voct_file_dir = subst_octave_home (OCTAVE_OCTFILEDIR);
@@ -428,6 +435,7 @@
   set_default_local_fcn_file_dir ();
 
   set_default_oct_etc_dir ();
+  set_default_oct_locale_dir ();
 
   set_default_fcn_file_dir ();
   set_default_oct_file_dir ();
--- a/libinterp/interpfcn/defaults.in.h
+++ b/libinterp/interpfcn/defaults.in.h
@@ -156,6 +156,10 @@
 #define OCTAVE_OCTETCDIR %OCTAVE_OCTETCDIR%
 #endif
 
+#ifndef OCTAVE_OCTLOCALEDIR
+#define OCTAVE_OCTLOCALEDIR %OCTAVE_OCTLOCALEDIR%
+#endif
+
 #ifndef OCTAVE_OCTINCLUDEDIR
 #define OCTAVE_OCTINCLUDEDIR %OCTAVE_OCTINCLUDEDIR%
 #endif
@@ -195,6 +199,7 @@
 extern OCTINTERP_API std::string Vlocal_fcn_file_dir;
 
 extern OCTINTERP_API std::string Voct_etc_dir;
+extern OCTINTERP_API std::string Voct_locale_dir;
 
 extern OCTINTERP_API std::string Voct_file_dir;
 extern OCTINTERP_API std::string Vfcn_file_dir;
--- a/run-octave.in
+++ b/run-octave.in
@@ -80,6 +80,7 @@
 
 OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \
 OCTAVE_DEFAULT_QT_SETTINGS="$top_srcdir/libgui/default-qt-settings" \
+OCTAVE_LOCALE_DIR="$top_srcdir/libgui/languages" \
 OCTAVE_JAVA_DIR="$builddir/scripts/java" \
   exec $builddir/libtool --mode=execute $driver \
     "$octave_executable" --no-init-path --path="$LOADPATH" \