Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:51:43+00:00 2026-06-01T21:51:43+00:00

After creating new cocoa application,I have added localization string files localizeFile.strings(English) and localizeFile.strings(Spanish) In

  • 0

After creating new cocoa application,I have added localization string files localizeFile.strings(English) and localizeFile.strings(Spanish)

In localizeFile.strings(English) file I added “TITLE” = “Hello!”;

In localizeFile.strings(Spanish) file I added “TITLE” = “Hola!”;

In my class I was trying to access the localized English text in actions with the following statements

-(IBAction)english:(id)sender
{
   // NSString *engText = [[NSBundle mainBundle] localizedStringForKey:@"TITLE" value:@"" table:nil];
    NSString *engText = NSLocalizedString(@"TITLE", nil);
    NSLog(@"engText %@",engText);
    [displayText setStringValue:engText];
}

-(IBAction)spanish:(id)sender
{
    NSString *spanText = NSLocalizedString(@"TITLE", nil);
      NSLog(@"spanText %@",spanText);
    [displayText setStringValue:spanText];
}

Here displayText is NSTextField and two actions in the same window.

I have seen in the console ,engText TITLE instead of engText Hello on clicking the buttons.

Can somebody guide me how can I get localized strings?Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:51:45+00:00Added an answer on June 1, 2026 at 9:51 pm

    It sounds like the application is not aware of localizeFile.strings. Did you declare the languages for the application? Is there a copy rule in your creation profile?

    EDIT

    You can add language here (red arrow):
    enter image description here

    2nd EDIT

    If you want use a language that isn’t set on system level, you can do the following:

        // Assume you have defined constants, e.g. 1 - English, 2 - Espanol, 3 - ....
        switch (language) {
            case kLangEn: // =1
                path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"];
                break:
            case kLangEs: // =2
                path = [[NSBundle mainBundle] pathForResource:@"es" ofType:@"lproj"];
                break:
               // etc.
        }
        NSBundle *languageBundle = [NSBundle bundleWithPathath];
        NSString *str = [languageBundle localizedStringForKey:key value:@"" table:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have such view that handles user registration. After creating new user i want
After a big refactor involving creating new projects and moving files around between them,
I have new to python and django I am creating poll application and in
After creating a new Silverlight application from the JetPack theme template that was installed,
I have a controller in a Rails 3 app that, after creating a new
After creating a new svn-depot and committing a file I get an empty log.
When I try to install gem like bundler or rake after creating new gemset
After creating a new form, I usually perform this ritual: Change the name into
After creating a new object (Foo), I set the key (BarId) for an EntityRef
In many code samples, people usually use '\0' after creating a new char array

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.