I
I
Ivan Gnatyuk2014-01-16 21:10:40
iOS
Ivan Gnatyuk, 2014-01-16 21:10:40

Is it possible to localize UI elements in Xcode iOS?

Is it possible to put in a naive way that the inscription in the searcBar for cancellation was not "cancel", but "cancel", in the TableView with commitEditingStyle there were inscriptions in the lines not "Delete", but "Delete". Is it generally possible to somehow prescribe it in the environment settings, or somewhere else, or can you just prescribe it yourself? In the simulator, the Russian language is in the settings. Searched the net in both languages ​​- did not find any information

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mr_Kibernetik, 2014-01-16
@Mr_Kibernetik

In the UISearchBar, the "Cancel" button is already displayed as "Cancel" if the iOS language is Russian.
And when you delete a table row, the button says "Delete".

M
Mr_Kibernetik, 2014-01-17
@Mr_Kibernetik

You can try this solution:

[[UIButton appearanceWhenContainedIn:[UISearchBar class], nil] 
                                     setTitle:NSLocalizedString(@"cancel", nil) 
                                     forState:UIControlStateNormal];

With the appropriate localization of the word "cancel".

C
corristo, 2014-01-21
@corristo

You can specify the AppleLanguages ​​and AppleLocale arguments in your scheme, for example:
https://www.dropbox.com/s/65mxc3k60j5bw5s/Screensh...
Then, regardless of the current locale of the simulator or device, when you run this scheme, the required language and locale will be in the application.
But in Xcode itself, I'm afraid it will not work to force the display of localized strings of system controls.

A
Andrey Mamchenko, 2015-12-23
@atMamont

For development, it is convenient in the plist file to specify the desired localization code in the
Localization native development region parameter, for example "ru"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question