X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=blobdiff_plain;f=common%2Fscripts%2Fcreate-epub-cover.pl;h=f9b3bb5a9ad50bda056500f533ae12955f31b014;hp=bb3a9ddf52c906185671156602a326c8ad9af0b6;hb=fcb052e8c646c98319f23acd5d25936e44eccc87;hpb=aba1fbbdef949b0daa7a8156b88caa3c53547409 diff --git a/common/scripts/create-epub-cover.pl b/common/scripts/create-epub-cover.pl index bb3a9dd..f9b3bb5 100755 --- a/common/scripts/create-epub-cover.pl +++ b/common/scripts/create-epub-cover.pl @@ -308,6 +308,9 @@ sub find_illustrator { if ( $find_line == 1 && $line =~ /Illustrated by (.*?)<\/line>/ ) { $illustrator = $1; } + if ( $find_line == 1 && $line =~ /Ilustrado por (.*?)<\/line>/ ) { + $illustrator = $1; + } $find_line = 1 if ( $line =~ // ); $find_line = 0 if ( $line =~ /<\/creator>/ ); if ( $line =~ /(.*?)<\/title>/ ) { @@ -318,7 +321,11 @@ sub find_illustrator { if ( $illustrator eq "" ) { print STDERR "WARN: Cannot find illustrator for book '$book'\n"; - $illustrator = "[Undefined]"; + if ( $language eq "en" ) { + $illustrator = "[Unknown]"; + } elsif ( $language eq "es" ) { + $illustrator = "[Desconocido]"; + } } if ( $language eq "en" ) { $illustrator = "Illustrated by ".$illustrator; @@ -329,3 +336,43 @@ sub find_illustrator { return $illustrator; } +sub convert_entities { +# Convert character entities to their correspondent values + my ($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; + $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; + + return $text; +} + +# Quote metacaracters for shell use +sub quote_shell { + my ($text) = @_; + $text =~ s/'/\\'/g; + return $text; +}