Closed Bug 299757 Opened 20 years ago Closed 20 years ago

Dates in Go menu not localizable

Categories

(Camino Graveyard :: Translations, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino0.9

People

(Reporter: markus, Assigned: Usul)

References

Details

Attachments

(2 files, 3 obsolete files)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050620 Camino/0.9a1 Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050620 Camino/0.9a1 In the Go-meny, in the History-part, the choices for "Earlier today" and "Yesterday" are localized, but then it says for example "Friday June 24". These strings doesn't seem to be localizable. Reproducible: Always Steps to Reproduce: 1. Keep your history for more than two days 2. Check your Go-meny Actual Results: The strings are not localized. Expected Results: The strings should be localized.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: camino0.9?
"Today" and "Yesterday" are localizable. Other dates use [NSCalendarDate descriptionWithCalendarFormat:@"%A %B %d"]. The last bucket, "More than a week ago", is also localizable. Maybe I need to do something like the suggestion here: http://www.cocoabuilder.com/archive/message/cocoa/2004/6/14/109716 but I don't know if it's possible to get the format that I want.
Summary: Dates in Go-meny not localizable → Dates in Go menu not localizable
Attached patch Patch localizing dates (obsolete) (deleted) — Splinter Review
Simon gave me the hint for the patch. I just tested it. Thanks simon.
Attachment #188352 - Flags: review?(mozilla)
Depends on: 244328
(In reply to comment #2) > Created an attachment (id=188352) [edit] > Patch localizing dates > > Simon gave me the hint for the patch. I just tested it. Thanks simon. Looks good to me, except that I'd move the [[NSUserDefaults standardUserDefaults] dictionaryRepresentation] outside of the for loop: NSDictionary *locale = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; (swapping in |locale| where the method call is now). It's only six items though, so it probably doesn't matter very much.
Did anyone find documentation saying that [[NSUserDefaults standardUserDefaults] dictionaryRepresentation] was the right thing to pass in for locale: ? I saw it on a mailing list, but it seems a little odd.
Flags: camino0.9? → camino0.9+
Target Milestone: --- → Camino0.9
(In reply to comment #4) > Did anyone find documentation saying that > [[NSUserDefaults standardUserDefaults] dictionaryRepresentation] > was the right thing to pass in for locale: ? > I saw it on a mailing list, but it seems a little odd. It seemed a bit odd to me too, so I checked |defaults read NSGlobalDomain| in the terminal and found keys that are identical to the locale keys for NSCalendarDate (NSMonthNameArray, NSWeekDayNameArray, etc.).
Comment on attachment 188352 [details] [diff] [review] Patch localizing dates OK with me then.
Attachment #188352 - Flags: review?(mozilla) → review+
Attachment #188352 - Flags: superreview?(pinkerton)
looks ok to me, can you put up a new patch with getting the locale dict outside the loop?
One more thing: I noticed we have "HistoryMenuDateFormat" = "%A, %B %d"; in Localizable.strings; why are we hardcoding the format instead of using that?
(In reply to comment #8) > One more thing: I noticed we have > > "HistoryMenuDateFormat" = "%A, %B %d"; > > in Localizable.strings; why are we hardcoding the format instead of using that? Because I'm an idiot?
Attachment #188352 - Flags: superreview?(pinkerton)
Attachment #188352 - Attachment is obsolete: true
Attachment #188443 - Flags: review?(mozilla)
Comment on attachment 188443 [details] [diff] [review] Taking Wheva's comment into account. Getting the format from the users prefs. r=me, with the following caveats: There should only be one space before |NSDictionary*| and |curCalendarLocale|, though, for whoever checks it in. One other concern is that the date format string from the user defaults contains a year. I'm not too concerned about it, but it might look a bit unpolished, since it's pretty obvious what year is being referenced.
Attachment #188443 - Flags: review?(mozilla) → review+
(In reply to comment #11) > One other concern is that the date format string from the user defaults > contains a year. I'm not too concerned about it, but it might look a bit > unpolished, since it's pretty obvious what year is being referenced. Yeah, I don't think we want the default date format; I think we should get the "HistoryMenuDateFormat" localized string.
(In reply to comment #12) > Yeah, I don't think we want the default date format; I think we should get the > "HistoryMenuDateFormat" localized string. I agree, striping the %Y sucks. I'll post a new patch and once the patch is applied I'll post a note on the caminol10n mailing list and on the website.
Attached patch latest version. (obsolete) (deleted) — Splinter Review
Attachment #188443 - Attachment is obsolete: true
Attachment #188565 - Flags: review?(mozilla)
Attachment #188565 - Flags: superreview+
(In reply to comment #14) NSLocalizedString(@"%A %B %d",@"") Should be NSLocalizedString(@"HistoryMenuDateFormat", @"")
Attachment #188565 - Flags: review?(mozilla) → review-
Couldn't hurt to move the NSLocalizedString() call outside of the loop, either, since it's a macro for an Objective-C method. NSString *format = NSLocalizedString(@"HistoryMenuDateFormat", @""); or whatever.
Attached patch Addressing's reviewer comments (deleted) — Splinter Review
If wevah's Ok, could smfr commit it ?
Attachment #188565 - Attachment is obsolete: true
Attachment #188580 - Flags: review?(mozilla)
Comment on attachment 188580 [details] [diff] [review] Addressing's reviewer comments Looks good to me. NSString* sdf=NSLocalizedString(@"HistoryMenuDateFormat", @""); should have spaces around the =, but whoever does the check-in can fix that.
Attachment #188580 - Flags: review?(mozilla) → review+
Attachment #188580 - Flags: superreview?(pinkerton)
Comment on attachment 188580 [details] [diff] [review] Addressing's reviewer comments >Index: HistoryDataSource.mm >=================================================================== >+ NSDictionary* curCalendarLocale = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; >+ NSString* sdf=NSLocalizedString(@"HistoryMenuDateFormat", @""); Use a better variable name than "sdf" (suggest "dateFormat"), and spaces around the "=" please. sr with those fixed.
Attachment #188580 - Flags: superreview?(pinkerton) → superreview+
fixed things smfr mentioned, checked in on trunk
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attached image screen shot of history (deleted) —
It differs from the date set with OS format. year/month/day week is a standard format in Japan. A setup of the date format of OS: https://bugzilla.mozilla.org/attachment.cgi?id=149085
(In reply to comment #21) > Created an attachment (id=188761) [edit] > screen shot of history > > It differs from the date set with OS format. > year/month/day week is a standard format in Japan. > Yes the localizer needs to change the string in localized.string. I've just send a mail on the subject to the caminol10n team so they are now aware that they should do it.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: