[Live-demo] language code detection

Daniel Kastl daniel at georepublic.de
Sun Sep 19 05:03:09 EDT 2010


Hi list,

At the code sprint in Barcelona we had the idea to detect the language code
automatically by the language the user selected at login (or the language
set by default).
So Hal made a change in /bin/main.sh to read the $LANG parameter and set the
default language (and welcome_message.txt) according to it. Here the
additional source code:

case `echo $LANG | sed 's/_.*//'` in
    ja)
        LANG_CODE="ja"
        ;;
    de)
        LANG_CODE="de"
        ;;
    it)
        LANG_CODE="it"
        ;;
    es)
        LANG_CODE="es"
        ;;
    *)
        LANG_CODE="en"
        ;;
esac
export LANG_CODE

The change for custom welcome message is in bin/install_desktop.sh (line
280):

cp "$BUILD_DIR/../doc/$LANG_CODE"/welcome_message.* \
   /usr/local/share/osgeo-desktop/

Currently this is only used for the welcome message, but the "LANG_CODE"
could be used at any place we think.
The advantage of this would be, that even if users received a localized
version of a LiveDVD, they would be able to read documents in another
language (if available) or in English in case they switch to another
language.

There are two issues though:

   - It hasn't been tested yet when building a LiveDVD (probably we missed
   some other required changes somewhere).
   - Language codes have to be added or deleted when they are ready or not
   ready to be included.

Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/live-demo/attachments/20100919/138bd246/attachment.html


More information about the Live-demo mailing list