1

I am looking for a locale with a particular set of features. Using this simple script I can see the date format of any installed locale.

 #!/bin/bash 
 LC_TIME=$1 date +%x

That's fine. But locales control other features and I want to see them too. In my current issue, I want Thunderbird list dates to show as 2018/06/30 and I want my panel clock to show the time in 12-hour format.

How can I add to this script to display the other effects of the locale?

Stephen Boston
  • 2,178
  • 4
  • 32
  • 55

1 Answers1

1

I think date +'full="%c" date="%x" time_24="%X" time_12="%r"' shows you everything there is to know about the LC_TIME setting except for the names of months and the am/pm string that isn't current.

If you want to see all the settings of a locale, check the documentation of the localedef utility to see if it suggests directories containing input files. For example, on my system (Ubuntu), it lists

   /usr/share/i18n/locales
          Usual default path for locale definition files.

And I can go and read locale definitions by reading files in this directory.

It's up to each application whether it actually uses the locale settings. Some have their own configuration mechanism that can override locale settings, and some ignore locale settings altogether.

Thunderbird does show dates according to the LC_TIME setting. If you've set LC_TIME and it doesn't appear to have an effect in Thunderbird, make sure you're setting it in the right place: not in .bashrc, because that doesn't affect programs started from a GUI menu. Put environment variable definitions in a file such as ~/.profile or ~/.pam_environment.