Linux MintThis forum is for the discussion of Linux Mint.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As you can see, Linux sets up a whole string of locale-related variables so you can decouple your time, language, keyboard layout, etc. from one another.
Okey kokey, I've managed to follow that fine, thanks. Assuming you didn't want me to past the results here - or did you? It's fairly long, although I can see, if it's relevant:
#en_GB#
Great. Hazel's comment on the separation of the various locale elements is very pertinent, but in your case you want to change just one element of LC_TIME which contains the date/time formats (i.e. change / to - in the date format). So, if you were to use another locale for LC_TIME, you would have to accept all the other date-time formatting in that locale's LC_TIME, not just the date format. No other locale has LC_TIME the same as en_GB but with just the date format changed.
We have various choices as to what to do. The simplest of these is to edit the en_GB locale but only to change the specific element that you require. That is what we are going to do.
First, we need to make a copy of the existing en_GB locale in case anything goes awry. Because this file is a system file, you will need to use sudo to make the copy.
Great. Hazel's comment on the separation of the various locale elements is very pertinent, but in your case you want to change just one element of LC_TIME which contains the date/time formats (i.e. change / to - in the date format). So, if you were to use another locale for LC_TIME, you would have to accept all the other date-time formatting in that locale's LC_TIME, not just the date format. No other locale has LC_TIME the same as en_GB but with just the date format changed.
We have various choices as to what to do. The simplest of these is to edit the en_GB locale but only to change the specific element that you require. That is what we are going to do.
First, we need to make a copy of the existing en_GB locale in case anything goes awry. Because this file is a system file, you will need to use sudo to make the copy.
In the terminal:
cd /usr/share/i18n/locales
sudo cp en_GB en_GB%old
Done that, and I can see by using the up arrow (same as DOS, I noticed) I could get it to repeat some previous commands and list the files in that directory. The #en_GB%old# is there.
Done that, and I can see by using the up arrow (same as DOS, I noticed) I could get it to repeat some previous commands and list the files in that directory. The #en_GB%old# is there.
Great. Now for some editing. The default text editor in Mint 18 is xed so we will use that. Again, because it is a system file we need to edit the file as if we were a root user, not an ordinary user. Because we are going to use a GUI program, namely xed, rather than a command on the command line, we use gksudo not sudo (there are some subtle differences between gksudo and sudo which you will find explained elsewhere on the web).
gksudo xed en_GB
You will notice a red bar at the top of the editor that says "Elevated Privileges". This is there to remind you that you are editing as root, not as an ordinary user.
Don't worry that the contents of the file look a bit gobbledy-gook. Those <U0073> etc. are just a way of expressing unicode characters (see here for a list of some of them - http://www.utf8-chartable.de/).
Scroll down until you see the LC_TIME section. Then scroll down until you see the subsection called d_fmt. This is the date format, which is currently set to (translating the unicode characters) %d/%m/%y.
The forward slash is represented as <U002F>. You should see two of them on that line. The hyphen is represented as <U002D>. So, you need to change the F to a D on both occasions.
After you have finished, save the file and exit xed.
Great. Now for some editing. The default text editor in Mint 18 is xed so we will use that. Again, because it is a system file we need to edit the file as if we were a root user, not an ordinary user. Because we are going to use a GUI program, namely xed, rather than a command on the command line, we use gksudo not sudo (there are some subtle differences between gksudo and sudo which you will find explained elsewhere on the web).
gksudo xed en_GB
You will notice a red bar at the top of the editor that says "Elevated Privileges". This is there to remind you that you are editing as root, not as an ordinary user.
Don't worry that the contents of the file look a bit gobbledy-gook. Those <U0073> etc. are just a way of expressing unicode characters (see here for a list of some of them - http://www.utf8-chartable.de/).
Scroll down until you see the LC_TIME section. Then scroll down until you see the subsection called d_fmt. This is the date format, which is currently set to (translating the unicode characters) %d/%m/%y.
The forward slash is represented as <U002F>. You should see two of them on that line. The hyphen is represented as <U002D>. So, you need to change the F to a D on both occasions.
After you have finished, save the file and exit xed.
Excellent. Now we have to "generate" the locale. This is a way of making it available to the system. Run the following command to generate not only the en_GB locale, but also the small number of other locales that have been marked as potentially available (and which we haven't changed so no need to worry about those).
Excellent. Now we have to "generate" the locale. This is a way of making it available to the system. Run the following command to generate not only the en_GB locale, but also the small number of other locales that have been marked as potentially available (and which we haven't changed so no need to worry about those).
sudo locale-gen
I'm completely lost now as to what it's doing? I pasted the command and I see it's listed 18 "locales" is that the correct term?
(Including GB and TH, the two relevant ones?)
I'm completely lost now as to what it's doing? I pasted the command and I see it's listed 18 "locales" is that the correct term?
(Including GB and TH, the two relevant ones?)
Thanks. Don't worry about being "completely lost". You know when you write a program, and then you compile it so that the program can actually be run? You can think of locale-gen being the equivalent of compilation for locales. It now means that the system can use it.
Let's check that all is good. Enter the following on the command line (it will show you the current date expressed in the format described in the current locale i.e. en_GB):
date +%x
If this shows the date hyphenated as you require, relaunch Thunderbird Lightning and see if the date is now presented as you want it.
Thanks. Don't worry about being "completely lost". You know when you write a program, and then you compile it so that the program can actually be run? You can think of locale-gen being the equivalent of compilation for locales. It now means that the system can use it.
Let's check that all is good. Enter the following on the command line (it will show you the current date expressed in the format described in the current locale i.e. en_GB):
date +%x
If this shows the date hyphenated as you require, relaunch Thunderbird Lightning and see if the date is now presented as you want it.
In the terminal window it does indeed show the date with the hyphen. However, I closed and reopened Thunderbird, but Calendar still shows the date with a forward slash.
I haven't tried rebooting yet. Reluctant to do that at the moment. Perhaps it's not necessary?
In the terminal window it does indeed show the date with the hyphen. However, I closed and reopened Thunderbird, but Calendar still shows the date with a forward slash.
I haven't tried rebooting yet. Reluctant to do that at the moment. Perhaps it's not necessary?
It might be necessary to reboot, or at least to log out and log in again, depending on what Thunderbird has running in the background.
If we find that Thunderbird's Calendar isn't using the hyphens, then the Calendar isn't referring to your computer's current locale, and we'll have to find out how to change that.
It might be necessary to reboot, or at least to log out and log in again, depending on what Thunderbird has running in the background.
If we find that Thunderbird's Calendar isn't using the hyphens, then the Calendar isn't referring to your computer's current locale, and we'll have to find out how to change that.
Whoaaa! Rebooted Mint and Thunderbird is now using the hyphens!
Thanks so much for your help with this hydrurga. Obviously I had no idea what I was doing a lot of the time, but it does show I can follow meaningless (to me) instructions, ha ha!
Whoaaa! Rebooted Mint and Thunderbird is now using the hyphens!
Thanks so much for your help with this hydrurga. Obviously I had no idea what I was doing a lot of the time, but it does show I can follow meaningless (to me) instructions, ha ha!
Splendid! If you actually look back at the instructions, and miss out all my waffle, there wasn't much to do at all.
One small caveat. You've effectively edited the en_GB locale. This means that if at any point in the future the en_GB locale file is updated by the system, you will need to make the same modification to the file. This is pretty unlikely however, although it might happen after a major upgrade to a new version of Mint. It is worth bearing in mind though just in case you see those forward slashes appear again at some point and wonder what's happened.
Splendid! If you actually look back at the instructions, and miss out all my waffle, there wasn't much to do at all.
One small caveat. You've effectively edited the en_GB locale. This means that if at any point in the future the en_GB locale file is updated by the system, you will need to make the same modification to the file. This is pretty unlikely however, although it might happen after a major upgrade to a new version of Mint. It is worth bearing in mind though just in case you see those forward slashes appear again at some point and wonder what's happened.
Enjoy!
OK, I've saved your excellent instructions, in case I need to refer to them in the future. Thanks again.
I've copied this as well. I've never needed to edit a locale so far but it's nice to know I now can if I want to. And I've marked the edit instructions as helpful. I suggest, paxolin, that you do the same.
I've copied this as well. I've never needed to edit a locale so far but it's nice to know I now can if I want to. And I've marked the edit instructions as helpful. I suggest, paxolin, that you do the same.
I'd marked some of the other posts in hydrurga's instructions as helpful already.
OK, I've added the specific one regarding editing the locale too, now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.