Chailloux - Żelaska

  drapeau français  Arbre des familles Chailloux - Żelaska

  flaga polska  Drzewa Chailloux - Żelaskich

  English flag  Chailloux - Żelaska family tree

An attempt to produce a Gramps multilingual Web Site

This multilingual (French, Polish and English) Chailloux - Żelaska Family Web Site uses the regular "Narrative Web" reporting tool provided by Gramps 3.2.x with some very small extensions. It allows each page to switch from a language to another. I tried to make the minimum changes in the Gramps source in order to facilitate the future updates. The flags are located at the end of the navigation bar.

The changes on 'NarrativeWeb.py'

#<JER> add, close to the end of 'def display_nav_links' fr_url = self.report.build_url_fname("graphics/nav32x16_fr.png", None, self.up) ul += '<li><a href="/cgi-bin/changelanguage?fr" title="page en français">' + '<img alt="drapeau français" title="drapeau français" src="' + fr_url + '" width="32" height="16" /></a></li>' pl_url = self.report.build_url_fname("graphics/nav32x16_pl.png", None, self.up) ul += '<li><a href="/cgi-bin/changelanguage?pl" title="Wersja Polska">' + '<img alt="Polska Flaga" title="Polska Flaga" src="' + pl_url + '" width="32" height="16" /></a></li>' en_url = self.report.build_url_fname("graphics/nav32x16_en.png", None, self.up) ul += '<li><a href="/cgi-bin/changelanguage?en" title="Page in English">' + '<img alt="English Flag" title="English Flag" src="' + en_url + '" width="32" height="16" /></a></li>' #</JER> just before the last navigation += ul

The pages generation script

#/bin/sh HOME='/home/jerome' SITE="$HOME/geneal/Sites" BASE="$SITE/www.chailloux.org/public/geneal/gramps" rm -r $BASE/images/* rm -r $BASE/thumb/* rm -r $BASE/fr/* rm -r $BASE/pl/* rm -r $BASE/en/* ln -s $BASE/images $BASE/fr/images ln -s $BASE/thumb $BASE/fr/thumb ln -s $BASE/images $BASE/pl/images ln -s $BASE/thumb $BASE/pl/thumb ln -s $BASE/images $BASE/en/images ln -s $BASE/thumb $BASE/en/thumb DB="$HOME/.gramps/grampsdb/4a79636a" OPT1="of=$SITE," OPT2="filter=0,living=1,incpriv=0," OPT3="encoding=UTF-8," OPT4="paper=A4,pid=I0000" OPT=$OPT1$OPT2$OPT3$OPT4 # FR LANGUAGE=fr_FR:fr LANG=fr_FR.UTF-8 gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/fr,homenote=N1010,title="Arbre des familles Chailloux - Żelaska",$OPT # PL LANGUAGE=pl_PL:pl LANG=pl_PL.UTF-8 gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/pl,homenote=N1011,title="Drzewo rodziny Chailloux - Żelaskich",$OPT # EN LANGUAGE=en_EN:en LANG=en_EN.UTF-8 gramps -O $DB --action=report \ --options=name=navwebpage,target=$BASE/en,homenote=N1012,title="Chailloux - Å»elaska family tree",$OPT

The 'changelanguage' cgi-bin

#!/usr/bin/perl my $ptr = $ENV{'HTTP_REFERER'}; my $new = "\/$ENV{'QUERY_STRING'}\/"; my $fr = '/fr/'; my $pl = '/pl/'; my $en = '/en/'; if ($ptr =~ $fr) { $ptr =~ s/$fr/$new/g; } elsif ($ptr =~ $pl) { $ptr =~ s/$pl/$new/g; } elsif ($ptr =~ $en) { $ptr =~ s/$en/$new/g; } else { $ptr="changelanguage_error:$ptr:$new:" } print "Location: $ptr\n\n";

The resulting Web Site size

Why it is so important to share the images and the thumb directories among the various languages:
 
$ du -s * 38192 en 39328 fr 64 graphics 127204 images 8 index.html 39144 pl 15280 thumb $