Closed
Bug 976966
Opened 11 years ago
Closed 11 years ago
Make AM/PM localizable and let locales change its position in time displayed on lock screen
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Firefox OS Graveyard
Gaia::System
Tracking
(blocking-b2g:1.4+, b2g-v1.4 fixed)
Tracking | Status | |
---|---|---|
b2g-v1.4 | --- | fixed |
People
(Reporter: flod, Assigned: flod)
References
Details
Attachments
(2 files)
Time displayed on lock screen should follow format specified in
shortTimeFormat = %I:%M %p
Some locales (e.g. zh-TW) need to position AM/PM before the time (%p %I:%M) and this currently not possible.
Assignee | ||
Updated•11 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 1•11 years ago
|
||
Kaze, in bug 932270 comment 7 you wrote home screen, but I think you were referring to the lockscreen (moving to System for now).
system.properties
> # either 24-hour format (%H:%M) or 12-hour without AM/PM (%I:%M)
> statusbarTimeFormat=%I:%M
But I can't find any reference in the code for this string, while I found 3 references to shortTimeFormat and hard-coded AM/PM
Component: Gaia::Homescreen → Gaia::System
Summary: Use shortTimeFormat from shared/date for time displayed on lock screen → Make AM/PM localizable in time displayed on lock screen
Assignee | ||
Updated•11 years ago
|
Summary: Make AM/PM localizable in time displayed on lock screen → Make AM/PM localizable and let locales change its position in time displayed on lock screen
Assignee | ||
Comment 2•11 years ago
|
||
Note that this bug becomes pretty urgent after bug 932270 lands: if a locale changes AM|PM, we're basically not displaying anything besides hh:mm
Comment 3•11 years ago
|
||
Yes, the `statusbarTimeFormat' was an old UX request to hide the meridiem in the statusbar — it’s obsolete now, thanks for catching this.
For the System app I’d suggest to create a “pretty” time format from the common `shortTimeFormat'. Something like:
var timeFormat = _('shortTimeFormat').replace('%p', '<span>%p</span>');
element.innerHTML = f.localeFormat(now, timeFormat);
This would work just fine for statusbar.js and media_recording.js.
For the lockscreen clock, you’ll have to:
• remove the content of div.lockscreen-lock (index.html, line 1074);
• modify the CSS accordingly in statusbar.css, something like: (untested)
.lockscreen-clock {
margin: -0.8rem 0 -1rem -0.4rem;
font-weight: 300;
font-size: calc(26 * 0.226rem);
}
.lockscreen-clock span { /* optional meridiem */
font-size: calc(17 * 0.226rem);
}
I hope this helps. :-)
Assignee | ||
Comment 4•11 years ago
|
||
Thanks kaze, this approach is definitely better than the one I first used.
Waiting for Travis to run online on the PR, can't run it on Nightly for some reasons.
Assignee | ||
Comment 5•11 years ago
|
||
Strangely enough, travis passed.
https://travis-ci.org/mozilla-b2g/gaia/builds/19653279
Note on the screenshot above: I set shortTimeFormat as "%p %I:%M" and AX/PX as localization for AM/PM
Attachment #8382235 -
Flags: review?(kaze)
Assignee | ||
Comment 6•11 years ago
|
||
Setting 1.4?
Without this change, if a locale changes the translation of AM or PM, we're not displaying the time correctly.
blocking-b2g: --- → 1.4?
Comment 7•11 years ago
|
||
Comment on attachment 8382235 [details]
Pull request on Github
LGTM. Thanks for taking the time to polish this patch and taking reference screenshots!
Attachment #8382235 -
Flags: review?(kaze) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 8•11 years ago
|
||
Master: db6668d3ce79879b7213967ec6ef8d4a446e29e9
Assignee: nobody → francesco.lodolo
Status: NEW → RESOLVED
Closed: 11 years ago
status-b2g-v1.4:
--- → fixed
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S2 (28feb)
Updated•11 years ago
|
blocking-b2g: 1.4? → 1.4+
Assignee | ||
Comment 9•11 years ago
|
||
Verified on Keon with build 20140307, setting phone to zh-TW.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•