You are not logged in.

#1 2010-08-12 11:51:56

Huulivoide
Member
From: Finaland->Lapland->Kemi
Registered: 2009-11-19
Posts: 19
Website

AIF localization (patch)

I have added support for translations to AIF. Currently there are no translations yet.
Someone one the arch-releng (too lazy to check the name) mailing list said that this
should be implemded in the libui-sh, but why should we make this hard and write
?lots of code? to add some sort of new translation framework insted of using bash's
buildin translation functionality, its extreamly easy to use. Here is how its used
for those who are not familiar whit it:

non-translateable.sh:
#!/bin/bash
echo "Hello world!"

translateable.sh:
#!/bin/bash
TEXTDOMAIN=translateable
echo $"Hello world!"

so we only add $ in front of  the sting that can be translated, well but how
do we translate then??? Well we just dump the string to a standart gettext
gatalog, yes the same .po files used in c programs and in many others.
So we do this to dump them:
bash --dump-po-strings ./translateable.sh > ./translateable.pot
and we have a regular gettext gatalog redy to be translated.
Then we compile the tranlated po file to mo file and copy to the locale directory
, then we can just run the script and it will show every string as translated to
the currently set locale. Easy, isin't it

Here is the patch itself: http://dl.dropbox.com/u/3422289/aif-localization.patch

Offline

Board footer

Powered by FluxBB