GNOME Bugzilla – Bug 644405
gnome-shell not start up due to bug in js/ui/dateMenu.js
Last modified: 2011-03-13 01:59:22 UTC
code in _updateClockAndDate() dateFormat = _("%A %B %e, %Y"); this._date.set_text(displayDate.toLocaleFormat(dateFormat)); sine there is an _(), dateFrmat is already in locale, but displayDate.toLocaleFormat() will try to treat it as non-locale format, and convert it again. But it will failed to do so. How to fix that ? Simply let dateFormat = "%A %B %e, %Y"; And bug fixed.
Sorry, but that fix is wrong. The toLocaleFormat method of Date objects is nothing but a binding of strftime, which formats according for locale for modifiers that are locale dependent (like %X). %A, %B, %e and %Y are not locale dependent, so toLocaleFormat will have the same result in all locales, when called with " On the other hand, not all locales have the same ordering for date, time and day of week, so it is expected that translators will put the modifiers in appropriate order using gettext facilities. If you experienced a crash and solved by removing the gettext call, then it could be a bug in the translation.
It's more complicated than that. I looked into the crash a little while ago and found that it's due to gjs's Unicode handling. It's easy to reproduce: LANG=zh_CN.utf8 ./src/gnome-shell -r libmozjs provides some hooks for locale. The one for toLocaleFormat is gjs_locale_to_unicode: http://git.gnome.org/browse/gjs/tree/gjs/context.c#n484 I believe it's related to bug 643479 and bug 643350
but that fix do give me locale display even I don't put gettext around it.
Created attachment 183117 [details] [review] fix bug 644405 All translations should be fixed this way.
this patch actually fix the proble. I think all translators should just adjust the order , not translate it , because strftime will translate !
*** Bug 644554 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 643350 ***