-1

I have English string like "my name is abc". I want show it in Arabic I don't want to put Arabic strings in project .I want to use on NSString or any available functions in Objective c.

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
Imran
  • 2,985
  • 19
  • 33

4 Answers4

2

If you want to localize your application you must enable it in the application and provide a Localizable.strings which contains all the translations.

you can use it like this:

someTextField.text= NSLocalizedString(@"The text you need to translate", @"comment_optional");

then in your Localizable.strings you should have:

"The text you need to translate" = "the translation you need";

reference for using NSlocalizedString (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html)

Joshua
  • 2,432
  • 1
  • 20
  • 29
1

It is not possible. You will have to put language resources inside the project to support multiple language.

Apurv
  • 17,116
  • 8
  • 51
  • 67
1

I think what you want is translate English to Arabic and not localisation (correctly pointed out by Rajneesh071 as well).

If you are looking for an offline solution, you are out of luck as it is not possible. For online solution, you can make use of Google translate API. It returns JSON response which can be parsed and displayed in your application.

Refer this tutorial for more information on how to use this api in iOS.

Hope that helps!

Amar
  • 13,202
  • 7
  • 53
  • 71
0

You can use Localization in your application. You must define another string file which consist arabic language This link you can take as a reference.

Maulik Kundaliya
  • 452
  • 3
  • 17