stuartlangridge/gnome-shell-clock-override

Add ability to change locale

Closed this issue · 2 comments

I want the ability to have my GNOME in one language and my clock in another. Is that possible for an extension to do?

da2x commented

This extension only works with the clock at the top of GNOME. I'll not add specific settings for changing the locale for only this one part of the desktop.

You can set the date and time locale on your system by changing the LC_TIME environmental variable on your system, however. Here are instructions for changing this on Ubuntu. Instructions vary by distro and you'll probably find instructions for your distribution elsewhere online.

  1. Open the Clock override settings.
  2. Set "Text to display insteed of the clock" to ${m[%-m]} %d ${w[%w]} %R. ${m[%-m]} is the month and ${w[%w]} is the day of the week.
  3. Add the following two lines under var settings;
const w = new Array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.');
const m = new Array('', 'Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.');
  1. Rewrite var FORMAT = settings.get_string("override-string"); to
var FORMAT = "`" + settings.get_string("override-string") + "`";
  1. Rewrite var desired = Format.format(FORMAT, now); to
var desired = eval(Format.format(FORMAT, now));
  1. Press alt + f2, type r, and press Enter to restart gnome-shell.

Note that this change will be reset when the Clock override is updated.