tags 481424 + patch
thanks

I have created the attached patch that circumvents the dialog box by directly using the GetSystemLanguageCode() function, which returns the current language code if there is a translation available in this language and "en" else.

I have tested it on my system and it works for both supported languages (e.g. "LANG=de") and unsupported (e.g. "LANG=foobar"), in which case Audacity defaults to English. Of course the language is only set at first start, so if you want to change it afterwards you have to click yourself through the Preferences menu - but this in not a regression from the dialog box behaviour.

However, I don't think this patch is ready for upstream submission yet. Instead, the call to GetSystemLanguageCode() should be parenthesized between "#ifdef __UNIX__" or similar.

@Benjamin: Is it OK to leave it up to Benjamin to accept the patch for the Debian package and try to get it integrated upstream? ;)

Cheers,
Fabian



--
Dipl.-Phys. Fabian Greffrath

Ruhr-Universität Bochum
Lehrstuhl für Energieanlagen und Energieprozesstechnik (LEAT)
Universitätsstr. 150, IB 3/134
D-44780 Bochum

Telefon: +49 (0)234 / 32-26334
Fax:     +49 (0)234 / 32-14227
E-Mail:  greffr...@leat.ruhr-uni-bochum.de
Description: Respect system locale instead of asking the user
Author: Fabian Greffrath <fab...@debian-unofficial.org>
Bug-Debian: http://bugs.debian.org/481424

diff -Nur -x '*.orig' -x '*~' audacity-1.3.9/src/AudacityApp.cpp audacity-1.3.9.new/src/AudacityApp.cpp
--- audacity-1.3.9/src/AudacityApp.cpp	2009-09-03 15:36:20.000000000 +0200
+++ audacity-1.3.9.new/src/AudacityApp.cpp	2009-09-03 15:36:30.000000000 +0200
@@ -71,6 +71,7 @@
 #include "FreqWindow.h"
 #include "Internat.h"
 #include "LangChoice.h"
+#include "Languages.h"
 #include "Prefs.h"
 #include "Project.h"
 #include "Screenshot.h"
@@ -943,7 +944,7 @@
 
    // Pop up a dialog the first time the program is run
    if (lang == wxT(""))
-      lang = ChooseLanguage(NULL);
+      lang = GetSystemLanguageCode();
 
 #ifdef NOT_RQD
 //TIDY-ME: (CleanSpeech) Language prompt??

Reply via email to