[translations] Auto locale

Jakub Suchy jakub at rtfm.cz
Sun Jan 14 17:50:07 UTC 2007


> The packaging script expects this format. (It does allow for the path 
> information to be on the first line too, because addition of the CVS Id 
> was a recent change).

I created this little script to insert headers to my .po files, because
my KBabel didn't keep them from .pot files.

I don't ensure it's correct, but it's working with po-packager.php

#!/bin/bash
# Usage: ./script.sh LANGNAME YOURNAME EMAIL
# Example: ./script.sh Czech "Jakub Suchy" "jakub at rtfm.cz"
# This inserts headers into all XYZ-module.po files and saves updated
# files into directory "updated-translation"

temp=`mktemp -d`
lang=$1
name=$2
email=$3
year=`date +%Y`

for i in *-module.po; do
 module=`echo "$i" | cut -d "-" -f 1`
 echo "# \$Id$" > "$temp/$i"
 echo "# " >> "$temp/$i"
 echo "# $lang translation of Drupal (modules/$module/$module.module)" >> "$temp/$i"
 echo "# Copyright $year $name ($email)" >> "$temp/$i"
 echo "# Generated from file: $i" >> "$temp/$i"
 cat "$i" >> "$temp/$i"
done
mkdir updated-translation
cp $temp/* updated-translation
rm -rf $temp



More information about the translations mailing list