From: Angus Leeming Date: Thu, 24 Mar 2005 15:57:38 +0000 (+0000) Subject: Update the HEAD version of the script. It's now identical to the 13x version, X-Git-Tag: 1.6.10~14450 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a73ed93eb0e5276710c082d412a621a477b47ef0;p=features.git Update the HEAD version of the script. It's now identical to the 13x version, save for different lyx_version and lyx_branch tags. The script is now able to decide whether to add a branch tag to a request to look at a po file in the repository. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9743 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/po/ChangeLog b/po/ChangeLog index 878549f929..d5ffc133d5 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,10 @@ +2005-03-24 Angus Leeming + + * postats.sh: unset the LANG environment variable because + GNU sed and grep have real problems in UTF-8 environments. + Add a block to translate Author's names from the local encoding + of the po file to XHTML character codes. + 2005-03-11 Jean-Marc Lasgouttes * LINGUAS: new file. Lists the languages known to LyX. diff --git a/po/postats.sh b/po/postats.sh index 7f1d9eda72..3630112bab 100755 --- a/po/postats.sh +++ b/po/postats.sh @@ -15,6 +15,17 @@ # Invocation: # postats.sh po_files > "pathToWebPages"/i18n.php3 +# modifiy this when you change version +# Note that an empty lyx_branch variable (ie cvs HEAD) +# will "do the right thing". +lyx_version=1.4.0cvs +lyx_branch= + + +# GNU sed and grep have real problems dealing with 8-bit characters +# in UTF-8 encoded environments. +unset LANG + warning () { echo $* 1>&2 @@ -99,6 +110,19 @@ run_msgfmt () { } unset input + # Does $translator contain 8-bit characters? + TAB=' ' + echo $translator | grep "[^${TAB} -~]" >/dev/null && { + # If so, grab the encoding from the po file. + charset=`sed -n '/Content-Type/{s/.*charset=//;s/\\\\n" *$//p;q}' $pofile` + # Use recode to generate HTML character codes for the 8-bit + # characters. + translator=`echo $translator | recode "${charset}..h4"` || exit 1 + # The ampersands in the $translator entries will mess things + # up unless we escape 'em. + translator=`echo $translator | sed 's/&/\\\&/g'` + } + # Run msgfmt on the pofile, filling $message with the raw info. message=`$msgfmt --statistics -o $gmofile $pofile 2>&1 | grep "^[1-9]"` || { warning "Unable to run msgfmt successfully on file $1" @@ -155,6 +179,13 @@ EOF # The foot of the generated php file. dump_tail () { + +test "$lyx_branch" = "" && { + branch_tag="" +} || { + branch_tag="?only_with_tag=$lyx_branch" +} + cat < 'Hungarian', 'it' => 'Italian', 'nl' => 'Dutch', + 'nn' => 'Nynorsk', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', @@ -197,8 +229,8 @@ usort (\$podata, "cmp");

The following table details the current state of the translations of the - LyX GUI for the main LyX development branch (currently 1.3.0cvs). - Unfortunately, only a few languages are well-supported. The LyX term may, + LyX GUI for the LyX stable branch (currently $lyx_version). + Unfortunately, only a few languages are well-supported. The LyX team may, therefore, decide to exclude some of the translations from a formal release in order not to confuse the user with a strongly mixed-language interface. @@ -236,8 +268,9 @@ while (list(\$foo,\$info) = each(\$podata)) { } else { \$style="style='background:#AA3333'"; } + print "" ; - print "" . \$lang[\$info['langcode']] . ""; + print "" . \$lang[\$info['langcode']] . ""; print "" . \$info['msg_tr'] . "";