[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tzdata 2008d-1: Please translate debconf PO for the package tzdata

I wrote a horrible script (hack?) tonight to verify my time zone (Christian ;)
translations' correctness.

It simply reads a time zone name from a file, queries Wikipedia about it, parses
the link to Turkish page and get Turkish equivalent of the name from there.

You can prepare the name list by using po2txt tool from the package
I've created a file named org which contains English names, and file named tur
which contains Turkish equivalents. Then I've removed non-names and blanks from
these files. I've also removed first field of names with /
(Argentina/Buenos_Aires to Buenos_Aires) It was ready to go.

After running the script, all the equivalents was written to file "hede" (hede
is a placeholder in Turkish like foo ;)

After then, I've merged tur and hede to compare my translations and Wikipedia's
side by side. A simple "paste hede tur" was enough.

Note that the script is a horrible hack, it screws up encoding, it doesn't
handle parenthesis... But it was good enough for me to check my translations.

I hope it will help to you also


(Note: My mail client wrapped lines so be careful when pasting.)

#! /bin/bash
#set -x
org=( $( cat org ) )
tur=( $( cat tur ) )
declare -a vik

#$debug " Number of elements in array is $(( ${#a[@]} ))"

for i in $(seq 0 $((${#org[@]} - 1)))
	vik[$i]="$(wget -q -O- 'http://en.wikipedia.org/wiki/'${org[$i]} | html2 | grep
'/html/body/div/div/div/div/ul/li/a/@href=http://tr.wikipedia.org/wiki/' | rev |
cut -d"/" -f1  | rev)"


for i in $(seq 0 $((${#vik[@]} - 1)))
	echo ${vik[$i]}
done > hede

Reply to: