Use LC_TIME locale for strftime format string translations
We commonly mark strftime format strings for translation to account for date/time representations without an existing strftime shortcut ("Yesterday %H%p"). As those translations are looked up according to the locale defined by LC_MESSAGES, while the conversion characters themselves are resolved according to LC_TIME, the result can be rather odd when mixing locales ("Den 27. January"). The correct solution would be to install translations for format strings in the LC_TIME catalogue and look them up with dcgettext(), but we don't have the infrastructure to do that easily. Work around this by adding a helper method that looks up a string in LC_MESSAGES using the locale defined by LC_TIME and use that to translate format strings, which has the same result. https://bugzilla.gnome.org/show_bug.cgi?id=738640
This commit is contained in:
@ -129,7 +129,7 @@ const DateMenuButton = new Lang.Class({
|
||||
/* Translators: This is the date format to use when the calendar popup is
|
||||
* shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
|
||||
*/
|
||||
let dateFormat = _("%A %B %e, %Y");
|
||||
let dateFormat = Shell.util_translate_time_string ("%A %B %e, %Y");
|
||||
this._date.set_label(now.toLocaleFormat(dateFormat));
|
||||
}
|
||||
}));
|
||||
|
Reference in New Issue
Block a user