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

  • Home
  • SEARCH
  • 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 8935431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:58:45+00:00 2026-06-15T09:58:45+00:00

In my application, i need to provide three languages support. My default language will

  • 0

In my application, i need to provide three languages support. My default language will be English. Once the user selects other language in setting controller the entire application should change into that particular language. For this i decided to have a plist file with all the three languages and their data in it.Now my default language is English that is fine. Now i changed the language using plist in LanguageController and pushed to home controller. The selected language(French) string was not received in my home controller. Here is my code,

//LanguageController.h

NSMutableDictionary *allDictElements;
NSString *selectedLanguage1;
NSArray *dummy;

@property(nonatomic,retain) NSMutableDictionary *allDictElements;
@property(nonatomic,retain) NSString *selectedLanguage1;
@property(nonatomic,retain) NSArray *dummy;

 //LanguageController.m

@synthesize allDictElements,selectedLanguage1,dummy;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    NSString *path= [[NSBundle mainBundle] pathForResource:@"Language" ofType:@"plist"];

    allDictElements = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
    NSLog(@"%@allDictElements",allDictElements);

    LeeValleyHomeViewController *homeController = [[LeeValleyHomeViewController alloc] initWithNibName:@"LeeValleyHomeViewController" bundle:[NSBundle mainBundle]];

     if (indexPath.row ==0)
     {
        //bookshelf button
        NSMutableDictionary *english=[[NSMutableDictionary alloc]init];
        english=[allDictElements objectForKey:@"English Language"];
        dummy=[english objectForKey:@"English"];
        selectedLanguage1=[dummy objectAtIndex:0];
        NSLog(@"english bookshelf button:%@",selectedLanguage1);
        homeController.selectedLanguage = selectedLanguage1;  
        NSLog(@"sel lang:%@",homeController.selectedLanguage);

     } else if (indexPath.row ==1) {
        //bookshelf button
        NSMutableDictionary *french=[[NSMutableDictionary alloc]init];
        french=[allDictElements objectForKey:@"French Language"];
        dummy=[french objectForKey:@"French"];
        selectedLanguage1=[dummy objectAtIndex:0];
        NSLog(@"french bookshelf button:%@",selectedLanguage1);
        homeController.selectedLanguage = selectedLanguage1;
        NSLog(@"sel lang:%@",homeController.selectedLanguage);

    } else {

        NSMutableDictionary *spanish=[[NSMutableDictionary alloc]init];
        spanish=[allDictElements objectForKey:@"Spanish Language"];
        dummy=[spanish objectForKey:@"Spanish"];
        selectedLanguage1=[dummy objectAtIndex:0];
        NSLog(@"spanish bookshelf button:%@",selectedLanguage1);
        homeController.selectedLanguage = selectedLanguage1;
        NSLog(@"sel lang:%@",homeController.selectedLanguage);
    }

    [self.navigationController pushViewController:homeController animated:YES];
}

Here in this controller am receiving the selected language string finely.

//LeeValleyHomeViewController.h

NSString *selectedLanguage;

@property (nonatomic,retain) NSString *selectedLanguage;

 //LeeValleyHomeViewController.m

@synthesize selectedLanguage;

- (void)viewDidLoad
{
    LanguageViewController lvc = [LanguageViewController alloc]init];
    bookshelfbtn.titleLabel.text = lvc.selectedLanguage1;
    NSLog(@"button title:%@",bookshelfbtn.titleLabel.text);
   //bookshelfbtn.titleLabel.text = selectedLanguage;
}

Here in this controller am not receiving that string value. What’s wrong with my code? or how can i do this? Thanks in advance.

  • 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-15T09:58:46+00:00Added an answer on June 15, 2026 at 9:58 am

    I’m not certain if “LanguageController” you have in the first block of code is the same thing as “LanguageViewController” in your second block of code.

    But if it is, why do you think the “selectedLanguage1” property would be set to anything other than zero after you instantiate that “LanguageViewController“? The user hasn’t touched any cell yet so the only language that it could possibly be is English (with a value of value zero).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a scientific/education application, and I need to provide power-user scripting capabilities. My
I would like to provide user possibility to select application language on login. But
To create facebook android native app we need to provide our Android application signature
In my application I need to know the user's Facebook uid. I get by
I have a site that will ultimately support 4 languages and 2 countries (US
I am programming an activation code for my application, I need to provide the
The application need write file's last modification date. void Dater(String DateFile) { File file
In the java web application need to select the file from server and print
Almost all the activities in my application need to interact with a web server
Hi every body i am new in iPhone application development. In my application need

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.