forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: CLI & I18N
Date Wed, 08 Oct 2003 10:45:47 GMT
Jeff Turner wrote:

>On Tue, Oct 07, 2003 at 03:34:31PM +0100, Upayavira wrote:
>>I've just chatted with Cheche at the GetTogether about I18N and the CLI 
>>- i.e. getting it to create the necessary translated versions of pages.
>>We are proposing the following code to be made to work in the xconf file 
>>(and eventually in the Ant task):
>>  <uris name="i18n"
>>        locales="en|fr|it|de"
>>        follow-links="true"
>>        type="insert"
>>        src-prefix="docs/"
>>        >
>>    <uri src="index.html" dest="build/dest-apache/{dest}.{locale}"/>
>>    <uri src="index.html" dest="build/dest-iis/{locale}/{dest}"/>
>>    <uri src="index.html" dest="build/dest-apache/{dest}" locale="en"/>
>>    <uri src="index.html" dest="build/dest-iis/{dest}" locale="en"/>
>>  </uris>
>>Here, you have specified the locales that you want to process (in this 
>>case, four of them), and the locale can be included in the destination 
>>URI, to use Apache's I18N support, or to simply include the locale in 
>>the URI.
>I don't understand.  Why does there need to be special CLI handling for
>i18n?  Isn't that the sitemap's job?  Would the webapp still work
>identically from live webapp and from CLI-rendered files?
I'm sure Cheche can explain more - it was his requirement.

But as I understand it:

If your site uses the locale as passed to it by the browser, then the 
same site currently cannot be generated by the CLI, as the CLI doesn't 
implement any locale handling - as this code from 
o.a.c.environment.commandline.CommandLineRequest shows:

public Locale getLocale() { return Locale.getDefault(); }

So, what I'm suggesting is extending the CLI so that you can specify a 
locale for generating a page.

But then you'd need to repeat the process for each locale you have in 
your site, so that they are all crawled, thus the locale="en|de|fr" bit.

And, if you're using Apache, apparently it'll serve index.html.en if 
your locale is en, and if your locale is fr, etc. Thus the 
dest="build/dest/{src}.{locale}" bit including the locale in your 
destination URI.

Does that all make sense now?

Regards, Upayavira

View raw message