0
votes

I have a Spanish Localization File like this:

"Not Selected" = "No Seleccionado";

and my device is in spanish language ,i use English as default

I load a NSArray for using like datasource of a pickerView with several Strings :

elementsPickerViewSubConstituencyPatient=[[NSArray alloc] initWithObjects:NSLocalizedString(@"Not Selected",nil),
                                                                          NSLocalizedString(@"Carer",nil),
                                                                          NSLocalizedString(@"London Based",nil),
                                                                          NSLocalizedString(@"Non-London Based",nil), nil];

in another method i want to recover the user selected value with:

NSInteger selectedRowConstituency= [self.constituencyFieldPickerOutlet selectedRowInComponent:0];
    NSString *selectedValueConstituency = elementsPickerViewConstituency[selectedRowConstituency];
    NSLog(@"Constituency: %@",selectedValueConstituency);

it works but it return the Spanish Value and i need the English Key , i didn´t find a simple way to do this .thanks

1

1 Answers

0
votes

What you need to do is to strictly keep user data (store whatever the user entered), user interface elements (localised into the user's language) and programming-related items (written in the language that you understand) apart.

Once you have translated something, it's translated, and no way back.