diff options
-rw-r--r-- | doc/README_Translations | 46 | ||||
-rw-r--r-- | doc/sgmldocs.make | 138 | ||||
-rwxr-xr-x | doc/update_po.pl | 212 | ||||
-rwxr-xr-x | doc/update_translation.pl | 240 |
4 files changed, 0 insertions, 636 deletions
diff --git a/doc/README_Translations b/doc/README_Translations deleted file mode 100644 index cc02f1aa5e..0000000000 --- a/doc/README_Translations +++ /dev/null @@ -1,46 +0,0 @@ -The translations for evolution-guide should be placed in -evolution/doc/<LANG_CODE> - -In this directory you'll find two scripts. - - update_po.pl -- Usage: ./update_po.pl <LANG_CODE> - Takes the sgml files from the C directory and creates sgml.po files - in a directory called <LANG_CODE>.po - You should translate this files as you would any other .po file, but - you have to make sure you place all tags and don't miss anyone. - - - update_translation.pl -- Usage: ./update_translation.pl <LANG_CODE> - Takes the sgml files from the C directory, the sgml.po files from - the <LANG_CODE>.po directory and creates the translated sgml files - and places them on the <LANG_CODE> directory. - If a paragraph it is not translated the originial paragraph in - english is used instead (fuzzy paragraph are considered as - translated for the moment). Doing it this way you can make sure - you didn't miss any sgml tag on the .po files by compiling the - evolution guide. - -Of course, translations can be done as usual translating the .sgml files -directly. But let me point out a few advantages of doing it this way. - -* You can start translating the guide as soon as you want. Doesn't matter - if the original files changes. No more waiting for the docu to be called - stable. - -* When a paragraph changes, it is marked as fuzzy, so you don't have to be - playing with diff to find out if the original sgml file changed and where. - -* You don't need to keep several copies of the sgml files (usually you have - to keep a copy of the file you are translating and an up-to-date copy to - be able to do a diff, to find out the changes) - - -If you want to make any modification to my scripts, please let me know -before you do so and send me an explanation of the changes you want to -make (this is only for learning purposes, I allways like to know how to -make a better script) Of course, the scripts are under GPL, so you can do -with them allmost anything you want. -If you want to use this scripts in any other project different from the -evolution guide translation, please let me know (just to make me fell good -because people is using something I wrote ;-) ) - - -Héctor García Álvarez <hector@scouts-es.org> diff --git a/doc/sgmldocs.make b/doc/sgmldocs.make deleted file mode 100644 index 8159f7dfe9..0000000000 --- a/doc/sgmldocs.make +++ /dev/null @@ -1,138 +0,0 @@ -# To use this template: -# 1) Define: figs, docname, lang, omffile, sgml_ents although figs, -# omffile, and sgml_ents may be empty in your Makefile.am which -# will "include" this one -# 2) Figures must go under figures/ and be in PNG format -# 3) You should only have one document per directory -# -# Note that this makefile forces the directory name under -# $prefix/share/gnome/help/ to be the same as the SGML filename -# of the document. This is required by GNOME. eg: -# $prefix/share/gnome/help/fish_applet/C/fish_applet.sgml -# ^^^^^^^^^^^ ^^^^^^^^^^^ -# Definitions: -# figs A list of screenshots which will be included in EXTRA_DIST -# Note that these should reside in figures/ and should be .png -# files, or you will have to make modifications below. -# docname This is the name of the SGML file: <docname>.sgml -# lang This is the document locale -# omffile This is the name of the OMF file. Convention is to name -# it <docname>-<locale>.omf. -# sgml_ents This is a list of SGML entities which must be installed -# with the main SGML file and included in EXTRA_DIST. -# eg: -# figs = \ -# figures/fig1.png \ -# figures/fig2.png -# docname = scrollkeeper-manual -# lang = C -# omffile=scrollkeeper-manual-C.omf -# sgml_ents = fdl.sgml -# include $(top_srcdir)/help/sgmldocs.make -# dist-hook: app-dist-hook -# - -docdir = $(datadir)/gnome/help/$(docname)/$(lang) - -doc_DATA = index.html - -sgml_files = $(sgml_ents) $(docname).sgml - -omf_dir=$(top_srcdir)/omf-install - -EXTRA_DIST = $(sgml_files) $(doc_DATA) $(omffile) $(figs) - -CLEANFILES = omf_timestamp - -all: index.html omf - -omf: omf_timestamp - -omf_timestamp: $(omffile) - -for file in $(omffile); do \ - scrollkeeper-preinstall $(docdir)/$(docname).sgml $$file $(omf_dir)/$$file; \ - done - touch omf_timestamp - -index.html: $(docname)/index.html - -cp $(docname)/index.html . - -$(docname).sgml: $(sgml_ents) - -ourdir=`pwd`; \ - cd $(srcdir); \ - cp $(sgml_ents) $$ourdir - - -# The weird srcdir trick is because the db2html from the Cygnus RPMs -# cannot handle relative filenames -$(docname)/index.html: $(srcdir)/$(docname).sgml - -srcdir=`cd $(srcdir) && pwd`; \ - if test "$(HAVE_JW)" = 'yes' ; then \ - jw -c /etc/sgml/catalog $$srcdir/$(docname).sgml -o $$srcdir/$(docname); \ - else \ - db2html $$srcdir/$(docname).sgml; \ - fi - -app-dist-hook: index.html - -$(mkinstalldirs) $(distdir)/$(docname)/stylesheet-images - -$(mkinstalldirs) $(distdir)/figures - -cp $(srcdir)/$(docname)/*.html $(distdir)/$(docname) - -for file in $(srcdir)/$(docname)/*.css; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - cp $$file $(distdir)/$(docname)/$$basefile ; \ - done - -for file in $(srcdir)/$(docname)/stylesheet-images/*.gif; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - cp $$file $(distdir)/$(docname)/stylesheet-images/$$basefile ; \ - done - -if [ -e topic.dat ]; then \ - cp $(srcdir)/topic.dat $(distdir); \ - fi - -install-data-am: index.html omf - -$(mkinstalldirs) $(DESTDIR)$(docdir)/stylesheet-images - -$(mkinstalldirs) $(DESTDIR)$(docdir)/figures - -cp $(srcdir)/$(sgml_files) $(DESTDIR)$(docdir) - -for file in $(srcdir)/$(docname)/*.html $(srcdir)/$(docname)/*.css; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$$basefile; \ - done - -for file in $(srcdir)/figures/*.png; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/figures/$$basefile; \ - done - -for file in $(srcdir)/$(docname)/stylesheet-images/*.gif; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/stylesheet-images/$$basefile; \ - done - -if [ -e $(srcdir)/topic.dat ]; then \ - $(INSTALL_DATA) $(srcdir)/topic.dat $(DESTDIR)$(docdir); \ - fi - -$(docname).ps: $(srcdir)/$(docname).sgml - -srcdir=`cd $(srcdir) && pwd`; \ - db2ps $$srcdir/$(docname).sgml - -$(docname).rtf: $(srcdir)/$(docname).sgml - -srcdir=`cd $(srcdir) && pwd`; \ - db2ps $$srcdir/$(docname).sgml - -uninstall-local: - -for file in $(srcdir)/$(docname)/stylesheet-images/*.gif; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - rm -f $(docdir)/stylesheet-images/$$basefile; \ - done - -for file in $(srcdir)/figures/*.png; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - rm -f $(docdir)/figures/$$basefile; \ - done - -for file in $(srcdir)/$(docname)/*.html $(srcdir)/$(docname)/*.css; do \ - basefile=`echo $$file | sed -e 's,^.*/,,'`; \ - rm -f $(DESTDIR)$(docdir)/$$basefile; \ - done - -for file in $(sgml_files); do \ - rm -f $(DESTDIR)$(docdir)/$$file; \ - done - -rmdir $(DESTDIR)$(docdir)/stylesheet-images - -rmdir $(DESTDIR)$(docdir)/figures - -rmdir $(DESTDIR)$(docdir) diff --git a/doc/update_po.pl b/doc/update_po.pl deleted file mode 100755 index 7fa054e721..0000000000 --- a/doc/update_po.pl +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/perl -w -# -# Script for translators that extract .sgml files into .sgml.po ones -# -# Copyright (C) 2001 Héctor García Álvarez. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this library; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# -# Authors: Héctor García Álvarez <hector@scouts-es.org> - -## Loaded modules -use strict; -use File::Basename; -use Getopt::Long; - -my $LANG = $ARGV[0]; -#my $OUTFILE = "./tmp/$FILE.h"; - -my %string = (); -my @elements; -my @items; -my $n=0; - -if (! $LANG){ - print "Usage: update_po.pl LANGCODE\n"; - exit; -} else { $LANG .=".po"; } - -if ( !(-d "./$LANG") ){ mkdir ("./$LANG", 0755) ; } - -chdir ("./C"); -if ( !(-d "./tmp") ) { mkdir ("./tmp", 0755) ; } - -my $comand=""; - -open FILES, "<POTFILES.in" ; -#open POTFILE, ">POTFILES.in.h"; -while (<FILES>) { - undef (%string); - s/\n//g; - my $Original_file = $_ ; - s/.\///g; - my $Converted_file = "./tmp/".$_.".h"; - # print $Original_file."\n"; - # print $Translated_file."\n"; - print "Converting ".$Original_file."\n" ; - system "rm -f $Converted_file"; - &Convert ($Original_file); - open OUT, ">>$Converted_file"; - &addMessages; - close OUT; - $comand = "xgettext --default-domain=$Original_file "; - $comand .="--directory=. --add-comments --keyword=_ --keyword=N_ "; - $comand .="$Converted_file "; - system ( $comand ); - print ("Updating $Original_file.po\n"); - system ("mv $Original_file.po ../$LANG/$Original_file.pot"); - - if ( -f "../$LANG/$Original_file.po") { - system ("cp ../$LANG/$Original_file.po ../$LANG/$Original_file.po.old"); - system ("msgmerge ../$LANG/$Original_file.po.old ../$LANG/$Original_file.pot -o ../$LANG/$Original_file.po"); - } else { - system ("mv ../$LANG/$Original_file.pot ../$LANG/$Original_file.po"); - } - - system ("msgfmt --statistics ../$LANG/$Original_file.po"); - system ("rm -f ../$LANG/$Original_file.pot"); -# print POTFILE $Converted_file."\n"; - print ".\n"; -} -close FILES; - -system ("rm -rf ./tmp "); -exit 0; - - -sub Convert() { - - ## Reading the file - open (IN, "<$_[0]") || die "can't open $_[0]: $!"; - - ### For translatable Sgml files ### - while (<IN>) { - if ( /<!--/ ) { - my $Salida = $_ ; - if ( (/-->/) ) { - $string{$Salida} = []; - } else { - while (<IN>) { - $Salida .= $_ ; - if ( /-->/ ) { last ; } - } - $string{$Salida} = []; - } - } - elsif ( /<para>/ ) { - my $number_of_para = 1; - my $Salida = $_ ; - if ( /<\/para>/ ) { - $string{$Salida} = []; - } else { - while (<IN>) { - if ( /<para>/ ) { $number_of_para++; } - $Salida .= $_ ; - if ( /<\/para>/ ) { - $number_of_para--; - if ( $number_of_para==0) {last ; } - } - } - $string{$Salida} = []; - } - } - elsif ( /<title>/ ) { - my $Salida = $_ ; - if ( /<\/title>/ ) { - $string{$Salida} = []; - } else { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/title>/ ) { last ; } - } - $string{$Salida} = []; - } - } - elsif ( /<glossterm>/ ) { - my $Salida = $_ ; - if ( /<\/glossterm>/ ) { - $string{$Salida} = []; - } else { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/glossterm>/ ) { last ; } - } - $string{$Salida} = []; - } - } - elsif ( /<guilabel>/ ) { - my $Salida = $_ ; - if ( /<\/guilabel>/ ) { - $string{$Salida} = []; - } else { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/guilabel>/ ) { last ; } - } - $string{$Salida} = []; - } - } - } - close (IN); -} - -sub addMessages{ - - foreach my $theMessage (sort keys %string) { - - my ($tag) = $string{$theMessage} ; - - # Replace XML codes for special chars to - # geniune gettext syntax - #--------------------------------------- - $theMessage =~ s/"/\\"/mg; - $theMessage =~ s/\n/\\n\n/mg; - -# $theMessage =~ s/</</mg; -# $theMessage =~ s/>/>/mg; - - if ($theMessage =~ /\n/) { - #if ($tag) { print OUT "/* $tag */\n"; } - @elements = split (/\n/, $theMessage); - for ($n = 0; $n < @elements; $n++) { - - if ($n == 0) { - print OUT "gchar *s = N_"; - print OUT "(\"$elements[$n]\""; - if ($n == @elements - 1) { print OUT ");\n"; } - print OUT "\n"; - } - - elsif ($n == @elements - 1) { - print OUT " "; - print OUT "\"$elements[$n]\");\n\n"; - } - - elsif ($n > 0) { - print OUT " "; - print OUT "\"$elements[$n]\"\n"; - } - } - - } else { - -# if ($tag) { print OUT "/* $tag */\n"; } - print OUT "gchar *s = N_(\"$theMessage\");\n"; - } - - } -} - diff --git a/doc/update_translation.pl b/doc/update_translation.pl deleted file mode 100755 index 0023b069d1..0000000000 --- a/doc/update_translation.pl +++ /dev/null @@ -1,240 +0,0 @@ -#!/usr/bin/perl -w -# -# Script that translates .sgml files using the .po files generated from -# the script update_po.pl -# -# Copyright (C) 2001 Héctor García Álvarez. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this library; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# -# Authors: Héctor García Álvarez <hector@scouts-es.org> - -## Loaded modules -use File::Basename; -use Getopt::Long; - -my $LANG = $ARGV[0]; - -my %string; -my $texto_original=""; -my $texto_traducido=""; - -if (! $LANG){ - print "Usage: update_translation.pl LANGCODE\n"; - exit; -} - -chdir ("./C"); - -## Reading the po file -#print "Loading ".$LANG.".po\n"; -#&load_translated_strings ($LANG.".po"); - -## Checking for the lang dir -if ( !(-d "../".$LANG) ) { mkdir ("../".$LANG, 0755) ; } - -open FILES, "<POTFILES.in" ; -while (<FILES>) { - undef %string; - s/\n//g; - $Original_file = $_ ; - s/.\///g; - $Translated_file = "../".$LANG."/".$_; -# print $Original_file."\n"; -# print $Translated_file."\n"; - &load_translated_strings ("../".$LANG.".po/".$_.".po"); - print "Translating ".$Original_file ; - system "rm -f $Translated_file"; - &translate_file ($Translated_file , $Original_file); - print ".\n"; -} -close FILES; - -exit 0; - - - - -sub load_translated_strings () -{ - my $FILE=$_[0]; - open (IN, "<$FILE") || die "I can't find $FILE"; - - while (<IN>) { - if ( /#: /) { - &original; - &traduccion; -# print "Original \n##".$texto_original."##\n"; -# print "Traducción \n##".$texto_traducido."##\n"; - $string{$texto_original} = $texto_traducido; - } - } - close (IN); -} - -sub translate_file () -{ - my $OUTFILE=$_[0]; - my $INFILE=$_[1]; - - open OUT, ">>$OUTFILE"; - open (IN, "<$INFILE") || die "can't open $INFILE: $!"; - - while (<IN>) { - my $imprimir = 0; - if ( /<!--/ ) { - $Salida = $_ ; - if ( !(/-->/) ) { - while (<IN>) { - $Salida .= $_ ; - if ( /-->/ ) { last ; } - } - } - $imprimir = 1; - } - elsif ( /<para>/ ) { - my $number_of_para = 1; - $Salida = $_ ; - if ( !(/<\/para>/) ) { - while (<IN>) { - if ( /<para>/ ) { $number_of_para++; } - $Salida .= $_ ; - if ( /<\/para>/ ) { - $number_of_para--; - if ( $number_of_para==0) {last ; } - } - } - } - $imprimir = 1; - } - elsif ( /<title>/ ) { - $Salida = $_ ; - if ( !(/<\/title>/) ) { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/title>/ ) { last ; } - } - } - $imprimir = 1; - } - elsif ( /<glossterm>/ ) { - $Salida = $_ ; - if ( !(/<\/glossterm>/) ) { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/glossterm>/ ) { last ; } - } - } - $imprimir = 1; - } - elsif ( /<guilabel>/ ) { - $Salida = $_ ; - if ( !(/<\/guilabel>/) ) { - while (<IN>) { - $Salida .= $_ ; - if ( /<\/guilabel>/ ) { last ; } - } - } - $imprimir = 1; - } - if ( $imprimir == 0 ) { print (OUT $_); } - else { - my $impreso=0; - foreach my $theMessage (sort keys %string) { - if (!($theMessage cmp $Salida)) { - my $tag = $string{$Salida} ; - - if ( $tag cmp "") { - $tag =~ s/\\"/"/mg ; - print (OUT $tag); - } - else { - print (OUT $Salida); - } - $impreso=1; - } - } - if ( $impreso == 0) { - print "No lo encuentro\n##".$Salida."##\n"; - $impreso=0; - } - $imprimir = 0; - } - } - close IN; - close OUT; -} -#exit 0; - -sub original () -{ - my $tmp = ""; - while (<IN>) { - if ( !(/^#: /) ) { - if ( /msgid ""/) { s/msgid ""\n//; } - if ( /msgstr/) { - $tmp =~ s/\\n/\n/sg ; - $tmp =~ s/\\t/\t/sg ; - $tmp =~ s/\\"/"/sg ; - $texto_original = $tmp; - last ; - } - s/msgid "//; - s/\s*"// ; - s/"\n// ; - s/\n// ; - $tmp .= $_; - } - } -} - -sub traduccion () -{ - my $tmp = ""; - my $first = 0; - if ( /msgstr "/) { - if ( /msgstr ""/) { - $tmp = ""; - $first = 1; - } else { - $tmp = $_; - $tmp =~ s/msgstr "//; - $tmp =~ s/"\n// ; - } - } - while (<IN>) { - - if ( !($_ cmp "\n") ) { - $tmp =~ s/\\n/\n/sg ; - $tmp =~ s/\\t/\t/sg ; - $tmp =~ s/\"/"/sg ; - if ( $first == 1 ) { $texto_traducido = "" ; } - else { $texto_traducido = $tmp; } - last ; - } - $first = 0; - s/msgstr "//; - s/"\n// ; - s/\s*"// ; - $tmp .= $_; - } - if ( eof IN ) { - $tmp =~ s/\\n/\n/sg ; - $tmp =~ s/\\t/\t/sg ; - $tmp =~ s/\"/"/sg ; - $texto_traducido = $tmp; - } -} |