X-Git-Url: http://git.treefish.org/fex.git/blobdiff_plain/7fa382617fbaccc0ce522b2b3adbbee9db5ad227..20160328:/locale/french/htdocs/FAQ/faq.pl diff --git a/locale/french/htdocs/FAQ/faq.pl b/locale/french/htdocs/FAQ/faq.pl index 7770549..ba09ba8 100644 --- a/locale/french/htdocs/FAQ/faq.pl +++ b/locale/french/htdocs/FAQ/faq.pl @@ -1,3 +1,4 @@ +use utf8; package FAQ; my ($faq,$var,$env,$q,$a,$c,$s,$t,$n); @@ -9,11 +10,11 @@ my @sections = qw'Meta User Admin Misc'; print "\n"; -print '

F*EX ', - " Frequently Asked Questions

\n"; +print '

F*EX '; +printf "Frequently Asked Questions: %s

\n",ucfirst($faq); if ($faq ne 'local') { - print "

\n"; + print "

Sections: "; foreach $s (@sections,'All') { if ($s =~ /$faq/i) { print "$s\n"; @@ -24,6 +25,7 @@ if ($faq ne 'local') { print "

\n"; } +print "


\n"; print "\n"; foreach my $faq (@faq) { @@ -40,8 +42,10 @@ foreach my $faq (@faq) { }; ($q,$a) = split /A:\s*/; $q =~ s/[\s\n]+$//; + $q =~ s/^\s+//; $q =~ s! (/\w[\S]+/[\S]+)! $1!g; $a =~ s/[\s\n]+$/\n/; + $a =~ s/^\s+//; while ($a =~ s/^(\s*)\*/$1\n:s @@ -53,8 +57,8 @@ foreach my $faq (@faq) { # $a =~ s/^\s*
\s*//mg; $a =~ s/<([^\s<>\@]+\@[\w.-]+)>/<$1><\/a>/g; $a =~ s! (/\w[\S]+/[\S]+)! $1!g; - $a =~ s!(https?://[\w-]+\.[^\s<>]+)![$1]!g or - $a =~ s!(https?://[^\s<>]+)!$1!g; + $a =~ s!(https?://[\w-]+\.[^\s<>()]+)![$1]!g or + $a =~ s!(https?://[^\s<>()]+)!$1!g; push @{$Q{$faq}},$q; push @{$A{$faq}},$a; } @@ -71,12 +75,18 @@ foreach $s (sections($faq)) { $t = $s if $faq eq 'all'; for ($n = 0; $n < scalar(@{$Q{$c}}); $n++) { - printf "\n", - $s,$n+1,$t,$n+1,${Q{$c}[$n]}; + $q = ${Q{$c}[$n]}; + $qa = anchor($q); + printf ''."\n", + $t,$n+1,$s,$n+1,$qa,$q; } } print "
%s Q%d: %s
'. + ''. + '%s Q%d:'. + '%s
\n"; +print "


\n"; foreach $s (sections($faq)) { @@ -86,14 +96,19 @@ foreach $s (sections($faq)) { $t = $s if $faq eq 'all'; for ($n = 0; $n < scalar(@{$Q{$c}}); $n++) { - print "


\n"; + $q = ${Q{$c}[$n]}; + $qa = anchor($q); + print "

\n"; print "\n"; - printf "\n", - $t,$n+1,$s,$n+1,${Q{$c}[$n]}; + printf "\n", + $t,$n+1,$s,$n+1,$qa,$q; printf "\n", $s,$n+1,${A{$c}[$n]}; - print "\n"; print "
%s Q%d:%s
". + "%s Q%d:". + "". + "%s
%s A%d:\n%s
[Top]
\n"; + print "[↑ Questions]\n"; } } @@ -117,3 +132,12 @@ sub pre { s/\s+$//; return "

$_
\n"; } + +sub anchor { + local $_ = shift; + s/<.+?>//g; + s/\(.+?\)//g; + s/\W/_/g; + s/_+$//; + return $_; +}