Open main menu

Gramps β

Changes

Howto: Make a genealogy website with Gramps

3,075 bytes removed, 17:15, 16 March 2017
Multilingual Web Site
Some people generated multilingual web site.
The [http://www.chailloux.org/public/geneal/gramps/ HereChailloux - Żelaska Family Web Site] is an attempt : * Line change on 'NarrativeWeb.py' <pre> _ML = [ '<to create a href="French /cgi-binPolish /changelanguage?fr" title="page en français"> ' '<img alt="drapeau français" title="drapeau français" ' 'src="%(fr_fname)s" /></a> ', '<a href="/cgi-bin/changelanguage?pl" title="Wersja Polska"> ' '<img alt="Polska Flaga" title="Polska Flaga" ' 'src="%(pl_fname)s" /></a> ', '<a href="/cgi-bin/changelanguage?en" title="Page in English"> ' '<img alt="English Flag" title="English Flag" ' 'src="%(en_fname)s" /></a> ' ] </pre> ...  <pre> elif 0 < copy_nr < len(_CC): frfnm = os.path.join("graphics", "nav32x16_fr.png") frfnm = self.report.build_url_fname(frfnm, None, self.up) plfnm = os.path.join("graphics", "nav32x16_pl.png") plfnm = self.report.build_url_fname(plfnm, None, self.up) enfnm = os.path.join("graphics", "nav32x16_en.png") enfnm = self.report.build_url_fname(enfnm, None, self.up) fname = os.path.join("images", "somerights20.gif") fname = self.report.build_url_fname(fname, None, self.up) text = '' text += _ML[0] % {'fr_fname' : frfnm} text += _ML[1] % {'pl_fname' : plfnm} text += _ML[2] % {'en_fname' : enfnm} text += _CC[copy_nr] % {'gif_fname' : fname} of.write('\t<p id="copyright">%s</p>\n' % text)</pre>  * The script for pages generation <pre>#/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/jerome/.gramps/grampsdb/49a46209"  OPT1="of=$SITE," OPT2="filter=0,living=1,incpriv=0" OPT3="encoding=utf-8" OPT4="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 # PLLANGUAGE=pl_PL:plLANG=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 </pre> * The 'changelanguage' cgi-bin <pre>#!/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"; </pre> * The resulting Web Site size Why it is so important to share the images and the thumb directories among the various languages: <pre>$ du -s * 7328 en 7340 fr 64 graphics 42148 images 8 indexwebsite.html 7340 pl 3968 thumb $</pre>
==="Online maps" urls===
1
edit