Closed Bug 294731 Opened 19 years ago Closed 19 years ago

[l10n] Bookmarks Manager page/tab title not localizable

Categories

(Camino Graveyard :: Bookmarks, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino0.9

People

(Reporter: m.testi, Assigned: mikepinkerton)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.4.1) Gecko/2002 - Netscape 6.2, Mac OS X
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.4.1) Gecko/2002 - Netscape 6.2, Mac OS X

When you open the BM, it has a default "Bookmarks" title on both page and tab,
which seems not localizable (I can't find anything in the .nib files about this).

Reproducible: Always



Expected Results:  
The "Bookmarks" page/tab title should be localizable.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
We need to add "Bookmarks" = "Bookmarks" in the Localized.string file.
Attachment #184524 - Flags: review?(joshmoz)
Target Milestone: --- → Camino0.9
Attachment #184524 - Flags: review?(joshmoz) → review?(mozilla)
It might be better to do manual string replacement in the HTML string. And put
the html in a resource.
(In reply to comment #1)
Some quick comments:

+#import "nscore.h"

What's nscore.h imported for? If it's for NSString, that's already in
<Foundation/Foundation.h>.

+    NSString *blankPage;
+    blankPage=[NSString stringWithFormat:@"<!DOCTYPE html PUBLIC \"-//W3C//DTD
HTML 4.01
Transitional//EN\">\n<html><head><title>%@</title></head><body></body></html>",NSLocalizedString(@"Bookmarks",@"Bookmarks")];

If this is initialized each time, it should be assigned and declared
simultaneously. Also, there should be spaces around the = sign and after the
comma (style, and all that):

NSString *blankPage = [NSString stringWithFormat:@"<!DOCTYPE html PUBLIC
\"-//W3C//DTD HTML 4.01
Transitional//EN\">\n<html><head><title>%@</title></head><body></body></html>",
NSLocalizedString(@"Bookmarks",@"Bookmarks")];

(Also, the second argument to NSLocalizedString() is just thrown away, but it
doesn't matter much.)

Alternatively, we could declare |blankPage| as |static NSString * const|,
similar to what the current version does. AFAIK, localized strings aren't
changed mid-application run (but I could be wrong about that). If so, the
initialization would be inside of the call, with an if:

if (!blankPage) blankPage = ...

Finally,

+    rv = NS_NewCStringInputStream(getter_AddRefs(in),
nsDependentCString([blankPage cString]));

should use |[blankPage UTF8String]| since -cString is deprecated (or soon to be).
(In reply to comment #3) 
> Alternatively, we could declare |blankPage| as |static NSString * const|,
> similar to what the current version does.

Oops, no |const|, just |static NSString *|, since it's assigned at runtime and
not a constant value.
fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 184524 [details] [diff] [review]
patch correcting the problem

i made the changes wevah suggested.
Attachment #184524 - Flags: review?(mozilla)
I'm going to be touching this code so that we show "Bookmarks" or "History" as
appropriate. Don't panic :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: