more i18n fixes, this time removing a hack that broke i18n in bundles, and also only...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 23 Jan 2013 16:09:10 +0000 (16:09 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 23 Jan 2013 16:09:10 +0000 (16:09 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13975 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/main.cc
libs/ardour/globals.cc
libs/gtkmm2ext/utils.cc
tools/linux_packaging/ardour.sh.in

index 5a4bff016731f37f550ca3ce2f4eff5a33542565..a8f8db5a38837267494030775ecfb4df6bf549d0 100644 (file)
@@ -148,14 +148,22 @@ fixup_bundle_environment (int, char* [])
 
        bundle_dir = Glib::path_get_dirname (exec_dir);
 
-       /* force localedir into the bundle */
-
-       vector<string> lpath;
-       lpath.push_back (bundle_dir);
-       lpath.push_back ("share");
-       lpath.push_back ("locale");
-       localedir = strdup (Glib::build_filename (lpath).c_str());
-
+#ifdef ENABLE_NLS
+       if (ARDOUR::translations_are_disabled ()) {
+               localedir = "/this/cannot/exist";
+               export_search_path (bundle_dir, "GTK_LOCALEDIR", "/Resources/locale");
+       } else {
+               /* force localedir into the bundle */
+               
+               vector<string> lpath;
+               lpath.push_back (bundle_dir);
+               lpath.push_back ("share");
+               lpath.push_back ("locale");
+               localedir = strdup (Glib::build_filename (lpath).c_str());
+               export_search_path (bundle_dir, "GTK_LOCALEDIR", "/Resources/locale");
+       }
+#endif
+               
        export_search_path (bundle_dir, "ARDOUR_DLL_PATH", "/lib");
 
        /* inside an OS X .app bundle, there is no difference
@@ -177,10 +185,6 @@ fixup_bundle_environment (int, char* [])
 
        unsetenv ("GTK_RC_FILES");
 
-       if (!ARDOUR::translations_are_disabled ()) {
-               export_search_path (bundle_dir, "GTK_LOCALEDIR", "/Resources/locale");
-       }
-
        /* write a pango.rc file and tell pango to use it. we'd love
           to put this into the PROGRAM_NAME.app bundle and leave it there,
           but the user may not have write permission. so ...
@@ -232,13 +236,20 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
        std::string dir_path = Glib::path_get_dirname (Glib::path_get_dirname (argv[0]));
        std::string userconfigdir = user_config_directory();
 
-       /* force localedir into the bundle */
-
-       vector<string> lpath;
-       lpath.push_back (dir_path);
-       lpath.push_back ("share");
-       lpath.push_back ("locale");
-       localedir = realpath (Glib::build_filename (lpath).c_str(), NULL);
+#ifdef ENABLE_NLS
+       if (ARDOUR::translations_are_disabled ()) {
+               localedir = "/this/cannot/exist";
+               export_search_path (dir_path, "GTK_LOCALEDIR", "/this/cannot/exist");
+       } else {
+               /* force localedir into the bundle */
+               vector<string> lpath;
+               lpath.push_back (dir_path);
+               lpath.push_back ("share");
+               lpath.push_back ("locale");
+               localedir = realpath (Glib::build_filename (lpath).c_str(), NULL);
+               export_search_path (dir_path, "GTK_LOCALEDIR", "/share/locale");
+       }
+#endif
 
        /* note that this function is POSIX/Linux specific, so using / as
           a dir separator in this context is just fine.
@@ -259,10 +270,6 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
 
        unsetenv ("GTK_RC_FILES");
 
-       if (!ARDOUR::translations_are_disabled ()) {
-               export_search_path (dir_path, "GTK_LOCALEDIR", "/share/locale");
-       }
-
        /* Tell fontconfig where to find fonts.conf. Use the system version
           if it exists, otherwise use the stuff we included in the bundle
        */
@@ -388,7 +395,9 @@ int main (int argc, char *argv[])
                Glib::thread_init();
        }
 
+#ifdef ENABLE_NLS
        gtk_set_locale ();
+#endif
 
 #ifdef WINDOWS_VST_SUPPORT
        /* this does some magic that is needed to make GTK and Wine's own
@@ -406,7 +415,6 @@ int main (int argc, char *argv[])
           we use that when handling them.
        */
        (void) bind_textdomain_codeset (PACKAGE,"UTF-8");
-       (void) textdomain (PACKAGE);
 #endif
 
        pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
index e750792c5f22044d4514c0c971c6cc4160207d09..c23cb614feaeaeb583a4a775a9988ffea0bf07b6 100644 (file)
@@ -224,7 +224,9 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
        // this really should be in PBD::init..if there was one
        Gio::init ();
 
+#ifdef ENABLE_NLS
        (void) bindtextdomain(PACKAGE, localedir);
+#endif
 
        PBD::ID::init ();
        SessionEvent::init_event_pool ();
index 14f3ba273271194120f0f82f725a65deacc6ddcb..4bc9113875c04dca7b13823b2d1af29146694586 100644 (file)
@@ -39,8 +39,9 @@ using namespace std;
 void
 Gtkmm2ext::init (const char* localedir)
 {
-       // Necessary for gettext
+#ifdef ENABLE_NLS
        (void) bindtextdomain(PACKAGE, localedir);
+#endif
 }
 
 void
index 3c8e77fb7f7a1cfe25112a1635961bfcbc7fefee..6545e80b405c35d54069a17f9ba2a3480f73a64a 100644 (file)
@@ -51,15 +51,6 @@ export LD_LIBRARY_PATH=$INSTALL_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
 sed "s?@ROOTDIR@/modules?$LIB_DIR/modules?" < $ETC_DIR/pango.modules.in > $USER_ARDOUR_DIR/pango.modules
 sed "s?@ROOTDIR@/loaders?$LIB_DIR/loaders?" < $ETC_DIR/gdk-pixbuf.loaders.in > $USER_ARDOUR_DIR/gdk-pixbuf.loaders
 
-
-# Hack to fix i18n issue where the grid button gets translated even when translations are disabled.
-
-if [ ! -e $USER_ARDOUR_DIR/.love_is_the_language_of_audio ]; then
-       # Translations are disabled. Force english
-       export LANG=C
-fi
-
-
 if [ "T" = "$DEBUG" ]; then
        export ARDOUR_INSIDE_GDB=1
        exec gdb $INSTALL_DIR/bin/ardour-3.0