In linux shell script I can change the language very easily, using variables to detect SO language and execute variables depending on the language:
Example:
# english
echo "Hello world"
blabla
echo "Done"
# spanish
echo "Hola mundo"
blabla
echo "Terminado"
# solution
greeting=("Hello World" "Hola Mundo")
goodbye=("Done" "Terminado")
test "${LANG:0:2}" == "en"
eng=$?
echo ${greeting[${eng}]}
blablabla
echo ${goodbye[${eng}]}
How can I do that in batch script - cmd?
Example bat script:
# english
echo Hello world
blabla (cmd command)
echo Bye
# spanish
echo Hola Mundo
blabla (cmd command)
echo Hasta la vista Baby
Update:
I found this batch maybe it can be useful (based on Languaje Codes)
set Key="HKEY_CURRENT_USER\Control Panel\International"
for /F "tokens=3" %%a in ('reg query %Key% ^| find /i "LocaleName"') do set Language=%%a
Output:
set Language=en-US
but it is only necessary: en
systeminfoforSystem Localeto detect system's language. NB:taskkillwithout/im, and possibly with/fas well, won't work :)