[Koha-cvs] CVS: koha/misc/translator opac-css.fr,1.1,1.2 intranet.en,1.1,1.2 intranet.fr,1.1,1.2 opac.fr,1.4,1.5 tmpl_process.pl,1.9,1.10 translator_doc.txt,1.1,1.2

Paul POULAIN tipaul at users.sourceforge.net
Wed Feb 11 09:42:04 CET 2004


Update of /cvsroot/koha/koha/misc/translator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23790/misc/translator

Modified Files:
	intranet.en intranet.fr opac.fr tmpl_process.pl 
	translator_doc.txt 
Added Files:
	opac-css.fr 
Log Message:
synch'ing 2.0.0 branch (RC4 tag) and head


Index: intranet.en
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/intranet.en,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** intranet.en	9 Dec 2003 10:26:51 -0000	1.1
--- intranet.en	11 Feb 2004 08:42:01 -0000	1.2
***************
*** 1,7 ****
! 0	*****
! A	*****
! A "thesaurus category": it refers to a thesaurus category. See the corresponding admin table.	*****
! A "value builder": values builders are perl programs that help you select the value of the field. They are MARC-flavor dependant and sometimes fill another subfield automatically.	*****
! A MARC record is stored in the breeding farm as long as you have no item. When you type the ISBN or title of a biblio, it's searched for in the breeding farm. If it is found, the biblio is added to Koha active table and removed from the breeding farm.	*****
  About	*****
  Abstract	*****
--- 1,4 ----
! A "thesaurus category": it refers to a thesaurus category. See the corresponding admin table	*****
! A "value builder": values builders are perl programs that help you select the value of the field. They are MARC-flavor dependant and sometimes fill another subfield automatically	*****
[...1295 lines suppressed...]
  Yes	*****
  yes	*****
+ YES	*****
  Yes, See below	*****
  YesNo	*****
  You	*****
! You are accessing Koha from a different ip address! Please login again	*****
  You can enter a name for this import. It may be useful, when creating a biblio, to remember where the suggested MARC data comes from!	*****
  You did not specify any seach criteria	*****
! You entered an incorrect username or password. Please try again	*****
  You have  error(s) in your MARC configuration. Please fix them before using koha	*****
  You have the following books waiting to be picked up	*****
***************
*** 1110,1114 ****
  You searched on	*****
  Young Adult Fiction	*****
- Z	*****
  Z39.50 Search	*****
  Z39.50 Server	*****
--- 1082,1085 ----

Index: intranet.fr
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/intranet.fr,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** intranet.fr	9 Dec 2003 10:26:51 -0000	1.1
--- intranet.fr	11 Feb 2004 08:42:02 -0000	1.2
***************
*** 1,874 ****
! 0	*****
! A	*****
! A "thesaurus category": it refers to a thesaurus category. See the corresponding admin table.	*****
! A "value builder": values builders are perl programs that help you select the value of the field. They are MARC-flavor dependant and sometimes fill another subfield automatically.	*****
! A MARC record is stored in the breeding farm as long as you have no item. When you type the ISBN or title of a biblio, it's searched for in the breeding farm. If it is found, the biblio is added to Koha active table and removed from the breeding farm.	*****
! About	*****
! Abstract	*****
! Account for	*****
! Account Management Fee	*****
! ACCOUNTING DETAILS	*****
[...2154 lines suppressed...]
! You are accessing Koha from a different ip address! Please login again	Vous avez changé d'adresse IP. Identifiez-vous à nouveau
! You can enter a name for this import. It may be useful, when creating a biblio, to remember where the suggested MARC data comes from!	Vous pouvez nommer ce fichier d'importation. Cela peut servir lors de la création de notice biblio pour se souvenir d'où viennent les données MARC par défaut.
! You did not specify any seach criteria	Vous n'avez pas spécifié de critère
! You entered an incorrect username or password. Please try again	Identifiant ou mot de passe erroné. Essayez encore
! You have	Vous avez
! You have the following books waiting to be picked up	Vous avez les livres suivants en attente
! You have the following requests for items on loan	Vous avez les demandes suivantes pour des ouvrages en prêt
! You must create a new group for your item to be added to	Vous devez créer un nouveau groupe pour ajouter vos ouvrages
! You must give the item a barcode	Vous devez attribuer un code barre à l'ouvrage
! You searched for	Votre recherche sur
! You Searched for	Votre recherche sur
! You searched on	Recherche effectuée sur
! Young Adult Fiction	Fiction Ados
! Z39.50 Search	Recherche Z39.50
! Z39.50 Server	Serveur Z39.50
! Z39.50 Servers	Serveurs Z39.50
! Z39.50 Servers admin	Admin Serveurs Z39.50
! z3950 search	Recherche Z39.50
! Z3950 Search Results	Résultats Recherche Z39.50
! Zipcode / Town	Code postal / Localité

Index: opac.fr
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/opac.fr,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** opac.fr	9 Dec 2003 10:26:51 -0000	1.4
--- opac.fr	11 Feb 2004 08:42:02 -0000	1.5
***************
*** 5,12 ****
  Advanced Search, More Options	Recherche avancée
  AMOUNT	COUT
  An Error has Occurred	Une erreur s'est produite
  Any	Tout
  Apr	Avril
- Are any of our records incorrect? Have you moved recently, got a new phone number or e-mail address?	Un changement à nous faire connaitre ?
  ARE OUR RECORDS CORRECT?	Est-ce correct
  Aug	Aout
--- 5,12 ----
  Advanced Search, More Options	Recherche avancée
  AMOUNT	COUT
+ An error has occurred	*****
  An Error has Occurred	Une erreur s'est produite
  Any	Tout
  Apr	Avril
  ARE OUR RECORDS CORRECT?	Est-ce correct
  Aug	Aout
***************
*** 15,21 ****
  BARCODE	CODE BARRE
  Barcode	Code barre
! bgcolor='#ffffcc'>	*****
  Biblio number	Notice biblio :
- BIBLIO RECORD	Notice bibliographique
  Biblionumber	Numéro notice :
  Cancelled	Annul?
--- 15,20 ----
  BARCODE	CODE BARRE
  Barcode	Code barre
! bgcolor="#ffffcc">	*****
  Biblio number	Notice biblio :
  Biblionumber	Numéro notice :
  Cancelled	Annul?
***************
*** 45,58 ****
  Email	Mail
  End reserve on this date	Annuler réservation à cette date
- Exact	Exact
  exact	exact
  Feb	Fev
  Fiction	Fiction
  FINES & CHARGES	Dettes
  Firstname	Prénom
- Free Software ILS	SIGB sous licence libre
  GROUP -	GROUPE
  Group Number	Groupe numéro
- Hi	Bonjour,
  Home	Accueil
  Home Branch	Annexe propriétaire
--- 44,55 ----
  Email	Mail
  End reserve on this date	Annuler réservation à cette date
  exact	exact
+ Exact	Exact
  Feb	Fev
  Fiction	Fiction
  FINES & CHARGES	Dettes
  Firstname	Prénom
  GROUP -	GROUPE
  Group Number	Groupe numéro
  Home	Accueil
  Home Branch	Annexe propriétaire
***************
*** 61,73 ****
  Illus	Illus
  Illustrator	Illustrateur
! in	dans
! in Maori	en langue Maori
  in the last	dans les derniers
  ISBN	ISBN
  Item Count	Nombre d'ouvrages
  Item lost	Ouvrage perdu
! Item Type	Type d'ouvrage :
! items currently issued.	Ouvrage en prêt actuellement
! items currently reserved.	Ouvrages réservés actuellement
  Itemtype	Type d'ouvrage
  Jan	Jan
--- 58,69 ----
  Illus	Illus
  Illustrator	Illustrateur
! in	en
  in the last	dans les derniers
  ISBN	ISBN
  Item Count	Nombre d'ouvrages
  Item lost	Ouvrage perdu
! Item Type	Type d'ouvrage
! items currently issued	Ouvrage en prêt actuellement
! items currently reserved	Ouvrages réservés actuellement
  Itemtype	Type d'ouvrage
  Jan	Jan
***************
*** 79,96 ****
  Junior Non-Fiction	Junior NF
  Keywords	Mot-clefs
- Koha	Koha
  KOHA	KOHA
- Koha : a gift, a contribution	Koha : un don, une contribution
  Koha Login	Identifiant Koha
- KOHA: Become a Member	KOHA : s'inscrire
- KOHA: Catalogue Search	Recherche catalogue
- Koha: Horowhenua Library Trust Catalogue and Member Services	Koha, catalogue et outils abonnés
- KOHA: Members Area	Zone abonnés
  KOHA: OPAC Catalogue Search	Recherche OPAC
  Last borrowed	Dernier prêt
  Last Borrower 1	Dernier emprunteur 1
  Last Borrower 2	Dernier emprunteur 2
- Last Seen	Vu
  Last seen	Vu
  Library Card	Carte lecteur
  Loan Length	Durée prêt
--- 75,86 ----
  Junior Non-Fiction	Junior NF
  Keywords	Mot-clefs
  KOHA	KOHA
  Koha Login	Identifiant Koha
  KOHA: OPAC Catalogue Search	Recherche OPAC
  Last borrowed	Dernier prêt
  Last Borrower 1	Dernier emprunteur 1
  Last Borrower 2	Dernier emprunteur 2
  Last seen	Vu
+ Last Seen	Vu
  Library Card	Carte lecteur
  Loan Length	Durée prêt
***************
*** 100,106 ****
  Log Out	Déconnecter
  Logged in as	Connecté en tant que
- Logged in as:  [	*****
- login	Connecter
- Logout	Déconnecter
  Mar	Mars
  May	Mai
--- 90,93 ----
***************
*** 108,113 ****
  modify	Modifier
  Month	Mois
- Next Records	Enregistrement suivant
- No	Non
  No. of Items	N° ouvrage
  Non-Fiction	NF
--- 95,98 ----
***************
*** 131,146 ****
  Paid for	Payé pour :
  Password	Mot de passe :
! pick up at	Prendre à :
  Place	Placer
  Place Reserve	Réserver
  Please confirm that you wish to request an item of these types	Confirmez que vous souhaitez réserver un ouvrage :
  Please select the branch from which you want to collect the item	Sélectionnez l'annexe ou vous prendrez l'ouvrage
! Please select which item types are ok for you. The first of these item that matches one of these types that becomes available will be set kept for you.	Sélectionnez les types d'ouvrages souhaités. Le premier disponible sera gardé pour vous.
! Please, change what's needed. An email will be sent to the library.	 Changer le nécessaire
! Previous Records	Précédents
  Published by	Publié par
  Publisher	Editions
  Recent acquisitions	Acquisitions récentes
! records.	réponses
  Reference Books	Références
  Renewals	Renouvellements
--- 116,131 ----
  Paid for	Payé pour :
  Password	Mot de passe :
! Pick Up Branch	Annexe de retrait
  Place	Placer
  Place Reserve	Réserver
+ Please change what's needed. An email will be sent to the library	Changer le nécessaire
  Please confirm that you wish to request an item of these types	Confirmez que vous souhaitez réserver un ouvrage :
  Please select the branch from which you want to collect the item	Sélectionnez l'annexe ou vous prendrez l'ouvrage
! Please select which item types are ok for you. The first of these item that matches one of these types that becomes available will be set kept for you	Sélectionnez les types d'ouvrages souhaités. Le premier disponible sera gardé pour vous.
  Published by	Publié par
  Publisher	Editions
  Recent acquisitions	Acquisitions récentes
! record	Enr.
! records	réponses
  Reference Books	Références
  Renewals	Renouvellements
***************
*** 151,173 ****
  Reserve on this date	Réserver à cette date :
  Reserve page for item	Réservation de l'ouvrage :
! reserves already on this item.	Réservations déjà faites sur cet ouvrage
! reserves.	Réservations
  Results	Résultats
! Results  through  of  records.	*****
  results found	Réponses trouvées
! search	IGNORE
! Search	IGNORE
  Search the catalogue	Chercher dans le catalogue
- Search the Catalogue	Chercher dans le catalogue
  Sep	Sep
  Serial	Périodique
  Size	Taille
  Something new ?	quelque chose à modifier ?
! Sorry, KOHA doesnt think you have permission for this page.	Désolé, je pense que vous n'avez pas les permissions suffisantes.
  Sorry, there were no results	Désolé, aucun résultat !
! Sorry, you cannot make more than	Impossible de faire plus de
! Sorry, you cannot make more than  reserves.	Désolé, vous ne pouvez pas faire plus de réservations
! Sorry, you cannot make reserves because you owe .	Désolé, vous ne pouvez pas faire de réservation parce que vous devez
! Sorry, your session has timed out, please login again.	Déconnecté. Identifiez vous à nouveau.
  STILL OWING	EN ATTENTE
  Street address	Adresse postale
--- 136,155 ----
  Reserve on this date	Réserver à cette date :
  Reserve page for item	Réservation de l'ouvrage :
! reserves already on this item	Réservations déjà faites sur cet ouvrage
  Results	Résultats
! Results  through  of  records	*****
  results found	Réponses trouvées
! Search	LIMITED;Chercher
! search	LIMITED;recherche
  Search the catalogue	Chercher dans le catalogue
  Sep	Sep
  Serial	Périodique
  Size	Taille
  Something new ?	quelque chose à modifier ?
! Sorry, KOHA doesnt think you have permission for this page	Désolé, je pense que vous n'avez pas les permissions suffisantes.
  Sorry, there were no results	Désolé, aucun résultat !
! Sorry, you cannot make more than  reserves	Désolé, vous ne pouvez pas faire plus de réservations
! Sorry, you cannot make reserves because you owe	Désolé, vous ne pouvez pas faire de réservation parce que vous devez
! Sorry, your session has timed out, please login again	Déconnecté. Identifiez vous à nouveau
  STILL OWING	EN ATTENTE
  Street address	Adresse postale
***************
*** 177,181 ****
  Surname	Nom
  Teacher Reference	Ref. prof.
! text/html; charset=iso8859-1	text/html; charset=iso8859-1
  There are	Il y a
  through	à
--- 159,163 ----
  Surname	Nom
  Teacher Reference	Ref. prof.
! text/html; charset=iso-8859-1	text/html; charset=iso8859-1
  There are	Il y a
  through	à
***************
*** 184,189 ****
  Total Due	Total dû
  Total Number of Items	Nombre total d'exemplaires
! Try another	Essayez un autre
! Type in the box and press the enter key.	Saisissez et validez avec Entrée
  Unititle	Titre unifié
  Update Record	Mettre à jour
--- 166,171 ----
  Total Due	Total dû
  Total Number of Items	Nombre total d'exemplaires
! Try another	Essayez une autre
! Type in the box and press the enter key	Saisissez et validez avec Entrée
  Unititle	Titre unifié
  Update Record	Mettre à jour
***************
*** 196,216 ****
  Work/Fax phone	Tel bureau
  Year	Année
- Year :	Année :
- Yes	Oui
  YesNo	OuiNon
! You already have a reserve placed on this item.	Vous avez déjà placé une réservation sur cet exemplaire
! You are accessing koha from a different ip address! please login again.	Vous avez changé d'adresse IP. Identifiez vous à nouveau
! You did not specify any seach criteria	Vous n'avez pas spécifié de critère
! You entered an incorrect username or password, please try again.	Identifiant ou mot de passe erroné. Essayez encore.
! You have	Vous avez
! You have  items currently issued.	Vous avez exemplaires en prêt
! You have  items currently reserved.	Vous avez exemplaires réservés
  You have a credit of	Vous avez un crédit de
! You have no items on issue.	Vous n'avez pas d'exemplaire en prêt
  You have outstanding charges and fines of	Vous avez des dettes de
  You have reserved items waiting	Vous avez des réservations en attente
  You must select a branch for pickup!	Sélectionnez une annexe ou retirer l'ouvrage
! You must select at least on item type!	Vous devez sélectionner au moins 1 type d'exemplaire
  You searched on	Recherche effectuée sur
  Young Adult Fiction	Ado fiction
! Your changes won't appear until the library has validated them.	Vos changement n'apparaitront que lorsque la bibliothèque les aura validé
--- 178,195 ----
  Work/Fax phone	Tel bureau
  Year	Année
  YesNo	OuiNon
! You already have a reserve placed on this item	Vous avez déjà placé une réservation sur cet exemplaire
! You are accessing koha from a different ip address! please login again	Vous avez changé d'adresse IP. Identifiez vous à nouveau
! You did not specify any search criteria	Vous n'avez pas spécifié de critère
! You entered an incorrect username or password, please try again	Identifiant ou mot de passe erroné. Essayez encore.
! You have  items currently issued	Vous avez exemplaires en prêt
! You have  items currently reserved	Vous avez exemplaires réservés
  You have a credit of	Vous avez un crédit de
! You have no items on issue	Vous n'avez pas d'exemplaire en prêt
  You have outstanding charges and fines of	Vous avez des dettes de
  You have reserved items waiting	Vous avez des réservations en attente
  You must select a branch for pickup!	Sélectionnez une annexe ou retirer l'ouvrage
! You must select at least one item type!	Vous devez sélectionner au moins 1 type d'exemplaire
  You searched on	Recherche effectuée sur
  Young Adult Fiction	Ado fiction
! Your changes won't appear until the library has validated them	Vos changement n'apparaitront que lorsque la bibliothèque les aura validé

Index: tmpl_process.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/tmpl_process.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** tmpl_process.pl	10 Feb 2004 09:42:18 -0000	1.9
--- tmpl_process.pl	11 Feb 2004 08:42:02 -0000	1.10
***************
*** 74,78 ****
  {
  	# restores the string list from file
! 	%strhash = &restore_strhash(\%strhash, $str_file, $split_char);
  	# updates the list, adding new entries if any
  	%strhash = &update_strhash(\%strhash, \@in_files, $exclude_regex, $filter);
--- 74,78 ----
  {
  	# restores the string list from file
! 	%strhash = &restore_strhash(\%strhash, $str_file, $split_char,1);
  	# updates the list, adding new entries if any
  	%strhash = &update_strhash(\%strhash, \@in_files, $exclude_regex, $filter);
***************
*** 94,98 ****
  
  	# restores the string list from file
! 	%strhash = &restore_strhash(\%strhash, $str_file, $split_char);
  	# creates the new tmpl file using the new translation
  	&install_strhash(\%strhash, \@in_files, $in_dir, $out_dir);
--- 94,98 ----
  
  	# restores the string list from file
! 	%strhash = &restore_strhash(\%strhash, $str_file, $split_char,0);
  	# creates the new tmpl file using the new translation
  	&install_strhash(\%strhash, \@in_files, $in_dir, $out_dir);
***************
*** 116,121 ****
  	my $tmp_dir; # temporary directory name (used to create destination dir)
  
! 	$out_dir =~ s/\/$//; # chops the trailing / if any.
  
  	# Processes every entry found.
  	foreach my $file (@{$in_files})
--- 116,122 ----
  	my $tmp_dir; # temporary directory name (used to create destination dir)
  
! 	my $starttime = time();
  
+ 	$out_dir =~ s/\/$//; # chops the trailing / if any.
  	# Processes every entry found.
  	foreach my $file (@{$in_files})
***************
*** 129,132 ****
--- 130,134 ----
  		# generates the name of the output file
  		my $out_file = $file;
+ 		my $out_file_tmp = $file.".tmp"; # used to check if file has changed or not.
  
  		if(!defined $in_dir)
***************
*** 159,198 ****
  			exit(1);
  		}
! 		
  		# opens handle for output
! 		if( !open($fh_out, "> $out_file") )
  		{
! 			warn "Can't write $out_file : $!\n";
  			close($fh_in);
  			next;
  		}
! 
! 		print "Generating $out_file...\n";
! 
  		while(my $line = <$fh_in>)
  		{
! 			foreach my $text (sort  {length($b) <=> length($a)} keys %{$strhash})
  			{
! 				# Test if the key has been translated
! 				if( %{$strhash}->{$text} != 1 )
  				{
! 					# Does the line contains text that needs to be changed ?
! 					if( $line =~ /$text/ && %{$strhash}->{$text} ne "IGNORE")
  					{
  						# changing text
! 						my $subst = %{$strhash}->{$text};
! 						$line =~ s/(\W)$text(\W)/$1$subst$2/g;
  					}
  				}
  			}
- 			$line =~ s/\<TMPL_(.*?)\>/\<\!-- TMPL_$1 --\>/g;
- 			$line =~ s/\<\/TMPL_(.*?)\>/\<\!-- \/TMPL_$1 --\>/g;
- 			# Writing the modified (or not) line to output
- 			printf($fh_out "%s", $line);
  		}
! 
  		close($fh_in);
  		close($fh_out);
  	}
  }
  
--- 161,243 ----
  			exit(1);
  		}
! 
  		# opens handle for output
! 		if( !open($fh_out, "> $out_file_tmp") )
  		{
! 			warn "Can''t write $out_file : $!\n";
  			close($fh_in);
  			next;
  		}
! 		my $lines;
  		while(my $line = <$fh_in>)
  		{
! 			$lines.=$line;
! 		}
! 		foreach my $text (sort  {length($b) <=> length($a) || uc($b) cmp uc($a) } keys %{$strhash})
! 		{
! 		# Test if the key has been translated
! 		if( %{$strhash}->{$text} != 1)
  			{
! 				# Does the file contains text that needs to be changed ?
! 				# escaping \|()[{}^$*+?.
! 				my $subst = %{$strhash}->{$text};
! 				$text =~ s/\\/\\\\/g;
! 				$text =~ s/\//\\\//g;
! 				$text =~ s/\|/\\\|/g;
! 				$text =~ s/\(/\\\(/g;
! 				$text =~ s/\)/\\\)/g;
! 				$text =~ s/\[/\\\[/g;
! 				$text =~ s/\]/\\\]/g;
! 				$text =~ s/\{/\\\{/g;
! 				$text =~ s/\}/\\\}/g;
! 				$text =~ s/\^/\\\^/g;
! 				$text =~ s/\$/\\\$/g;
! 				$text =~ s/\*/\\\*/g;
! 				$text =~ s/\+/\\\+/g;
! 				$text =~ s/\?/\\\?/g;
! 				$text =~ s/\./\\\./g;
! 				if(%{$strhash}->{$text} ne "IGNORE" )
  				{
! 					if (%{$strhash}->{$text} =~ "LIMITED")
  					{
  						# changing text
! 						$subst =~ s/UNUSED;//;
! 						$subst =~ s/^LIMITED;//g;
! 						$lines =~ s/(.*)>$text(\W)/$1>$subst$2/g;
! 						$lines =~ s/(.*) title="$text/$1 title="$subst/g;
! 						$lines =~ s/(.*) alt="$text/$1 alt="$subst/g;
! 					} else {
! 						# changing text
! 						$subst =~ s/UNUSED;//;
! 						$lines =~ s/(\W)$text(\W)/$1$subst$2/g;
  					}
  				}
  			}
  		}
! 		$lines =~ s/\<TMPL_(.*?)\>/\<\!-- TMPL_$1 --\>/g;
! 		$lines =~ s/\<\/TMPL_(.*?)\>/\<\!-- \/TMPL_$1 --\>/g;
! 		# Writing the modified (or not) file to output
! 		printf($fh_out "%s", $lines);
  		close($fh_in);
  		close($fh_out);
+ 		# check if fh_out and previous fh_out has changed or not.
+ 		my $diff;
+ 		if(-f $out_file)  {
+ 			$diff = `diff $out_file $out_file_tmp`;
+ 		} else {
+ 			$diff = "write it, it's new";
+ 		}
+ 		if ($diff) {
+ 			print "WRITING : $out_file\n";
+ 			unlink $out_file;
+ 			system("mv $out_file_tmp $out_file");
+ 		} else {
+ 			print "no changes in $out_file\n";
+ 			unlink $out_file_tmp;
+ 		}
  	}
+ 	my $timeneeded = time() - $starttime;
+ 	print "done in $timeneeded seconds\n";
+ 
  }
  
***************
*** 213,217 ****
  		print "Processing $in...\n";
  
! 		# Creates a filehandle containing all the strings returned by
  		# the plain text program extractor
  		open($fh, "$filter $in |") or print "$filter $in : $!";
--- 258,262 ----
  		print "Processing $in...\n";
  
! 		# 'Creates a filehandle containing all the strings returned by
  		# the plain text program extractor
  		open($fh, "$filter $in |") or print "$filter $in : $!";
***************
*** 222,227 ****
  		{
  			$str =~ s/[\n\r\f]+$//; # chomps the trailing \n (or <cr><lf> if file was edited with Windows)
! 			$str =~ s/^\s+//; # remove trailing blanks, ':' or '*'
! 			$str =~ s/\s*\**:*\s*$//;
  
  			# the line begins with letter(s) followed by optional words and/or spaces
--- 267,272 ----
  		{
  			$str =~ s/[\n\r\f]+$//; # chomps the trailing \n (or <cr><lf> if file was edited with Windows)
! 			$str =~ s/^[\s+:\(]*//; # remove useless characters
! 			$str =~ s/[\s\*:\[*\(|\.,\)]*$//;
  
  			# the line begins with letter(s) followed by optional words and/or spaces
***************
*** 235,238 ****
--- 280,286 ----
  						# the line is not already in the list so add it
  						%{$strhash}->{$str}=1;
+ 					} else {
+ 						# remove UNUSED;
+ 						%{$strhash}->{$str} =~ s/^UNUSED;//;
  					}
  				}
***************
*** 252,257 ****
  sub restore_strhash
  {
! 	my($strhash, $str_file, $split_char) = @_;
! 	
  	my $fh;
  	
--- 300,305 ----
  sub restore_strhash
  {
! 	my($strhash, $str_file, $split_char, $detect_unused) = @_;
! 
  	my $fh;
  	
***************
*** 259,263 ****
  	
  	print "Restoring string list from $str_file...\n";
! 	
  	while( my $line = <$fh> )
  	{
--- 307,311 ----
  	
  	print "Restoring string list from $str_file...\n";
! 
  	while( my $line = <$fh> )
  	{
***************
*** 277,280 ****
--- 325,331 ----
  			%{$strhash}->{$original} = 1;
  		}
+ 		if ($detect_unused) {
+ 			%{$strhash}->{$original} = "UNUSED;".%{$strhash}->{$original} unless %{$strhash}->{$original}=~ /^UNUSED;/;
+ 		}
  
  	}
***************
*** 300,306 ****
  	print "Writing string list to $str_file...\n";
  
! 	foreach my $str(sort {uc($a) cmp uc($b) || length($a) <=> length($b)} keys %{$strhash})
  	{
! 		if(%{$strhash}->{$str} != 1)
  		{
  			printf($fh "%s%s%s\n", $str, $split_char, %{$strhash}->{$str});
--- 351,357 ----
  	print "Writing string list to $str_file...\n";
  
! 	foreach my $str(sort {uc($a) cmp uc($b) || length($b) <=> length($a)} keys %{$strhash})
  	{
! 		if(%{$strhash}->{$str}!=1)
  		{
  			printf($fh "%s%s%s\n", $str, $split_char, %{$strhash}->{$str});
***************
*** 308,312 ****
  		else
  		{
! 			printf($fh "%s%s%s\n", $str, $split_char,"*****") unless ($str >0);
  		}
  	}
--- 359,363 ----
  		else
  		{
! 			printf($fh "%s%s%s\n", $str, $split_char,"*****") unless ($str >0 || length($str) eq 1);
  		}
  	}
***************
*** 457,458 ****
--- 508,510 ----
  	exit(0);
  }
+ 

Index: translator_doc.txt
===================================================================
RCS file: /cvsroot/koha/koha/misc/translator/translator_doc.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** translator_doc.txt	5 Dec 2003 16:53:46 -0000	1.1
--- translator_doc.txt	11 Feb 2004 08:42:02 -0000	1.2
***************
*** 1,3 ****
! TRANSLATION TOOL :
  ============
  This transation tool should greatly help Koha translators.
--- 1,3 ----
! TRANSLATION TOOL , V2.0:
  ============
  This transation tool should greatly help Koha translators.
***************
*** 15,25 ****
  ============
  1- create your translation file :
! ./tmpl_process.pl update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
! 2- translate your opac.fr file (english & french being separated by a tab
  3- create your translated version :
  ./tmpl_process.pl install -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s opac.fr -r
! 4- copy images in your new directory (as they are NOT moved by tmpl_process.pl install)
  
! If something changes in english version, go back to pt1 & repeat.
  
  WEAKNESSES
--- 15,31 ----
  ============
  1- create your translation file :
! ./tmpl_process.pl create -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
! 2- translate your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below)
  3- create your translated version :
  ./tmpl_process.pl install -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s opac.fr -r
! 4- copy images/css files in your new directory (as they are NOT moved by tmpl_process.pl install)
  
! If something changes in english version :
! 1- update your translation file :
! ./tmpl_process.pl update -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -s opac.fr -r
! 2- translate new  your opac.fr file (english & other_language being separated by a tab, using IGNORE and LIMITED pragmas, see below)
! 3- create your translated version :
! ./tmpl_process.pl install -i /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/en/ -o /home/paul/koha.dev/koha/koha-tmpl/opac-tmpl/default/fr2/ -s opac.fr -r
! 4- copy new images/css files in your new directory if needed
  
  WEAKNESSES
***************
*** 39,44 ****
  words that are in the templates and in a perl script name are replaced !
  For example : Search is replace by Recherche in french, thus,giving <a href="cgi-bin/opac-Recherche.pl">, which is wrong...
! The only way I've found to solve this is to ignore any translation whose translation string is IGNORE
! (search is the only cas i've found in french opac)
  
  - MISSING STRINGS
--- 45,61 ----
  words that are in the templates and in a perl script name are replaced !
  For example : Search is replace by Recherche in french, thus,giving <a href="cgi-bin/opac-Recherche.pl">, which is wrong...
! 2 ways to solve this problem, IGNORE & LIMITED pragma.
! IGNORE :
! if a line in translation file is :
! this_original_string	IGNORE
! it is ignored during translation.
! LIMITED :
! if a line in translation file is :
! this_original_string LIMITED;the_translation_string
! The string is translated only if :
! * has a > just before
! * has <space>title=" just before
! * has <space>alt=" just before.
! This prevent stupid replaces, at the cost of some missing translation maybe.
  
  - MISSING STRINGS





More information about the Koha-cvs mailing list