Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 27709 invoked from network); 17 Apr 2006 12:30:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Apr 2006 12:30:23 -0000 Received: (qmail 39246 invoked by uid 500); 17 Apr 2006 12:30:22 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 38766 invoked by uid 500); 17 Apr 2006 12:30:20 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 38754 invoked by uid 99); 17 Apr 2006 12:30:19 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2006 05:30:19 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [216.191.214.243] (HELO mailwn.dainty.ca) (216.191.214.243) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2006 05:30:19 -0700 Received: from gentoo-server (gentoo-server.dainty.ca [192.168.202.201]) by mailwn.dainty.ca (8.12.9/8.12.9) with ESMTP id k3HCE3Gi017825 for ; Mon, 17 Apr 2006 08:14:03 -0400 Received: from testip.dainty.ca (testip.dainty.ca [192.168.202.160]) by gentoo-server (8.12.11/8.12.11) with ESMTP id k3HCTvvj011467 for ; Mon, 17 Apr 2006 08:29:58 -0400 From: Adrien Guillon Organization: Dainty Foods (a Division of MRRM Canada Inc.) To: dev@cocoon.apache.org Subject: [Proposal] i18n Transformer: Support Multiple Languages in One Document Date: Mon, 17 Apr 2006 08:30:33 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604170830.33518.guila@dainty.ca> X-Virus-Scanned: ClamAV version 0.88.1, clamav-milter version 0.88.1 on mailwn X-Virus-Status: Clean X-Scanned-By: milter-spamc/1.6.369 (mailwn [192.168.202.11]); Mon, 17 Apr 2006 08:14:04 -0400 X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: NO, hits=1.60 required=5.00 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello All, The current implementation of the i18n transformer is able to output only a single language in tags. In the majority of cases this is what is desired, however I need to be able to output multiple languages in a single document. I'd like to extend the i18n text tag to be capable of overriding its locale. Example: Hello World. This way, even if the default language parameter in the transformer was 'fr', I can represent certain elements in 'en'. This case especially applies to Canada, where many printed forms must be in both English and French (and this is basically what I need to do). I spent my weekend tracing through the source code of the i18n transformer. Two thoughts arise: 1) Indeed we can extend the source to support multiple languages. Basically, we could include a Map of locales used, with a simple data structure like: class LocalePack { public Locale locale; public CatalogueInfo catalogue; } This way we can load new language packs into the Map structure as we encounter them in nodes. 2) Why use Java at all? Would we take that much of a performance hit if we used straight XSLT? We could just aggregate the language packs and use a stylesheet to process the i18n text nodes and substitute them. A large dictionary would be a performance hit, unless we had some way to keep the XSLT stylesheet and parsed XML document resident in memory for whenever it's needed. Thoughts? AJ