[Chandler-dev] Localization loading discussion
John Anderson
john at osafoundation.org
Wed Jun 7 17:54:01 PDT 2006
Here was pje's reply to the meeting notes about translations where we
discussed two simple implementations which solve the problem of how to
find translations before the repository is open.
-------- Original Message --------
Return-Path: <chandler-dev-bounces at lists.osafoundation.org>
X-Original-To: john at osafoundation.org
Delivered-To: john at osafoundation.org
Received: from leilani.osafoundation.org (leilani.osafoundation.org
[127.0.0.1]) by leilani.osafoundation.org (Postfix) with ESMTP id
9DC2E7F965; Thu, 1 Jun 2006 11:59:22 -0700 (PDT)
X-Original-To: dev at osafoundation.org
Delivered-To: chandler-dev at osafoundation.org
Received: from laweleka.osafoundation.org (laweleka.osafoundation.org
[204.152.186.98]) by leilani.osafoundation.org (Postfix) with ESMTP id
CBD137F964; Thu, 1 Jun 2006 11:59:21 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by
laweleka.osafoundation.org (Postfix) with ESMTP id BC5D6142262; Thu, 1
Jun 2006 11:59:21 -0700 (PDT)
Received: from laweleka.osafoundation.org ([127.0.0.1]) by localhost
(laweleka.osafoundation.org [127.0.0.1]) (amavisd-new, port 10024) with
ESMTP id 19056-04; Thu, 1 Jun 2006 11:59:21 -0700 (PDT)
Received: from ns.telecommunity.com (pilot.telecommunity.com
[64.239.5.21]) by laweleka.osafoundation.org (Postfix) with ESMTP id
2725214225D; Thu, 1 Jun 2006 11:59:21 -0700 (PDT)
Received: from pje-2.telecommunity.com
(adsl-8-208-222.mia.bellsouth.net [65.8.208.222]) by
ns.telecommunity.com (Postfix) with ESMTP id B8C8846B0FC; Thu, 1 Jun
2006 14:59:18 -0400 (EDT)
Message-Id: <5.1.1.6.0.20060601145901.03cfad60 at mail.telecommunity.com>
X-Sender: pje at mail.telecommunity.com
X-Mailer: QUALCOMM Windows Eudora Version 5.1.1
Date: Thu, 01 Jun 2006 15:02:50 -0400
To: John Anderson <john at osafoundation.org>, OSAF Development
<dev at osafoundation.org>
From: Phillip J. Eby <pje at telecommunity.com>
Subject: Re: [Chandler-dev] Meeting Notes: A meeting on python eggs and
how they are used in Chandler (with an application to i18n issues)
In-Reply-To: <447DB0E5.8040607 at osafoundation.org>
References: <B92789C6-7078-4784-AA37-AE7D317DFD3D at osafoundation.org>
<4474F23D.2050609 at osafoundation.org>
<B92789C6-7078-4784-AA37-AE7D317DFD3D at osafoundation.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed
X-Virus-Scanned: by amavisd-new and clamav at osafoundation.org
X-Spam-Status: No, hits=-1.2 tagged_above=-50.0 required=4.0 tests=AWL
X-Spam-Level:
X-BeenThere: chandler-dev at lists.osafoundation.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Developer Discussions <chandler-dev.lists.osafoundation.org>
List-Unsubscribe:
<http://lists.osafoundation.org/mailman/listinfo/chandler-dev>,
<mailto:chandler-dev-request at lists.osafoundation.org?subject=unsubscribe>
List-Archive: <http://lists.osafoundation.org/pipermail/chandler-dev>
List-Post: <mailto:chandler-dev at lists.osafoundation.org>
List-Help:
<mailto:chandler-dev-request at lists.osafoundation.org?subject=help>
List-Subscribe:
<http://lists.osafoundation.org/mailman/listinfo/chandler-dev>,
<mailto:chandler-dev-request at lists.osafoundation.org?subject=subscribe>
Sender: chandler-dev-bounces at lists.osafoundation.org
Errors-To: chandler-dev-bounces at lists.osafoundation.org
At 08:06 AM 5/31/2006 -0700, John Anderson wrote:
>We explored various implementation approaches, most notably the following two:
>
>As the Python eggs are discovered during Chandler launch, those that
>contain mo files that have not been copied to the mo installation
>directory will be copied. So that after Chandler has been started once
>all the mo files are installed. In the long run, when the repository is
>built as part of the build process, our customer would never incur the
>overhead of the step, unless they installed new language eggs, and then
>only once.
>
>The second approach is very similar, except that rather than copying files
>to an installation directory, a dictionary is setup in the repository
>during parcel installation that maps locale to a list of paths to each mo
>file the eggs or some other convenient data structure for runtime lookups.
>
>The first approach has the advantage of potentially working with Python
>projects other than Chandler and the gettext mechanism is designed to work
>with mo files stored in a directory. It has the disadvantage of storing
>two copies of the translation files, and when used by developers who
>regularly create their repository from scratch the translation files might
>not be available before the first string needs to be localized.
Note that that would only occur if the translation files were deleted along
with the repository (which we could simply not do), or on the very first
installation. So it's not likely to be a significant disadvantage.
>The second approach has the advantage of being simpler to implement since
>we can use the existing parcel install mechanism instead of building a
>similar mechanism for eggs.
Actually, both approaches would use an identical API for the developer;
whether that API copies the files or registers them in the repository is
purely an implementation detail. In both cases, the installParcel() hook
provides an opportunity to invoke the API to register (or copy) the resources.
We could actually use one approach initially, and then decide to switch to
a different one later, and nobody's code would change.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Open Source Applications Foundation "chandler-dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/chandler-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20060607/6de58781/attachment.htm
More information about the chandler-dev
mailing list