# # patch "ChangeLog" # from [38d4db7648f8505f1c91811592d1e88af8570428] # to [f119869c4fccae4bc126688d540d833890641703] # # patch "lua.cc" # from [fc053070a0c0a106e6f9a3e5678ef2a427ad1fcd] # to [99980ee71d865a747089c3cddfe9b2baa29aca03] # # patch "po/POTFILES.in" # from [bd06ee5116d53df04a0065e56e3a6ef2b7837d8c] # to [4d5f0163f7f56dce90515e2ea15edaca8daf790e] # # patch "std_hooks.lua" # from [3aa6ea33c6bbb6e43c63dd4ff8ed353f3b9d4ce3] # to [1bfbfb61d9ed33ab2cc2be5af65ac11f5bd28f07] # ======================================================================== --- ChangeLog 38d4db7648f8505f1c91811592d1e88af8570428 +++ ChangeLog f119869c4fccae4bc126688d540d833890641703 @@ -1,5 +1,11 @@ 2005-09-22 Benoît Dejean + * lua.cc (monotone_gettext_for_lua): New function. + * po/POTFILES.in: Added std_hooks.lua. + * std_hooks.lua: One more string for i18n. + +2005-09-22 Benoît Dejean + * ui.{cc,hh} (get_user_locale): Returns a const &. 2005-09-21 Timothy Brownawell ======================================================================== --- lua.cc fc053070a0c0a106e6f9a3e5678ef2a427ad1fcd +++ lua.cc 99980ee71d865a747089c3cddfe9b2baa29aca03 @@ -609,6 +609,14 @@ lua_pushboolean(L, boost::regex_search(str, what, boost::regex(re))); return 1; } + + static int + monotone_gettext_for_lua(lua_State *L) + { + const char *msgid = lua_tostring(L, -1); + lua_pushstring(L, gettext(msgid)); + return 1; + } } @@ -638,6 +646,7 @@ lua_register(st, "guess_binary_file_contents", monotone_guess_binary_file_contents_for_lua); lua_register(st, "include", monotone_include_for_lua); lua_register(st, "includedir", monotone_includedir_for_lua); + lua_register(st, "gettext", monotone_gettext_for_lua); // add regex functions: lua_newtable(st); ======================================================================== --- po/POTFILES.in bd06ee5116d53df04a0065e56e3a6ef2b7837d8c +++ po/POTFILES.in 4d5f0163f7f56dce90515e2ea15edaca8daf790e @@ -58,6 +58,7 @@ sanity.hh schema_migration.cc schema_migration.hh +std_hooks.lua transforms.cc transforms.hh txt2c.cc ======================================================================== --- std_hooks.lua 3aa6ea33c6bbb6e43c63dd4ff8ed353f3b9d4ce3 +++ std_hooks.lua 1bfbfb61d9ed33ab2cc2be5af65ac11f5bd28f07 @@ -189,7 +189,7 @@ io.close(tmp) if (execute(exe, tname) ~= 0) then - io.write(string.format("Error running editor '%s' to enter log message\n", + io.write(string.format(gettext("Error running editor '%s' to enter log message\n"), exe)) os.remove(tname) return nil