Question

This is not a question on localizing an existing app. Just wanted that to be clear. I have decent enough knowledge on creating iOS apps. I would like to create my first app which will feature both English and Arabic. Specifically, I am trying to create a Flash Cards / Learning Arabic vocabulary app which will use English and Arabic words side by side. I would like to use a nicely stylized Arabic font with full support for marking all the vowels (damma, fatha, kasha etc).

I am looking for some guidance as to where to start on (tutorials, wikis). I know how to create localization for an app but I would like to create vocabulary words and I cannot seem to make that connection on how to include arabic words as standalone words in NSArrays and NSDictionaries. Any pointers would be greatly appreciated from those how have created such apps or those who know where I should begin my knowledge search. Thanks

Was it helpful?

Solution

I would recommend against mixing Arabic words in your source code. Although it should work if your source code files are UTF-8, mixing languages with different writing directions is bound to be frustrating.

I recommend you use a file with all the words you want (one per line, for example) and load them in your code.

So don't do this:

NSString *s = @"وابة استرجاع أي لان";

Do this:

NSString *s = [NSString stringWithContentsOfFile:@"/some/file" encoding:NSUTF8StringEncoding error:&error];

OTHER TIPS

NSString is Unicode-based. You can enter Arabic strings directly in your code or read them from a file and store and manipulate them as NSStrings. No special work is required.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top