Add Manual Acevedo's initial Spanish translation. Hopefully finally fix up translati...
authorCarl Hetherington <cth@carlh.net>
Thu, 21 Mar 2013 16:31:48 +0000 (16:31 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 21 Mar 2013 16:31:48 +0000 (16:31 +0000)
src/lib/config.cc
src/lib/config.h
src/lib/util.cc
src/lib/util.h
src/tools/dvdomatic.cc
src/tools/po/es_ES.po [new file with mode: 0644]
windows/installer.nsi.32.in
windows/installer.nsi.64.in
wscript

index ad132437a02ac0b47707c659455a1eeda107687c..5dce3748d72c4c7bd75df294858e945301e42637 100644 (file)
@@ -167,3 +167,10 @@ Config::default_directory_or (string a) const
 
        return _default_directory;
 }
+
+void
+Config::drop ()
+{
+       delete _instance;
+       _instance = 0;
+}
index 0e9c4a60aed4ade7c699b949823625ddedf7bdfa..ee46166e6d9809e4a098dcba15175f25509f459f 100644 (file)
@@ -169,6 +169,7 @@ public:
        void write () const;
 
        static Config* instance ();
+       static void drop ();
 
 private:
        Config ();
index 03c1f43dd2902e6ade9517bc116c97eef56ed106..593d0e76043953abc1f306ac12c29f33d6ef43db 100644 (file)
@@ -246,17 +246,36 @@ dvdomatic_setup ()
        ui_thread = this_thread::get_id ();
 }
 
+#ifdef DVDOMATIC_WINDOWS
+boost::filesystem::path
+mo_path ()
+{
+       wchar_t buffer[512];
+       GetModuleFileName (0, buffer, 512 * sizeof(wchar_t));
+       boost::filesystem::path p (buffer);
+       p = p.parent_path ();
+       p = p.parent_path ();
+       p /= "locale";
+       return p;
+}
+#endif
+
 void
 dvdomatic_setup_i18n (string lang)
 {
+       setlocale (LC_ALL, "");
+       textdomain ("libdvdomatic");
+       
 #ifdef DVDOMATIC_WINDOWS
        string const e = "LANGUAGE=" + lang;
        putenv (e.c_str());
+
+       bindtextdomain ("libdvdomatic", mo_path().string().c_str());
 #endif
-       
-       setlocale (LC_ALL, "");
-       textdomain ("libdvdomatic");
-       bindtextdomain ("libdvdomatic", LOCALE_PREFIX);
+
+#ifdef DVDOMATIC_POSIX
+       bindtextdomain ("libdvdomatic", POSIX_LOCALE_PREFIX);
+#endif 
 }
 
 /** @param start Start position for the crop within the image.
index 60498be5a90a5ff762b886f2c314f7dad1d4d66c..3d251cf06ad0d1d9ca36816ea438fdd41d26a680 100644 (file)
@@ -30,6 +30,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/asio.hpp>
 #include <boost/optional.hpp>
+#include <boost/filesystem.hpp>
 #include <libdcp/util.h>
 extern "C" {
 #include <libavcodec/avcodec.h>
@@ -60,6 +61,9 @@ extern std::string md5_digest (std::string);
 extern std::string md5_digest (void const *, int);
 extern void ensure_ui_thread ();
 extern std::string audio_channel_name (int);
+#ifdef DVDOMATIC_WINDOWS
+extern boost::filesystem::path mo_path ();
+#endif
 
 typedef int SourceFrame;
 
index aa936523d30585f24611660a85425f07274d6f49..4a778100c8e657cb1537bae03e8515a44b178dc5 100644 (file)
@@ -416,10 +416,11 @@ private:
                info.SetDevelopers (authors);
 
                wxArrayString translators;
-               translators.Add (wxT ("Olivier Perriere (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 Acevedo"));
                info.SetTranslators (translators);
                
                info.SetWebSite (wxT ("http://carlh.net/software/dvdomatic"));
@@ -456,9 +457,9 @@ setup_i18n ()
        if (wxLocale::IsAvailable (language)) {
                locale = new wxLocale (language, wxLOCALE_LOAD_DEFAULT);
 
-#ifdef __WXGTK__
-               locale->AddCatalogLookupPathPrefix (wxT (LOCALE_PREFIX "/locale"));
-#endif
+#ifdef DVDOMATIC_WINDOWS
+               locale->AddCatalogLookupPathPrefix (std_to_wx (mo_path().string()));
+#endif         
 
                locale->AddCatalog (wxT ("libdvdomatic-wx"));
                locale->AddCatalog (wxT ("dvdomatic"));
@@ -485,15 +486,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));
diff --git a/src/tools/po/es_ES.po b/src/tools/po/es_ES.po
new file mode 100644 (file)
index 0000000..78eecb3
--- /dev/null
@@ -0,0 +1,117 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: DVDOMATIC\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-03-15 08:39+0000\n"
+"PO-Revision-Date: 2013-03-20 17:05-0500\n"
+"Last-Translator: Manuel AC <manuel.acevedo@civantos.>\n"
+"Language-Team: Manuel AC <manuel.acevedo@civantos.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.5\n"
+"Language: ES-ES\n"
+
+#: src/tools/dvdomatic.cc:177
+msgid "&Analyse audio"
+msgstr "&Analizar sonido"
+
+#: src/tools/dvdomatic.cc:183
+msgid "&Edit"
+msgstr "&Editar"
+
+#: src/tools/dvdomatic.cc:182
+msgid "&File"
+msgstr "&Archivo"
+
+#: src/tools/dvdomatic.cc:185
+msgid "&Help"
+msgstr "&Ayuda"
+
+#: src/tools/dvdomatic.cc:184
+msgid "&Jobs"
+msgstr "&Tareas"
+
+#: src/tools/dvdomatic.cc:173
+msgid "&Make DCP"
+msgstr "&Hacer DCP"
+
+#: src/tools/dvdomatic.cc:161
+msgid "&Open..."
+msgstr "&Abrir..."
+
+#: src/tools/dvdomatic.cc:170
+msgid "&Preferences..."
+msgstr "&Preferencias..."
+
+#: src/tools/dvdomatic.cc:165
+msgid "&Properties..."
+msgstr "&Propiedades..."
+
+#: src/tools/dvdomatic.cc:167
+msgid "&Quit"
+msgstr "&Salir"
+
+#: src/tools/dvdomatic.cc:163
+msgid "&Save"
+msgstr "&Guardar"
+
+#: src/tools/dvdomatic.cc:174
+msgid "&Send DCP to TMS"
+msgstr "&Enviar DCP al TMS"
+
+#: src/tools/dvdomatic.cc:409
+msgid ""
+"(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen"
+msgstr ""
+"(C) 2012-2013 Carl Hetherington, Terrence Meiczinger, Paul Davis, Ole Laursen"
+
+#: src/tools/dvdomatic.cc:180
+msgid "About"
+msgstr "Acerca de"
+
+#: src/tools/dvdomatic.cc:497
+msgid "Could not load film %1 (%2)"
+msgstr "No se pudo cargar la película %1 (%2)"
+
+#: src/tools/dvdomatic.cc:331
+#, c-format
+msgid "Could not open film at %s (%s)"
+msgstr "No se pudo cargar la película en %s (%s)"
+
+#: src/tools/dvdomatic.cc:287 src/tools/dvdomatic.cc:402
+#: src/tools/dvdomatic.cc:501
+msgid "DVD-o-matic"
+msgstr "DVD-o-matic"
+
+#: src/tools/dvdomatic.cc:75
+msgid "Film changed"
+msgstr "Película cambiada"
+
+#: src/tools/dvdomatic.cc:408
+msgid "Free, open-source DCP generation from almost anything."
+msgstr ""
+"Generación de DCP a partir de casi cualquier fuente, libre y de código "
+"abierto."
+
+#: src/tools/dvdomatic.cc:160
+msgid "New..."
+msgstr "Nuevo..."
+
+#: src/tools/dvdomatic.cc:175
+msgid "S&how DCP"
+msgstr "&Mostrar DCP"
+
+#: src/tools/dvdomatic.cc:319
+msgid "Select film to open"
+msgstr "Selecciona la película a abrir"
+
+#: src/tools/dvdomatic.cc:303
+#, c-format
+msgid "The directory %s already exists."
+msgstr "La carpeta %s ya existe."
index b79703ff1fa6968f8328fbb7f603c9bb4ed5a4c1..b2bb2f3a99b8aa7b4e3f0c3b6afffd99800cc04e 100644 (file)
@@ -93,14 +93,16 @@ File "%deps%/etc/ImageMagick/delegates.xml"
 SetOutPath "$PROFILE\.magick"
 File "%deps%/etc/ImageMagick/delegates.xml"
 
-SetOutPath "$INSTDIR\locale\fr_FR"
+SetOutPath "$INSTDIR\locale\fr\LC_MESSAGES"
 File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo"
-SetOutPath "$INSTDIR\locale\it_IT"
+SetOutPath "$INSTDIR\locale\it\LC_MESSAGES"
 File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo"
+SetOutPath "$INSTDIR\locale\es\LC_MESSAGES"
+File "%binaries%/src/tools/mo/es_ES/dvdomatic.mo"
 
 CreateShortCut "$DESKTOP\DVD-o-matic.lnk" "$INSTDIR\bin\dvdomatic.exe" ""
 CreateShortCut "$DESKTOP\DVD-o-matic encode server.lnk" "$INSTDIR\bin\servomatic_gui.exe" ""
index 21980e61ad48a698868f066262773b3f7971283f..92117859106e9d330567c03d39d925cc6370a1b6 100644 (file)
@@ -103,11 +103,11 @@ File "%deps%/etc/ImageMagick/delegates.xml"
 SetOutPath "$PROFILE\.magick"
 File "%deps%/etc/ImageMagick/delegates.xml"
 
-SetOutPath "$INSTDIR\locale\fr_FR"
+SetOutPath "$INSTDIR\locale\fr\LC_MESSAGES"
 File "%binaries%/src/lib/mo/fr_FR/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/fr_FR/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/fr_FR/dvdomatic.mo"
-SetOutPath "$INSTDIR\locale\it_IT"
+SetOutPath "$INSTDIR\locale\it\LC_MESSAGES"
 File "%binaries%/src/lib/mo/it_IT/libdvdomatic.mo"
 File "%binaries%/src/wx/mo/it_IT/libdvdomatic-wx.mo"
 File "%binaries%/src/tools/mo/it_IT/dvdomatic.mo"
diff --git a/wscript b/wscript
index 24ebfe548ff4449c857789e2905d02ca2b6e91f0..612abdf223ea2be0f7e2895406803a91d38020c2 100644 (file)
--- a/wscript
+++ b/wscript
@@ -26,7 +26,6 @@ def configure(conf):
 
     if conf.options.target_windows:
         conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE'])
-        conf.env.append_value('CXXFLAGS', '-DLOCALE_PREFIX="../locale"')
         wxrc = os.popen('wx-config --rescomp').read().split()[1:]
         conf.env.append_value('WINRCFLAGS', wxrc)
         if conf.options.enable_debug:
@@ -37,7 +36,7 @@ def configure(conf):
         boost_thread = 'boost_thread_win32-mt'
     else:
         conf.env.append_value('CXXFLAGS', '-DDVDOMATIC_POSIX')
-        conf.env.append_value('CXXFLAGS', '-DLOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX'])
+        conf.env.append_value('CXXFLAGS', '-DPOSIX_LOCALE_PREFIX="%s/share/locale"' % conf.env['PREFIX'])
         boost_lib_suffix = ''
         boost_thread = 'boost_thread'
         conf.env.append_value('LINKFLAGS', '-pthread')