summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-21 16:31:48 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-21 16:31:48 +0000
commit1c207805aef4443c5fb6c102e5be8a5b50002868 (patch)
tree97748387388a2a7a644daa0d54a0dfc06bc35f1e /src
parentf94ed8f663a5ce6e55484c10dcade6d7b7d2e5ed (diff)
Add Manual Acevedo's initial Spanish translation. Hopefully finally fix up translations on Windows.
Diffstat (limited to 'src')
-rw-r--r--src/lib/config.cc7
-rw-r--r--src/lib/config.h1
-rw-r--r--src/lib/util.cc27
-rw-r--r--src/lib/util.h4
-rw-r--r--src/tools/dvdomatic.cc32
-rw-r--r--src/tools/po/es_ES.po117
6 files changed, 174 insertions, 14 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index ad132437a..5dce3748d 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -167,3 +167,10 @@ Config::default_directory_or (string a) const
return _default_directory;
}
+
+void
+Config::drop ()
+{
+ delete _instance;
+ _instance = 0;
+}
diff --git a/src/lib/config.h b/src/lib/config.h
index 0e9c4a60a..ee46166e6 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -169,6 +169,7 @@ public:
void write () const;
static Config* instance ();
+ static void drop ();
private:
Config ();
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 03c1f43dd..593d0e760 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -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.
diff --git a/src/lib/util.h b/src/lib/util.h
index 60498be5a..3d251cf06 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -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;
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc
index aa936523d..4a778100c 100644
--- a/src/tools/dvdomatic.cc
+++ b/src/tools/dvdomatic.cc
@@ -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
index 000000000..78eecb306
--- /dev/null
+++ b/src/tools/po/es_ES.po
@@ -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."