User interface for language selection.
[dcpomatic.git] / src / tools / dvdomatic.cc
index 230e02c88f8e2f8a587257c5bb77be7fe040fdd5..66f366a24148d7ea1ee1f07966ed73b04b172389 100644 (file)
@@ -416,7 +416,11 @@ private:
                info.SetDevelopers (authors);
 
                wxArrayString translators;
-               translators.Add (wxT ("Olivier (freedcp.net)"));
+               translators.Add (wxT ("Olivier Perriere"));
+               translators.Add (wxT ("Lilian Lefranc"));
+               translators.Add (wxT ("Thierry Journet"));
+               translators.Add (wxT ("Massimiliano Broggi"));
+               translators.Add (wxT ("Manuel AC"));
                info.SetTranslators (translators);
                
                info.SetWebSite (wxT ("http://carlh.net/software/dvdomatic"));
@@ -453,11 +457,8 @@ setup_i18n ()
        if (wxLocale::IsAvailable (language)) {
                locale = new wxLocale (language, wxLOCALE_LOAD_DEFAULT);
 
-#ifdef __WXGTK__
-               locale->AddCatalogLookupPathPrefix (wxT (LOCALE_PREFIX "/locale"));
-#endif
-#ifdef __WXMSW__
-               locale->AddCatalogLookupPathPrefix (wxT ("../locale"));
+#ifdef DVDOMATIC_WINDOWS
+               locale->AddCatalogLookupPathPrefix (std_to_wx (mo_path().string()));
 #endif         
 
                locale->AddCatalog (wxT ("libdvdomatic-wx"));
@@ -469,6 +470,10 @@ setup_i18n ()
                        language = wxLANGUAGE_ENGLISH;
                }
        }
+
+       if (locale) {
+               dvdomatic_setup_i18n (wx_to_std (locale->GetCanonicalName ()));
+       }
 }
 
 class App : public wxApp
@@ -483,15 +488,26 @@ class App : public wxApp
                unsetenv ("UBUNTU_MENUPROXY");
 #endif         
 
-               /* This needs to be before setup_i18n, as setup_i18n() will
-                  create a Config object, which needs Scalers to have
-                  been created.
+               wxInitAllImageHandlers ();
+
+               /* Enable i18n; this will create a Config object
+                  to look for a force-configured language.  This Config
+                  object will be wrong, however, because dvdomatic_setup
+                  hasn't yet been called and there aren't any scalers, filters etc.
+                  set up yet.
+               */
+               setup_i18n ();
+
+               /* Set things up, including scalers / filters etc.
+                  which will now be internationalised correctly.
                */
                dvdomatic_setup ();
 
-               wxInitAllImageHandlers ();
-               setup_i18n ();
-               
+               /* Force the configuration to be re-loaded correctly next
+                  time it is needed.
+               */
+               Config::drop ();
+
                if (!film_to_load.empty() && boost::filesystem::is_directory (film_to_load)) {
                        try {
                                film.reset (new Film (film_to_load));