Reputation: 2095
Since ParseUI is Open Source it is easy to find that all labels are localized in ParseUI.strings
How can I tell xcode not to use ParseUI.strings at runtime but my Localisable.strings?
I have created the following structure in my project:
But I can see in the debugger file that my Localisable.strings are not used:
2015-05-17 22:27:17.711 CoreParse[3582:216694] Localizable string "Loading..." not found in strings table "ParseUI" of bundle CFBundle 0x7f9d93455640 (executable, loaded). 2015-05-17 22:27:17.784 CoreParse[3582:216694] Localizable string "Username" not found in strings table "ParseUI" of bundle CFBundle 0x7f9d93455640 (executable, loaded). 2015-05-17 22:27:17.784 CoreParse[3582:216694] Localizable string "Password" not found in strings table "ParseUI" of bundle CFBundle 0x7f9d93455640 (executable, loaded).
Upvotes: 3
Views: 285
Reputation: 56
I have just faced the same problem. But I found that you can create a localized string file named "ParseUI.strings" in your project and localise it, the ParseUI module will then read the localised string from that file.
Contents in the localized String (github link from ParseUI): https://github.com/ParsePlatform/ParseUI-iOS/raw/master/ParseUI/Resources/Localization/en.lproj/ParseUI.strings
Upvotes: 4
Reputation: 3085
This is what I did to temporary solve this issue and still using my own Localizable.strings file.
PFLogInViewController *logInViewController = [[PFLogInViewController alloc] init];
logInViewController.delegate = self;
[logInViewController setFacebookPermissions:[NSArray arrayWithObjects:@"user_friends",@"email", @"public_profile", nil]];
logInViewController.fields = PFLogInFieldsDefault | PFLogInFieldsFacebook | PFLogInFieldsTwitter | PFLogInFieldsSignUpButton;
[logInViewController.logInView.usernameField setPlaceholder:NSLocalizedString(@"Username", @"")];
[logInViewController.logInView.passwordField setPlaceholder:NSLocalizedString(@"Password", @"")];
[logInViewController.logInView.logInButton setTitle:NSLocalizedString(@"Log In", @"") forState:UIControlStateNormal];
[logInViewController.logInView.passwordForgottenButton setTitle:NSLocalizedString(@"Forgot Password?", @"") forState:UIControlStateNormal];
[logInViewController.logInView.signUpButton setTitle:NSLocalizedString(@"Sign Up", @"") forState:UIControlStateNormal];
// Create the sign up view controller
PFSignUpViewController *signUpViewController = [[PFSignUpViewController alloc] init];
[signUpViewController setDelegate:self]; // Set ourselves as the delegate
[signUpViewController.signUpView.usernameField setPlaceholder:NSLocalizedString(@"Username", @"")];
[signUpViewController.signUpView.passwordField setPlaceholder:NSLocalizedString(@"Password", @"")];
[signUpViewController.signUpView.emailField setPlaceholder:NSLocalizedString(@"Email", @"")];
[signUpViewController.signUpView.signUpButton setTitle:NSLocalizedString(@"Sign Up", @"") forState:UIControlStateNormal];
// Assign our sign up controller to be displayed from the login controller
[logInViewController setSignUpController:signUpViewController];
There are still an issue with Sign Up button, because they use a special state and I couldn't figure out how to change it properly.
Upvotes: 1