/[ddp]/manuals/trunk/quick-reference/bin/interwiki
ViewVC logotype

Contents of /manuals/trunk/quick-reference/bin/interwiki

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6962 - (show annotations) (download)
Sat Sep 19 17:31:26 2009 UTC (3 years, 8 months ago) by osamu
File size: 904 byte(s)
fix typo and better URL translation
1 #!/bin/sh
2 #
3 # interwiki LANGUAGE [MODE]
4 #
5 # LANGUAGE = ja, fr, es, ...
6 # MODE = PRINT, NO
7 # PRINT means to print English URL if translation does not exist.
8 # NO means not to print any URL if translation does not exist.
9 #
10 LANGAGE=$1
11 MODE=$2
12 while read X ; do
13 # normal translation
14 Y=$(wget -O - $X 2>/dev/null |sed -n "s/^.*interwiki-${LANGAGE}\"><a href=\"\(.*\)\".*$/\1/p" | sed 's/%/\\x/')
15 # just translate funky UTF-8 URLs
16 #Y=$(wget -O - $X 2>/dev/null |sed -n "s/^.*interwiki-${LANGAGE}\"><a href=\"\(.*\)\".*$/\1/p" | sed -n 's/%/\\x/g')
17 if [ -n "$Y" ]; then
18 echo "# ----------------- translated"
19 echo "msgid \"$X\""
20 /usr/bin/printf '%b\n' "msgstr \"$Y\""
21 echo ""
22 echo "--- $X: translated." 1>&2
23 elif [ "$MODE" = "PRINT" ]; then
24 echo "# ################# no-translaton"
25 echo "msgid \"$X\""
26 echo "msgstr \"$X\""
27 echo ""
28 echo "### $X: no-translaton." 1>&2
29 fi
30 done
31

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5