incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ariel Constenla-Haile <arie...@apache.org>
Subject Re: [WWW] Some issues translating download/index.html
Date Thu, 10 May 2012 01:31:19 GMT
Hi Marcus,

On Thu, May 10, 2012 at 12:48:18AM +0200, Marcus (OOo) wrote:
> Am 05/09/2012 11:50 PM, schrieb Ariel Constenla-Haile:
> >
> >Hi Marcus,
> >
> >On Wed, May 09, 2012 at 11:02:02PM +0200, Marcus (OOo) wrote:
> >>>>>* I had to make a copy of exceptions.css to adapt the cachedimages/*.png
> >>>>>URLs
> >>
> >>It's easy to change the URLs in the file to absolute pathes. If you
> >>have no others changes done, then you can include the original CSS
> >>file. No need to have an own one.
> >
> >I know, I was trying to do the translation without touching any file in
> >content/download/, so I copied the css file with the modified URLs; then
> >I realized I also needed to turn off language detection and force "es"
> >language download (which implies modifying some files in
> >content/download, unless some one has a better idea - doable in the
> >short time).
> 
> Localization was really no point when the DL scripts were created in
> the old project. Also because every NL community was allowed to do
> their own thing.
> 
> The URL is assembled with this line of code:
> 
> LINK = getLink( VERSION, MIRROR, SCHEMA );
> 
> The getLink() function calls somewhen the getLanguage() function to
> get the ISO code. So, currently no chance to throw in a "es" term.
> 
> But from your patch I can see that you have already found a
> solution. I'm no expert but it looks good. But I think it's possible
> to make it more clean and generic for others.
> 
> For example, the getLink() function could be extended to accept an
> ISO code to get forced to assemble a download URL for a specific
> language:
> 
> LINK = getLink( VERSION, LANGUAGE, MIRROR, SCHEMA );
> 
> Then you can include the default CSS (then with the absolute pathes)
> and JS files (the big advantage !), localize the "index.html" and
> just exchange "LANGUAGE" with "es".

I added 

/*
 * get link setting link language instead of letting the script detect it
 * depends on getLink( version, mirror, schema ) and setLanguage( lang )
 */
function getLinkWithLang( version, language, mirror, schema ) {
    setLanguage( language );
    return getLink( version, mirror, schema );
}

Note that I cannot get rid of setLanguage( language ) and the variable
NL_LANGUAGE because both getLanguage() and getLanguageISO() try to get
the language from the navigator.

I modified content/download/exceptions.css so that now there is only
need to 

* adapt the links in index.html
* set the language when getting the link:
  LINK = getLinkWithLang( VERSION, "es", MIRROR, SCHEMA );
* transalting the text


The patch is at
http://people.apache.org/~arielch/patches/localize-download-index-html-v2.patch


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Mime
View raw message