java propeties file translation for bash/ shell

if you want to use localisation in a bash script, using standard java property files is a good way.

if you use this syntax:

cat `dirname $0`/web/src/ | sed '/^.$/d' |sed 's/[\.|-]/_/g' | sed 's/|//g' | sed 's/\ = /=/g' | sed 's/\=/="/g' | sed 's/.$/"/g' | sed '/^ *$/d' > .properties.file

you get a converted version of the propertyfile which can be included inside the bashscript.

my.example.translation = "word"

will be converted to


and can be used inside the script with $my_example_translation

Inhalt abgleichen