Easy language switching for the documentation website

Поиск
Список
Период
Сортировка
От damien clochard
Тема Easy language switching for the documentation website
Дата
Msg-id 4E1623F3.80804@dalibo.info
обсуждение исходный текст
Ответы Re: Easy language switching for the documentation website  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-www
Hi guys,

For now, the documentation has only two full and up-to-date translations
: Japenese and French... so i guess what i'm gonna talk about will only
concern french and japanese speaking people.

From my personnal experience, I've talked with a lot of French-speaking
PostgreSQL users about the documentation. Most of them read both the
french and the english version, because when they have difficulties to
understand a paragraph, it's a good thing to go to the translations and
get a second chance to understand. It's also usefull when you're
confused by weird translations. For exemple "deadlock" is sometimes
translated as "verrous morts" which sounds really strange when you first
read it :)

Anyway, for the french documentation we ended putting a small javascript
link on each page to jump directly to the english version.

For now, it's only available on the 9.1 doc ( just click on the link
named "Version Anglaise" on the left ) :

http://docs.postgresql.fr/9.1/explicit-locking.html

This works with a very simple js that goes like that :

function jump_to_english() {var fr_url = location.href;var fr_pattern =
"http://docs.postgresql(.fr|fr.org)/([7-9].[0-4])";varen_pattern = "http://www.postgresql.org/docs/$2/static";var
reg=newRegExp(fr_pattern, "");window.location = fr_url.replace(reg,en_pattern) ;
 
}


So far people seem to like, the only problem is that once you've jump
from French to English, you might want to go backward as easily :)

So here my question : could we add a javascript like the one above on
each english documentation page ? Of course i would have to adapted to
support also Japanese (and maybe german)

If think this would be a big improvements for non-english users and
probably it could motivate people to translate the doc in other
languages. By making existing translations more visible, some people may
ask themselves : "why not translating this page in my own language ?"

I know javascript is not active on every browser and this code is a
quick and dirty hack. But it's simple and it works fine so i really it's
worth trying :-)

Any comments on this is more than welcome !

Regards,

-- 
damien clochard
dalibo.com | dalibo.org


В списке pgsql-www по дате отправления:

Предыдущее
От: "Francisco Figueiredo Jr."
Дата:
Сообщение: Re: Pgfoundry problem with Npgsql bug tracker
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Easy language switching for the documentation website