Reputation: 121
Actually, I need to translate only "done"/"pref"/"next" buttons at decimal pad keyboard to russian language or other. By the way, localization of the application in russian. Moreover, all other buttons like "cancel" at other control was translated automatically when I changed localization language. But not this. Can it be done without customization?
Upvotes: 10
Views: 1376
Reputation: 1578
In his following answer, Oscar describes how to create a custom button and add it as a subview to a UIKeyboard.
You can use the above to create the needed button with the required custom text & selector, then add it to the UIKeyboard in place.
Upvotes: 0
Reputation: 3039
I found the solution: You have to create a infoPlist.strings in your xCode project, and add this code:
/*
InfoPlist.strings
*/
"Done" = "OK";
Then, in your project-> Info, add your language (Spanish in my case).
Later, go back to your infoPlist file, and target "Spanish" in the right menu, under "Localization" tab.
In "Edit scheme", clicking next to the "stop application" button, click run->options and in "Application language" select "System language".
Repeat for all the languages of your app.
Success!!
Upvotes: 3
Reputation: 280
It will help you.
iPhone: Change Keyboard language programmatically.
No this is not possible - user can only change their language in the settings.
However you can give the user an "English" keyboard if you choose (or ask them their preference)
you do this using: UIKeyboardTypeASCIICapable
You can change keyboard directly on the keyboard by pressing "globe icon" on the bottom row.
First, you have to enable those language for input in Settings. Then pressing the globe button on the keyboard would toggle between those languages.
Upvotes: 5