# # # add_file "win32/monotone.bmp" # content [4f53f0f7b1c6e03022a40f78065a7d1c9b9e9839] # # patch "monotone.cc" # from [c1d774218a91a191fcd1894c3fc02c9aa0747dcf] # to [dfd2095b9dbb68075936270c14e156e8a51db951] # # patch "platform.hh" # from [aa2f74b91132218c53c92c035a177893b56a75c6] # to [8d9be396f1a2d884491c63d92cf5c517145cab13] # # patch "po/README" # from [ebb75dd82462e713d68ef0a67de219e34fba51ba] # to [943ac90a5246af1cf8efa60848d63742d8d2e134] # # patch "tests/empty_environment/__driver__.lua" # from [4e70feabad49fb196e7637136cd66b5a4f54b59d] # to [1158e796db5bd4491f57e9b548265a879fcaf161] # # patch "unix/fs.cc" # from [ba93ca82fc6f6012b20fa0b63c2f639a6857b820] # to [fe1c5d9156a335af645d9d3a1bffb7db1d9c13c7] # # patch "win32/fs.cc" # from [3ed47c90207bfa5ea03a07173303fbe7155103ea] # to [23054bb5ccc3f86053acf706610e941468679631] # # patch "win32/monotone.iss" # from [6c7d6275ca1d29ae6492832695f24de801c36d2d] # to [e22531c3497c99a5d66d53e477e4a1e9227cba1e] # # set "win32/monotone.bmp" # attr "mtn:manual_merge" # value "true" # ============================================================ # win32/monotone.bmp is binary ============================================================ --- monotone.cc c1d774218a91a191fcd1894c3fc02c9aa0747dcf +++ monotone.cc dfd2095b9dbb68075936270c14e156e8a51db951 @@ -37,6 +37,7 @@ #include "paths.hh" #include "sha1.hh" #include "simplestring_xform.hh" +#include "platform.hh" using std::cout; using std::cerr; @@ -118,7 +119,7 @@ void localize_monotone() if (!init) { setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); + bindtextdomain(PACKAGE, get_locale_dir().c_str()); textdomain(PACKAGE); init = 1; } ============================================================ --- platform.hh aa2f74b91132218c53c92c035a177893b56a75c6 +++ platform.hh 8d9be396f1a2d884491c63d92cf5c517145cab13 @@ -134,6 +134,9 @@ double cpu_now(); // arbitrary constant, measured in seconds. double cpu_now(); +// determine directory to load locale data from +std::string get_locale_dir(); + #ifdef WIN32_PLATFORM #include "win32/ssh_agent_platform.hh" #else ============================================================ --- po/README ebb75dd82462e713d68ef0a67de219e34fba51ba +++ po/README 943ac90a5246af1cf8efa60848d63742d8d2e134 @@ -9,7 +9,7 @@ Now the step-by-step HOWTO: Now the step-by-step HOWTO: -I) Edit the file po/LINGUAS a new entry for your language. +1) Edit the file po/LINGUAS a new entry for your language. The language code has the format ISO 639-1 (e.g. "en" for English, "de" for German, aso.) - if your language differs by region, you can also expand the language code @@ -18,10 +18,14 @@ I) Edit the file po/LINGUAS a new entry in Great Britain (BE), while "en_US" determines American English (AE). -II) Configure monotone +2) Add an entry for the translation into win32/monotone.iss + so that it is included in future Win32 installer + packages. + +3) Configure monotone $ cd net.venge.monotone - $ aclocal && autoreconf --install + $ autoreconf --install $ ./configure $ ( cd po; make monotone.pot-update ) @@ -30,7 +34,7 @@ II) Configure monotone language code you've entered in LINGUAS), and continue with III). -III) Edit the header of your new language po according to +4) Edit the header of your new language po according to the excellent HOWTO here [0]. Of particular interest are mainly two things: @@ -46,16 +50,16 @@ III) Edit the header of your new languag what to write here, take a look at the gettext manual here [1]. -IV) Start translating the entries. If you like to update your - *.po file, trigger the following command (here for the - German translation): +5) Start translating the entries. If you like to update your + *.po file, trigger the following command (here for the + German translation): - $ cd po - $ make monotone.pot-update && make MSGMERGE=msgmerge de.po-update + $ cd po + $ make monotone.pot-update && make MSGMERGE=msgmerge de.po-update - To check if new or fuzzy strings have arrived, use msgfmt: + To check if new or fuzzy strings have arrived, use msgfmt: - $ msgfmt -cv po/de.po + $ msgfmt -cv po/de.po Thats it basically. If you're looking for a nice GUI to edit ============================================================ --- tests/empty_environment/__driver__.lua 4e70feabad49fb196e7637136cd66b5a4f54b59d +++ tests/empty_environment/__driver__.lua 1158e796db5bd4491f57e9b548265a879fcaf161 @@ -8,8 +8,10 @@ if ostype == "Windows" then if ostype == "Windows" then local iconv = getpathof("libiconv-2", ".dll") + local intl = getpathof("libintl-8", ".dll") local zlib = getpathof("zlib1", ".dll") copy(iconv, "libiconv-2.dll") + copy(intl, "libintl-8.dll") copy(zlib, "zlib1.dll") elseif string.sub(ostype, 1, 6) == "CYGWIN" then local cygwin = getpathof("cygwin1", ".dll") ============================================================ --- unix/fs.cc ba93ca82fc6f6012b20fa0b63c2f639a6857b820 +++ unix/fs.cc fe1c5d9156a335af645d9d3a1bffb7db1d9c13c7 @@ -1,8 +1,10 @@ // copyright (C) 2005 nathaniel smith // all rights reserved. // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details +#include "config.h" + #include #include #include @@ -258,6 +260,11 @@ write_data_worker(std::string const & fn rename_clobberingly(tmp, fname); } +std::string +get_locale_dir() +{ + return std::string(LOCALEDIR); +} // Local Variables: // mode: C++ ============================================================ --- win32/fs.cc 3ed47c90207bfa5ea03a07173303fbe7155103ea +++ win32/fs.cc 23054bb5ccc3f86053acf706610e941468679631 @@ -1,8 +1,10 @@ // copyright (C) 2005 nathaniel smith // all rights reserved. // licensed to the public under the terms of the GNU GPL (>= 2) // see the file COPYING for details +#include "config.h" + #define WIN32_LEAN_AND_MEAN #include #include @@ -352,6 +354,19 @@ write_data_worker(std::string const & fn } +std::string +get_locale_dir() +{ + char buffer[4096]; + DWORD result = GetModuleFileName(NULL, buffer, sizeof(buffer)); + I(result != sizeof(buffer)); // ran out of buffer space + I(result != 0); // some other error + std::string module(buffer); + std::string::size_type pos = module.find_last_of('\\'); + I(pos != std::string::npos); + return module.substr(0, pos) + "/locale"; +} + // Local Variables: // mode: C++ // fill-column: 76 ============================================================ --- win32/monotone.iss 6c7d6275ca1d29ae6492832695f24de801c36d2d +++ win32/monotone.iss e22531c3497c99a5d66d53e477e4a1e9227cba1e @@ -20,9 +20,17 @@ Source: "..\html\*.*"; DestDir: "{app}\d [Files] Source: "..\mtn.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "..\html\*.*"; DestDir: "{app}\documentation"; Flags: ignoreversion +Source: "..\figures\*.png"; DestDir: "{app}\documentation\figures"; Flags: ignoreversion Source: "..\COPYING"; DestDir: "{app}"; Flags: ignoreversion -Source: "..\figures\*.png"; DestDir: "{app}\documentation\figures"; Flags: ignoreversion +Source: "..\po\de.gmo"; DestDir: "{app}\locale\de\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\es.gmo"; DestDir: "{app}\locale\es\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\fr.gmo"; DestDir: "{app}\locale\fr\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\it.gmo"; DestDir: "{app}\locale\it\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\ja.gmo"; DestDir: "{app}\locale\ja\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\pt_BR.gmo"; DestDir: "{app}\locale\pt_BR\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion +Source: "..\po\sv.gmo"; DestDir: "{app}\locale\sv\LC_MESSAGES"; DestName: "monotone.mo"; Flags: ignoreversion Source: "\mingw\bin\libiconv-2.dll"; DestDir: "{app}" +Source: "\mingw\bin\libintl-8.dll"; DestDir: "{app}" Source: "\mingw\bin\zlib1.dll"; DestDir: "{app}" [Tasks]