Re: How to do the language code switch for Norwegian Bokmål : no -> nb



Hi Kjartan,

Yesterday at 20:04, Kjartan Maraas wrote:
>> 
>> for i in `find * configure.in`
>> do
>> rm -f tmfile
>> cat $i | \
>> 	sed 's/\(ALL_LINGUAS=.*\)\<no\>\(.*\)/\1nb\2/' > tmpfile && \
>> 	cat tmpfile > $i
>> done
>> 
> How do you add "nb" at the appropriate place in ALL_LINGUAS when you
> don't know what entry it's supposed to be placed in front of? 

Something like:

for i in `find . -name configure.in`
do
  rm -f tmpfile tmpfile2
  LINGUAS=`grep ALL_LINGUAS $i | sed -e 's/^ALL_LINGUAS\s*=\s*\"//' -e 's/"\s*$//'`" nb"
  for l in $LINGUAS; do
    echo $l >> tmpfile
  done
  sort tmpfile > tmpfile2 && \
  LINGUAS=`cat tmpfile2` NEWLINGUAS="" && 
  for l in $LINGUAS; do
     NEWLINGUAS="$NEWLINGUAS $l"
  done && \
  rm -f tmpfile2 && \
  sed -e "s/^ALL_LINGUAS\s*=.*/ALL_LINGUAS=\"$NEWLINGUAS\"/" $i > tmpfile && \
  mv tmpfile $i
done

This should work even better, since we have "nl" and "nn"
translations, which should stay between "nb" and "no" ;-)

> Just curious :-)

So, here it is, just for fun ;-)

Cheers,
Danilo


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