From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2976 invoked from network); 29 Sep 2004 11:15:33 -0000 Received: from unknown (HELO lists.gnu.org) (199.232.76.165) by sourceware.org with SMTP; 29 Sep 2004 11:15:33 -0000 Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CCcX7-0001mw-Lo for listarch-gnats-devel@sources.redhat.com; Wed, 29 Sep 2004 07:22:05 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CCcX2-0001md-7z for help-gnats@gnu.org; Wed, 29 Sep 2004 07:22:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CCcX1-0001lx-CU for help-gnats@gnu.org; Wed, 29 Sep 2004 07:21:59 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CCcX1-0001lC-5P for help-gnats@gnu.org; Wed, 29 Sep 2004 07:21:59 -0400 Received: from [195.138.79.154] (helo=relay.apk.od.ua) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CCcQ8-0002Mz-By for help-gnats@gnu.org; Wed, 29 Sep 2004 07:15:03 -0400 Received: from nostromo.holding.local (nostromo.holding.local [10.1.1.8]) by relay.apk.od.ua (8.12.11/8.12.11) with SMTP id i8TBEmtc024847 for ; Wed, 29 Sep 2004 14:14:48 +0300 (EEST) Date: Wed, 29 Sep 2004 18:10:00 -0000 From: "Mike M. Volokhov" To: help-gnats@gnu.org Message-Id: <20040929141447.6207c085.mishka@apk.od.ua> Organization: Insakharprom-K, Ltd. X-Mailer: Sylpheed version 0.9.12-gtk2-20040617 (GTK+ 2.4.4; i386--netbsdelf) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__29_Sep_2004_14_14_47_+0300_Pr3kv4Yk=FkS929f" X-Virus-Scanned: clamd / ClamAV version 0.72, clamav-milter version 0.72 on relay.apk.od.ua X-Virus-Status: Clean Subject: Gnats{web} localization X-BeenThere: help-gnats@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General discussion about GNU GNATS List-Archive: List-Post: List-Help: List-Subscribe: , Sender: help-gnats-bounces+listarch-gnats-devel=sources.redhat.com@gnu.org Errors-To: help-gnats-bounces+listarch-gnats-devel=sources.redhat.com@gnu.org X-SW-Source: 2004-q3/txt/msg00088.txt.bz2 This is a multi-part message in MIME format. --Multipart=_Wed__29_Sep_2004_14_14_47_+0300_Pr3kv4Yk=FkS929f Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-length: 2747 Greetings! I've looked to problem tracking tool and choose the Gnats due to it lightweight, modular, and robust backend. I'm newbie to Gnats installation and administration. So when I've tried to deploy the PR database (Gnats 4.0) on my corporate support site, I'm faced with l12n and i18n problems. Gnats and Gnatsweb seems doesn't support non-english messages at all, but my users are speaking Russian. First, I need at least correct handling of non-ASCII characters. Fortunately, Gnats tools uses is*() ctype functions and was linked against libintl library (I'm use NetBSD), thus it correctly operates on any 8-bit characters (16-bit ones should processed as two 8-bit chars). But one problem still pursuit me - the e-mail notifications: 1) Subject fileld must be MIME encoded. 2) Message must contain charset specification. So as my time was limited, I've just changed header{} at mail-format{} section as follows: header { format "Content-Type: text/plain; charset=koi8-r\nSubject: Re: %s/%s\n" fields { "Category" "Number" } } I.e. Subject now doesn't contains synopsis text, and message have a Content-Type field. Next, briefly looking over the code and documentation of gnatsweb.pl, I'm found it was not really designed for non-english sites. Thus, two new variables should fix this problem for me: site_html_language - the language for returned web pages site_html_charset - the charset for Content-Type Depending on that variables (which had set values to "en-US" and "ISO-8859-1" respectively) Gnatsweb now adds all corresponded headers where needed. These variables are overridable from gnatsweb-site.pl. Please see a patch provided in attachment. Second, I need complete localization for Gnats. I.e. all messages, field names, categories and so on should be easy changed by site's own values on any preferred language. I'm personally have two ideas for this: 1) Add yet another field to Gnats PR structure: ">Encoding:". The Gnats will use UTF-8, for example, as internal charset encoding. An encoding for any newly arrived PR will be easy determined by this field and autoconverted to UTF-8 using iconv library. User tools shoud specify encoding when talking to gnatsd or when fetching PR in any way. The directive "gnats-encoding" should be affected to all Gnats internal data described below (field names, ...) 2) Use XML as internal format for database processing. This allows use power and simplicity of XML i18n. Indifferently to solution choosed, user tools must be adopted to this behaviour (supplying and querying encoding values and so on). Now I have a time to work on any of those (or any other) solution in way to Gnats localization. Any comments would be appreciated. -- TIA, Mishka. --Multipart=_Wed__29_Sep_2004_14_14_47_+0300_Pr3kv4Yk=FkS929f Content-Type: text/plain; name="gnatsweb.pl.patch" Content-Disposition: attachment; filename="gnatsweb.pl.patch" Content-Transfer-Encoding: quoted-printable Content-length: 2573 --- gnatsweb.pl.orig Tue Sep 21 09:28:34 2004 +++ gnatsweb.pl Wed Sep 29 12:32:01 2004 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/pkg/bin/perl -w # # Gnatsweb - web front-end to GNATS # @@ -39,6 +39,8 @@ $global_cookie_expires $global_cookie_path $textwidth $site_allow_remote_debug $attachment_delimiter %mark_urls $gnats_info_top %site_pr_submission_address $VERSION); +# Addon for Gnatsweb localization, overridable from gnatsweb-site.pl too +use vars qw($site_html_language $site_html_charset); =20 # dynamic configuration switches, set during initial gnatsd # communication and general setup @@ -93,6 +95,10 @@ # released, you won't need to edit them again. # =20 +# Internationalization. +$site_html_language =3D 'en-US'; +$site_html_charset =3D 'ISO-8859-1'; + # Info about your gnats host. $site_gnats_host =3D 'localhost'; $site_gnats_port =3D 1529; @@ -984,7 +990,7 @@ # in the expected way. It needs a content-disposition of "file". ($ENV{'HTTP_USER_AGENT'} =3D~ "MSIE 5.5") ? ($disp =3D 'file') : ($disp = =3D 'attachment'); # Now serve the attachment, with the appropriate headers. - print_header(-type =3D> 'application/octet-stream', + print_generic_header(-type =3D> 'application/octet-stream', -content_disposition =3D> "$disp; filename=3D\"$$hash_ref{'= filename'}\""); print $$hash_ref{'data'}; } @@ -3002,10 +3008,10 @@ $val; } =20 -# print_header - +# print_generic_header - # Print HTTP header unless it's been printed already. # -sub print_header +sub print_generic_header { # Protect against multiple calls. return if $print_header_done; @@ -3014,6 +3020,17 @@ print $q->header(@_); } =20 +# print_header - +# Print HTTP header for HTML pages +sub print_header +{ + my @header_opts =3D @_; + push(@header_opts, -charset =3D> $site_html_charset) + if (defined $site_html_charset); + + print_generic_header(@header_opts); +} + # page_start_html - # # Print the HTML which starts off each page (...).= =20=20 @@ -3049,6 +3066,11 @@ =20 # Call start_html, with -bgcolor if we need to override that. my @args =3D (-title=3D>"$title - $site_banner_text"); + push(@args, -head=3D>$q->meta({-http_equiv=3D>'Content-Type', + -content=3D>"text/html; charset=3D$site_html_charset"})) + if defined($site_html_charset); + push(@args, -lang=3D>$site_html_language) + if defined($site_html_language); push(@args, -bgcolor=3D>$site_background) if defined($site_background); push(@args, -style=3D>{-src=3D>$site_stylesheet}) --Multipart=_Wed__29_Sep_2004_14_14_47_+0300_Pr3kv4Yk=FkS929f Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 140 _______________________________________________ Help-gnats mailing list Help-gnats@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnats --Multipart=_Wed__29_Sep_2004_14_14_47_+0300_Pr3kv4Yk=FkS929f--