Open luzpaz opened 10 years ago
Hmm interesting but that's a bit overkill. Better stick to one file only when possible. Easiest would be to have all in english only of course.
is there a simpler way to do it than that methodology ?
Alternative could be using variables
I began something like this
if [[ "${LANGUAGE:0:2}" == 'fr' ]] then txt_jumptostart="Hop, allons vers ~/dev/scribus" txt_help=" usage : maksvn [-h]ou[-?] [-d]ou[clean] [-nomaj] [diff [dest]] met à jour le source svn de scribus 1.5 et compile === OPTIONS ==================== -h ou -? : affiche cette aide -d ou clean : efface d'abord les bin et objs déjà là -nomaj : pas de mise à jour svn -diff ou diff : crée le fichier de diff dans dest.diff si dest est précisé (dans svnhead.diff sinon) === INFOS ====================== " txt_diffdest="ok on va mettre le diff dans " txt_diffdel="Effacement de " fi
What does ${LANGUAGE:0:2} mean? (specifically the ':0:2')
$LANGUAGE is fr_CA:fr_FR on my session ${LANGUAGE:0:2} is 'fr' on my session (= 2 letters starting at position 0) and will probably be 'en' on some session with english local language Have a try : echo ${LANGUAGE:0:2} There are variants : $LANG for the variable... and other shell syntax to get these 2 letters.
Doesn't work in OS X. But I get it :)
Some shell might not know that syntax. Got to use widely spread syntax. What shell is yours ?
Ok
$ echo $LANG
en_US.UTF-8
so should we make a part of the script to recognize locale ? or just give the user an option ?
its now in english
Is this the direction we want to go in? http://www.linuxjournal.com/content/internationalizing-those-bash-scripts