• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Russian Language Support (Pref Pane)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Russian Language Support (Pref Pane)


  • Subject: Re: Russian Language Support (Pref Pane)
  • From: Daniel Stødle <email@hidden>
  • Date: Wed, 26 Apr 2006 09:53:59 +0200

Hi Herb,

Is it possible to get russian working in a PrefPane? I have tried everything
(we'll see :-) ).


I looked at another project (Growl) and they do have Russian strings within
it, but they won't load when the language is set to russian either.


Is this a known bug, or does Russian have to be done differently somehow in
a pane?

I had the same problem when developing the preference pane for FolderGlance, although in my case the localization was Polish. I worked around it by detecting the localization at runtime, and then offering the user the option to rename the English localization inside my preference pane bundle if the current preferred locale is Polish. My code basically goes something like this:


- (void)checkLocalization {
NSBundle *bundle;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSString *preferredLang = [languages objectAtIndex:0];


  // Users can opt to skip the language check
  if ([defaults boolForKey:@"perform_language_check"]) {
    // Check the array for the Polish locale identifier.
    if ([preferredLang compare:@"pl"] == NSOrderedSame ||
        [preferredLang compare:@"pol"] == NSOrderedSame ||
        [preferredLang compare:@"Polish"] == NSOrderedSame) {

      // User's preferred language is Polish. Let's verify that our
      // bundle is in fact using the Polish locale
      bundle        = [NSBundle bundleForClass:[self class]];
      languages     = [bundle preferredLocalizations];
      preferredLang = [languages objectAtIndex:0];

      // Check the loaded bundle's locale
      if ([preferredLang compare:@"pl"] != NSOrderedSame &&
          [preferredLang compare:@"pol"] != NSOrderedSame &&
          [preferredLang compare:@"Polish"] != NSOrderedSame) {

// Bundle's locale isn't Polish, so let's see if the user wants
// to do something about it.
NSBeginAlertSheet(@"Change localization?", @"No", @"Yes",
@"No, don't ask again",[[self mainView] window],
self,@selector (fixLocaleSheetDidEnd:returnCode:contextInfo:),
0,0, @"Localized string asking your user if it's okay to change locale..");
}
}
}
}


If the user decides to use the Polish locale, I run a script that simply renames the English.lproj directory within my preference pane's bundle. Next time System Prefs launches, my preference pane will appear in the "correct" language.

Best Regards,
Daniel Stødle
Yellow Lemon Software
Drill down into folders and packages with FolderGlance:
<http://home.online.no/~stoedle/YLS/YLS-products/FolderGlance.html>
<http://www.cs.uit.no/~daniels/YLS/FolderGlance.dmg.zip>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Newbie questions
  • Next by Date: Recursive functions and stack overload
  • Previous by thread: Re: Russian Language Support (Pref Pane)
  • Next by thread: Preserving whitespace when creating NSXMLDocument
  • Index(es):
    • Date
    • Thread