1

I am tuning locale on my Linux box by changing variables like LC_*, LANGUAGE. There is no problem to find description of these variables. But how to see what actually changes? I mean not just output of locale command, but in practice. In other words I need test script for every locale-related variable.

Bash is preferable, python and perl are ok too.

Till now I have found this:

echo "(LANGUAGE=$LANGUAGE) Error message"                                                                                                                                                  
wc -q 2>&1
echo "(LC_TIME=$LC_TIME) Date: "
date +%x
echo "(LC_TIME=$LC_TIME) Time: "
date +%X
echo "(LC_TIME=$LC_TIME) Long date/time: "
date +%c
echo "(LC_NUMERIC=$LC_NUMERIC) Decimal/thousands separator"
printf "%'f\n" 1234567890
echo "(LC_COLLATE=$LC_COLLATE) Sorting order"
echo -e "english1\nEnglish2\nкириллица1\nКириллица2\n.dot" | sort

So, after switching for example, export LC_COLLATE='C' and export LC_COLLATE='ru_RU.UTF-8' I can see the difference in sorting order.

How to see effect of changing these variables?

  • LC_CTYPE
  • LC_MONETARY
  • LC_MESSAGES
  • LC_PAPER
  • LC_NAME
  • LC_ADDRESS
  • LC_TELEPHONE
  • LC_MEASUREMENT
  • LC_IDENTIFICATION

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.