From 89a28180480966f21d0de1e7c4fcb368802ed658 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 24 Jan 2002 21:14:52 +0000 Subject: [PATCH 1/1] updates to XRC resources compiler git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/utils/wxrc/wxrc.cpp | 13 +++++++------ utils/wxrc/wxrc.cpp | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/contrib/utils/wxrc/wxrc.cpp b/contrib/utils/wxrc/wxrc.cpp index 9acaeef5e4..5ea1c7a477 100644 --- a/contrib/utils/wxrc/wxrc.cpp +++ b/contrib/utils/wxrc/wxrc.cpp @@ -87,7 +87,7 @@ int XmlResApp::OnRun() { wxCMD_LINE_SWITCH, "v", "verbose", "be verbose" }, { wxCMD_LINE_SWITCH, "c", "cpp-code", "output C++ source rather than .rsc file" }, { wxCMD_LINE_SWITCH, "u", "uncompressed", "do not compress .xml files (C++ only)" }, - { wxCMD_LINE_SWITCH, "g", "gettext", "output .po catalog (to stdout or file if -o used)" }, + { wxCMD_LINE_SWITCH, "g", "gettext", "output list of translatable strings (to stdout or file if -o used)" }, { wxCMD_LINE_OPTION, "n", "function", "C++ function name (with -c) [InitXmlResource]" }, { wxCMD_LINE_OPTION, "o", "output", "output file [resource.xrs/cpp]" }, { wxCMD_LINE_OPTION, "l", "list-of-handlers", "output list of neccessary handlers to this file" }, @@ -210,8 +210,9 @@ wxArrayString XmlResApp::PrepareTempFiles() FindFilesInXML(doc.GetRoot(), flist, path); - doc.Save(parOutputPath + "/" + name + ".xrc", flagCompress ? wxXML_IO_BINZ : wxXML_IO_BIN); - flist.Add(name + ".xrc"); + doc.Save(parOutputPath + "/" + name + ".xmlbin", + flagCompress ? wxXML_IO_BINZ : wxXML_IO_BIN); + flist.Add(name + ".xmlbin"); } return flist; @@ -393,10 +394,10 @@ void " + parFuncname + "()\n\ wxString name, ext, path; wxSplitPath(parFiles[i], &path, &name, &ext); file.Write(" wxXmlResource::Get()->Load(\"memory:xml_resource/" + - name + ".xrc" + "\");\n"); + name + ".xmlbin" + "\");\n"); } - file.Write("\n}\n"); + file.Write("}\n"); } @@ -412,7 +413,7 @@ void XmlResApp::OutputGettext() else fout.Open(parOutput, _T("wt")); for (size_t i = 0; i < str.GetCount(); i++) - fout.Write(_T("msgid \"") + str[i] + _T("\"\nmsgstr \"\"\n\n")); + fout.Write(_T("_(\"") + str[i] + _T("\")\n")); if (!parOutput) fout.Detach(); } diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 9acaeef5e4..5ea1c7a477 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -87,7 +87,7 @@ int XmlResApp::OnRun() { wxCMD_LINE_SWITCH, "v", "verbose", "be verbose" }, { wxCMD_LINE_SWITCH, "c", "cpp-code", "output C++ source rather than .rsc file" }, { wxCMD_LINE_SWITCH, "u", "uncompressed", "do not compress .xml files (C++ only)" }, - { wxCMD_LINE_SWITCH, "g", "gettext", "output .po catalog (to stdout or file if -o used)" }, + { wxCMD_LINE_SWITCH, "g", "gettext", "output list of translatable strings (to stdout or file if -o used)" }, { wxCMD_LINE_OPTION, "n", "function", "C++ function name (with -c) [InitXmlResource]" }, { wxCMD_LINE_OPTION, "o", "output", "output file [resource.xrs/cpp]" }, { wxCMD_LINE_OPTION, "l", "list-of-handlers", "output list of neccessary handlers to this file" }, @@ -210,8 +210,9 @@ wxArrayString XmlResApp::PrepareTempFiles() FindFilesInXML(doc.GetRoot(), flist, path); - doc.Save(parOutputPath + "/" + name + ".xrc", flagCompress ? wxXML_IO_BINZ : wxXML_IO_BIN); - flist.Add(name + ".xrc"); + doc.Save(parOutputPath + "/" + name + ".xmlbin", + flagCompress ? wxXML_IO_BINZ : wxXML_IO_BIN); + flist.Add(name + ".xmlbin"); } return flist; @@ -393,10 +394,10 @@ void " + parFuncname + "()\n\ wxString name, ext, path; wxSplitPath(parFiles[i], &path, &name, &ext); file.Write(" wxXmlResource::Get()->Load(\"memory:xml_resource/" + - name + ".xrc" + "\");\n"); + name + ".xmlbin" + "\");\n"); } - file.Write("\n}\n"); + file.Write("}\n"); } @@ -412,7 +413,7 @@ void XmlResApp::OutputGettext() else fout.Open(parOutput, _T("wt")); for (size_t i = 0; i < str.GetCount(); i++) - fout.Write(_T("msgid \"") + str[i] + _T("\"\nmsgstr \"\"\n\n")); + fout.Write(_T("_(\"") + str[i] + _T("\")\n")); if (!parOutput) fout.Detach(); } -- 2.45.2