[Live-demo] language code detection

Daniel Kastl daniel at georepublic.de
Sun Sep 19 06:14:44 EDT 2010


Hi Hamish

2010/9/19 Hamish <hamish_b at yahoo.com>

> Daniel wrote:
> > 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
> ...
>
> is that method acceptable for the Brazilians?
>
>
As far as I understand it is always something like "de_DE", while the first
part is the language and the second one the country. I don't know about
Brazilians but for German it would work, for example Austria should be
"de_AT".


>
> > 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/
> ...
> > Language codes have to be added or deleted when they are ready or
> > not ready to be included.
>
> try:
>
> if [ -e "$BUILD_DIR/../doc/$LANG_CODE"/welcome_message.txt" ] ; then
>   cp "$BUILD_DIR/../doc/$LANG_CODE"/welcome_message.txt \
>      /usr/local/share/osgeo-desktop/
> else
>   cp "$BUILD_DIR"/../desktop-conf/welcome_message.txt \
>      /usr/local/share/osgeo-desktop/
> fi
>
>
> then if the translated version exists it will be used, otherwise it
> will default to copying in the english version.
> this assumes the DVD builder will be local..
>

original welcome_message.sh should always be copied, and duplication of
> english version with desktop-conf/ is to be avoided. (correct way is to
> remove the duplicated version from doc/en/, then if desired (I'm not sure
> it is) 'svn move' from the desktop-conf/ dir; this way full svn history
> is preserved and there is only one master file to edit. if duplicate is
> absolutely needed, tell svn to use a symlink)
>

Well, I think it would be better to have all texts in doc/<language>/
directory, so I would rather have the default "welcome_message.txt" in
"doc/en" than in desktop-conf directory.  But having some fall-back is
always good idea.

Daniel



>
>
> regards,
> Hamish
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/live-demo/attachments/20100919/9626524e/attachment.html


More information about the Live-demo mailing list