diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-21 23:14:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-01-21 23:14:00 +0000 |
commit | 2a2b48ef66916f3ac7aafb46b83e1e86a6e15cf8 (patch) | |
tree | b6823d2558fc70c421e3d33e4457f873a094a3e4 | |
parent | c09dc77dfc3a5f0cd6d35b72388a9222e2f2faf3 (diff) |
start passing around the (possibly-bundle-modified) localedir so that we call bindtextdomain() correctly, and thus (hopefully) find message catalogs correctly inside a bundle
git-svn-id: svn://localhost/ardour2/branches/3.0@13965 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/main.cc | 18 | ||||
-rw-r--r-- | libs/ardour/ardour/ardour.h | 2 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 4 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/utils.h | 2 | ||||
-rw-r--r-- | libs/gtkmm2ext/utils.cc | 4 |
7 files changed, 27 insertions, 11 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 4426605e7c..7a3ecdb2a4 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -131,7 +131,7 @@ sigc::signal<void> ARDOUR_UI::RapidScreenUpdate; sigc::signal<void> ARDOUR_UI::SuperRapidScreenUpdate; sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock; -ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) +ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) : Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp) @@ -167,7 +167,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) , _feedback_exists (false) { - Gtkmm2ext::init(); + Gtkmm2ext::init(localedir); about = 0; splash = 0; @@ -266,7 +266,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) /* lets get this party started */ try { - if (ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization)) { + if (ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir)) { throw failed_constructor (); } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index de29082e79..1ab32113b7 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -116,7 +116,7 @@ namespace ARDOUR { class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr { public: - ARDOUR_UI (int *argcp, char **argvp[]); + ARDOUR_UI (int *argcp, char **argvp[], const char* localedir); ~ARDOUR_UI(); bool run_startup (bool should_be_new, std::string load_template); diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index cebef59f26..035434216c 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -148,6 +148,14 @@ 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()); + export_search_path (bundle_dir, "ARDOUR_DLL_PATH", "/lib"); /* inside an OS X .app bundle, there is no difference @@ -224,6 +232,14 @@ 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 = strdup (Glib::build_filename (lpath).c_str()); + /* note that this function is POSIX/Linux specific, so using / as a dir separator in this context is just fine. */ @@ -446,7 +462,7 @@ int main (int argc, char *argv[]) } try { - ui = new ARDOUR_UI (&argc, &argv); + ui = new ARDOUR_UI (&argc, &argv, localedir); } catch (failed_constructor& err) { error << _("could not create ARDOUR GUI") << endmsg; exit (1); diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 03de3965ec..26e875fda3 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -50,7 +50,7 @@ namespace ARDOUR { extern PBD::Signal1<void,std::string> BootMessage; extern PBD::Signal0<void> GUIIdle; - int init (bool with_vst, bool try_optimization); + int init (bool with_vst, bool try_optimization, const char* localedir); void init_post_engine (); int cleanup (); bool no_auto_connect (); diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 613ecbfc7d..e750792c5f 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -215,7 +215,7 @@ lotsa_files_please () } int -ARDOUR::init (bool use_windows_vst, bool try_optimization) +ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir) { if (!Glib::thread_supported()) { Glib::thread_init(); @@ -224,7 +224,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization) // this really should be in PBD::init..if there was one Gio::init (); - (void) bindtextdomain(PACKAGE, LOCALEDIR); + (void) bindtextdomain(PACKAGE, localedir); PBD::ID::init (); SessionEvent::init_event_pool (); diff --git a/libs/gtkmm2ext/gtkmm2ext/utils.h b/libs/gtkmm2ext/gtkmm2ext/utils.h index 242e1c77d0..0bde3cb562 100644 --- a/libs/gtkmm2ext/gtkmm2ext/utils.h +++ b/libs/gtkmm2ext/gtkmm2ext/utils.h @@ -45,7 +45,7 @@ namespace Gtk { } namespace Gtkmm2ext { - void init (); + void init (const char*); std::string fit_to_pixels (const std::string&, int pixel_width, Pango::FontDescription& font, int& actual_width, bool with_ellipses = false); std::pair<std::string, double> fit_to_pixels (cairo_t *, std::string, double); diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index 83ad4537a2..14f3ba2732 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -37,10 +37,10 @@ using namespace std; void -Gtkmm2ext::init () +Gtkmm2ext::init (const char* localedir) { // Necessary for gettext - (void) bindtextdomain(PACKAGE, LOCALEDIR); + (void) bindtextdomain(PACKAGE, localedir); } void |