Po-file downloadscript (was: Pot files)



Op zo 28-12-2003, om 22:07 schreef Carlos Perelló Marín:
> El dom, 28-12-2003 a las 23:51, Görkem Çetin escribió:
> > Hi,
> > 
> > Not all the modules in GNOME CVS have pot localization template files, 
> > so my poor technical skills tell me that I have nothing but to modify 
> > another teams' po file to get a tr.po. :-(
> 
> The .pot files are generated files so they MUST not be commited to
> cvs.gnome.org
> 
> > 
> > I'm sure there's a solution for this situation, but how?
> 
> You have two options:
> 
> 1. download it from status pages
> (http://developer.gnome.org/projects/gtp/status/)
> 2. Download the complete source code and execute inside the po
> directory: "intltool-update -m"
Hi all,

I have a downloadscript to get all of the po-files of your preferred
language. It downloads them from the statuspages. Change the language at
the top of the script to your language and you can fetchit!

Kind regards,
Vincent van Adrighem
-- 
Gpg-key: http://pki.surfnet.nl KeyID=0xF8D8C608
Help mee met het vertalen van GNOME. Kijk op http://gnome-nl.sf.net/
voor meer informatie.
#!/bin/sh
#The location of the statuspages. They NEED a trailing slash
sourcelocation="http://developer.gnome.org/projects/gtp/status/";

# Change this to your own language.
# DO NOT FORGET TO ALSO CHANGE THE LANGUAGE ON LINE 43
# (two times "nl.po" in the sed argument)
language=nl
#Check the source
if ! lynx -source $sourcelocation \
| grep "index.html\">gnome" > /tmp/translation-status.tmp; then 
	#Something went wrong...bail out
	echo "Statuspage-location not available"
	echo $sourcelocation
	exit 1
 fi
#We now have a loop for every gnomeversion which is in the statuspage
for version in `cat /tmp/translation-status.tmp | sed 's/.*index.html\">\(.*\)<\/a>.*/\1/' | tail -1`; do
	if ! lynx -source $sourcelocation$version/$language/index.html \
	  | grep "class=\"package\"" | grep -A 10 "<td><font" \
	  | sed 's/<.*\">//' |sed 's/<.*>//' > /tmp/translation-status.$version.tmp; then
	    echo "Couldn't find index-files for $version"
		exit 1
	fi
	file="/tmp/packages.$version.text"
	# echo -n "packages.$version.text: "
	date -u -R > $file
	echo $sourcelocation >> $file
	# Now, get the spaces in front of the lines cleaned out.
	mv /tmp/translation-status.$version.tmp /tmp/translation-status.$version.tmp.old
	for x in `cat /tmp/translation-status.$version.tmp.old`; do 
		echo $x >> /tmp/translation-status.$version.tmp
	done
	rm /tmp/translation-status.$version.tmp.old
	# Next part: We start another loop for each group
	for group in `cat /tmp/translation-status.$version.tmp`; do 
	if echo $group | grep [a-z]  >/dev/null; then
		urls=`lynx -source $sourcelocation$version/$language/$group/index.html \
		  | grep -A 2 "class=\"package\"" | grep -A 10 "<td><font" \
		  | sed 's/href=\"..\/..\//href=\"/' \
		  | sed 's/.*href=\"\(.*\)\">\(.*\)<\/a.*/\1\
\2/' \
		  | sed 's/<.*\">//' |sed 's/<.*>//' | grep "PO/" | sed 's/\.po[^t].*/\.po/' \
		  | sed 's/.pot.*/.pot/'`
		for url in $urls; do
			complete_url=$sourcelocation$version/$url
			wget $complete_url
		done
	fi
	done
done
rm /tmp/*.tmp
rm /tmp/packages.*.text

Dit berichtdeel is digitaal ondertekend



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