Bug#422348: Fwd: Bug#422348: xchm: Make the greeting translatable

2007-06-22 Thread Kartik Mistry

For Our Information..

-- Kartik Mistry

-- Forwarded message --
From: Razvan Cojocaru [EMAIL PROTECTED]
Date: Jun 23, 2007 3:59 AM
Subject: Re: Bug#422348: xchm: Make the greeting translatable
To: Kartik Mistry [EMAIL PROTECTED]

Hello. Thanks for your continued interest in xCHM.

I've already explained this to Igor: support for internationalization of
HTML pages is difficult for the following reasons:

1. Moving the HTML out into the hands of the user makes it prone to HTML
errors (i.e. a translator can mess up the tags). This is an obvious problem,
and perhaps not the most serious one.

2. Translating a HTML page is _very_different_ from translating regular GUI
stuff with gettext. Special characters have different representations under
gettext than in HTML, and most non-English languages employ such characters.

3. Technically speaking, I could have left the intro screen blank.
Displaying an intro page is not very much unlike displaying the home page of
a CHM document. Should we go ahead and export all HTML pages of all the
books xCHM displays, so that translators can translate them in their
language?

The patch you've just submitted is trivial. My main problem was not that it
was impossible to take the HTML part out for translators, but that the HTML
can easily be broken, especially by a translator used to the gettext way of
handling special characters (or HTML :-)). Igor himself, who for some reason
seems to have made this into a personal crusade, didn't seem to realize at
the time of our direct conversation that gettextized translations don't
apply to HTML directly (and note that the actual Romanian translation of the
HTML code is absent from the patch).

I stand by my initial decision, but I hope that this time I was better at
explaining my reasons for it. I'm not comfortable with allowing translators
to mess with my nice little HTML English greeting, and I will _not_ include
the patch in the next (or any, for that matter) version of xCHM. But,
obviously, xCHM being GPL and all that, you're welcome to maintain any
number of patches you see fit for your particular Linux distribution, it's
been done before.

Thanks for your time.

- Original Message -
From: Kartik Mistry [EMAIL PROTECTED]
To: Razvan Cojocaru [EMAIL PROTECTED]
Sent: Friday, June 22, 2007 6:28 PM
Subject: Fwd: Bug#422348: xchm: Make the greeting translatable


Hi,

Is it possible to use this patch to in next xchm release, please?
Patch is attached. Let me know..



--

Kartik Mistry  | Eng: kartikmistry.org/blog
0xD1028C8D | Guj: kartikm.wordpress.com



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#422348: xchm: Make the greeting translatable

2007-06-17 Thread Igor Stirbu
Package: xchm
Version: 2:1.13-4
Followup-For: Bug #422348

Hello,

I've attached the patch for xchm that will make the
greeting and about messages translatable.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21.5 (PREEMPT)
Locale: LANG=ro_RO.UTF-8, LC_CTYPE=ro_RO.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xchm depends on:
ii  libc6   2.5-10   GNU C Library: Shared libraries
ii  libchm1 2:0.39-4 library for dealing with Microsoft
ii  libgcc1 1:4.2-20070609-1 GCC support library
ii  libstdc++6  4.2-20070609-1   The GNU Standard C++ Library v3
ii  libwxbase2.6-0  2.6.3.2.1.5  wxBase library (runtime) - non-GUI
ii  libwxgtk2.6-0   2.6.3.2.1.5  wxWidgets Cross-platform C++ GUI t

xchm recommends no packages.

-- no debconf information
diff --git a/xchm-1.13/src/chmframe.cpp b/xchm-1.13/src/chmframe.cpp
index 5ccc5ff..48bca38 100644
--- a/xchm-1.13/src/chmframe.cpp
+++ b/xchm-1.13/src/chmframe.cpp
@@ -60,7 +60,17 @@
 
 namespace {
 
-const wxChar *greeting = wxT(
+const wxChar *use_unicode =
+#if !defined(wxUSE_UNICODE) || !wxUSE_UNICODE
+   _(brbrBWARNING/B: your BxCHM/B binary is linked against a 
+   non-Unicode version of wxWidgets! While it will work with most 
+   CHMs, it might not properly display special character languages.
+#else
+   _(
+#endif
+);
+
+const wxChar *greeting_start = _(
htmlbodytable border=0trtd align=\left\
img src=\memory:logo.xpm\/tdtd align=\left\
Hello, and welcome to BxCHM/B, the UNIX CHM viewer.
@@ -80,12 +90,9 @@ const wxChar *greeting = wxT(
 Pabs' TTGPL/TTd TTchmdeco/TT code.brbrIf
 you'd like to use the code in your own stuff please figure
 TTGPL/TT out first. Far too many people think the TTGPL/TT 
-   is bad out of utter ignorance.
-#if !defined(wxUSE_UNICODE) || !wxUSE_UNICODE
-   brbrBWARNING/B: your BxCHM/B binary is linked against a 
-   non-Unicode version of wxWidgets! While it will work with most 
-   CHMs, it might not properly display special character languages.
-#endif
+   is bad out of utter ignorance.);
+
+const wxChar *greeting_end = _(
brbrTips:brulli
The global search is an \'AND\' search, i.e. searching for
 \'word1 word2\' (quotes not included) will find all the pages
@@ -98,12 +105,10 @@ const wxChar *greeting = wxT(
 common options./li/ulbrbrCtrl(cmd)-C is copy,
 Ctrl(cmd)-F is find in page.brbrEnjoy./body/html);
 
-
-const wxChar *error_page = wxT(
+const wxChar *error_page = _(
htmlbodyError loading CHM file!/body/html);
 
-
-const wxChar *about_txt = wxT(
+const wxChar *about_txt = _(
xCHM v.  VERSION \nby Razvan Cojocaru [EMAIL PROTECTED]\n\n
With thanks to Pabs (http://bonedaddy.net/pabs3/hhm/).\n
Based on Jed Wing's CHMLIB (http://66.93.236.84/~jedwin/projects/).\n
@@ -165,6 +170,8 @@ CHMFrame::CHMFrame(const wxString title, const wxString 
booksDir,
wxBitmap bitmap(logo_xpm);
wxMemoryFSHandler::AddFile(wxT(logo.xpm), bitmap, //wxBITMAP(logo), 
   wxBITMAP_TYPE_XPM);
+   wxString greeting;
+   greeting  greeting_start  use_unicode  greeting_end;
wxMemoryFSHandler::AddFile(wxT(about.html), greeting);
wxMemoryFSHandler::AddFile(wxT(error.html), error_page);