[DOC++] patch to improve translatability of doc++
Brought to you by:
adragos
|
From: Junichi U. <da...@ne...> - 2003-06-04 15:59:57
|
Package: doc++
Version: 3.4.10-1
Hi,
I've got the following patch to add more strings to be translated by
doc++, so that it looks better in Japanese at least.
diff -ur --exclude po doc++-3.4.10-orig/src/doc.h doc++-3.4.10/src/doc.h
--- doc++-3.4.10-orig/src/doc.h 2002-12-23 01:03:54.000000000 +0900
+++ doc++-3.4.10/src/doc.h 2003-06-05 00:50:29.000000000 +0900
@@ -36,8 +36,10 @@
#include <gettext.h>
#ifdef ENABLE_NLS
#define _(x) gettext(x)
+#define N_(x) (x)
#else
#define _(x) (x)
+#define N_(x) (x)
#endif
#define DOCXX_VERSION "3.4.10"
diff -ur --exclude po doc++-3.4.10-orig/src/html.cc doc++-3.4.10/src/html.cc
--- doc++-3.4.10-orig/src/html.cc 2001-02-17 15:34:49.000000000 +0900
+++ doc++-3.4.10/src/html.cc 2003-06-05 00:55:12.000000000 +0900
@@ -1025,16 +1025,16 @@
int sec;
const char *name;
} toc_sections[] = {
- { MANUAL_SEC, "General stuff" },
- { PACKAGE_SEC, "Packages" },
- { NAMESPACE_SEC, "Namespaces" },
- { CLASS_SEC, "Classes" },
- { INTERFACE_SEC, "Interfaces" },
- { FUNCTION_SEC, "Functions" },
- { VARIABLE_SEC, "Variables" },
- { MACRO_SEC, "Macros" },
- { UNION_SEC, "Enums, Unions, Structs" },
- { TYPEDEF_SEC, "Typedefs" },
+ { MANUAL_SEC, N_("General stuff") },
+ { PACKAGE_SEC, N_("Packages") },
+ { NAMESPACE_SEC, N_("Namespaces") },
+ { CLASS_SEC, N_("Classes") },
+ { INTERFACE_SEC, N_("Interfaces") },
+ { FUNCTION_SEC, N_("Functions") },
+ { VARIABLE_SEC, N_("Variables") },
+ { MACRO_SEC, N_("Macros") },
+ { UNION_SEC, N_("Enums, Unions, Structs") },
+ { TYPEDEF_SEC, N_("Typedefs") },
{ 0, 0 }
};
@@ -1079,7 +1079,7 @@
if(list.size() > 0)
{
list.sort();
- fprintf(f, "<H2>%s</H2>\n", toc_sections[k].name);
+ fprintf(f, "<H2>%s</H2>\n", gettext(toc_sections[k].name));
fprintf(f, "<UL>\n");
list.write(f);
fprintf(f, "</UL>\n");
With the modification, the following ja.po will be useful,
and translates the 'sections' as well.
|