Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Why won't this localize?

Why won't this localize?
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 30, 2003, 10:54 PM
 
My program has a French version and almost everything localizes except for a few things and I can't figure out why. The main thing that won't localize are strings drawn in an NSView.

My custom view draws a string, using [theString drawAtPoint:aPoint withAttributes:attrDict].

I have the following line in my drawRect method:

[self drawTitles:NSLocalizedString(@"Test", nil)];

//Here is drawTitles

-(void)drawTitles:(NSString *)title {

NSRect rect = [self bounds];
float l = [title length];
NSPoint p = NSMakePoint(rect.size.width/2.0 -(2.7*l) , rect.size.height-18.0);
[title drawAtPoint:p withAttributes:info];
}

If in my French localizable strings file I put
"Test" = "French Test";
French Test will not get drawn--"Test" gets drawn.

Now if in my English localizalbe strings file I put "Test" = "English Test";
"English Test" gets drawn. I haven't had problems like this before with localizing, but this one I can't figure out.

Help appreciated.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 31, 2003, 05:37 AM
 
Get info on your French Localizable.strings in Project Builder, and make sure it's either UTF-8 or UTF-16.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 31, 2003, 10:30 AM
 
Thanks for the suggestion, it is in UTF-8 format...still no luck
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 31, 2003, 04:17 PM
 
Check you haven't missed a ; or a " or anything. See if you get any errors in the console about not being able to parse the file.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 31, 2003, 04:29 PM
 
Nope, no console errors and I have checked and checked for missing commas or mis-spellings. Still can't figure it out! I know the French files are getting loaded because other things are localized, like toolbar labels.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2