forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: CLI & I18N
Date Wed, 08 Oct 2003 11:24:32 GMT
On Wed, Oct 08, 2003 at 11:45:47AM +0100, Upayavira wrote:
> 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?
> >
> >--Jeff
> > 
> >
> 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.

So would every URL be requested 3 times, once per language?

> And, if you're using Apache, apparently it'll serve index.html.en if 
> your locale is en, and index.html.fr 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?

Yes, much more sense, thanks.  It's my usual confusion between the
responsibilities of the sitemap and the user agent.  I'm still not sure
where their responsibilities lie.  Say we wanted to generate gzipped
output; would we implement a ZipSerializer, or hack the CLI to ask for
"Content-encoding: gzip"?

I guess a safe rule of thumb is that if a web browser can do it, the CLI
could also, so any CLI enhancements in this direction will surely be
useful.

Thanks,

--Jeff

> Regards, Upayavira
> 
> 

Mime
View raw message