#!/bin/sh echo echo Generating language table. languages=`cat index.txt` if [ -n "$languages" ]; then ( n=0 echo '/* Automatically generated by gen-intl */' for i in $languages; do echo -n $i" " 1>&2 echo echo 'struct translation translation_'$i' [] = {' echo ' { 0, NULL },' cat $i.lng | sed 's/^/ {/' | sed 's/,[ ]*$/ },/' echo ' { 0, NULL }' echo '};' n=`expr $n + 1` done echo echo 'struct translation_desc translations [] = {' for i in $languages; do echo ' { translation_'$i' },' done echo ' { NULL }' echo '};' echo ( echo '/* Automatically generated by gen-intl */' echo echo '#define N_LANGUAGES '$n echo cat english.lng | grep '^T_' | (cat; echo T__N_TEXTS) | sed 's/,.*//' | cat -n | sed 's/^\([^T]*\)\(.*\)$/#define \2 \1/' ) | sed 's/ //g' > language.h ) | sed 's/ //g' > ../language.inc if cmp -s ../language.h language.h; then rm -f language.h else mv language.h .. fi echo echo Done. fi echo