Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have done same kind of task in my recent project Need to support Arabic &amp; English. Where I need to change Language according selected option from list. I have created two .xib one for Arabic and one for english and then select</p> <p>// for setting bundle</p> <pre><code>+(void) setContentBundle{ SS AppDelegate *delegate = [[UIApplication sharedApplication] delegate]; NSString *currentLanguage; if([delegate.strLanguage length]&gt; 0) { currentLanguage = delegate.strLanguage; }else { currentLanguage = @"en"; } if ([currentLanguage isEqualToString:@"ar"]) { // If ARABIC. languageBundle = nil; NSString* path = [[NSBundle mainBundle] pathForResource:@"ar" ofType:@"lproj"]; languageBundle = [NSBundle bundleWithPath:path]; }else if ([currentLanguage isEqualToString:@"en"]){ // If ENGLISH. languageBundle = nil; NSString* path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]; languageBundle = [NSBundle bundleWithPath:path]; } } // getting localiation key value +(NSString *)getLocalizedStringForKey:(NSString *)key value:(NSString *)v table:(NSString *)t{ if([key isEqualToString:@"FollowUp.DepartmentKey"]){ NSLog(@"%@",key); } SSAppDelegate *delegate = (SSAppDelegate *)[UIApplication sharedApplication].delegate; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"KEY LIKE[c] %@", key]; NSArray *filteredArray = [delegate.arrSystemMessages filteredArrayUsingPredicate:predicate]; NSLog(@"%@", filteredArray); if(filteredArray!=nil &amp;&amp; [filteredArray count]&gt;=1){ NSMutableDictionary *dict=[filteredArray objectAtIndex:0]; if([[ContentBundleManager selectLanguage] isEqualToString:@"ar"]){ return [dict valueForKey:@"AR"]; }else{ return [dict valueForKey:@"EN"]; } }else{ return [[ContentBundleManager getContentBundle] localizedStringForKey:key value:v table:t]; } } //for getting bundle +(NSBundle *) getContentBundle{ SSAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; NSString *currentLanguage; if([delegate.strLanguage length]&gt; 0) { currentLanguage = delegate.strLanguage; }else { currentLanguage = @"en"; } if ([currentLanguage isEqualToString:@"ar"]) { // If ARABIC. languageBundle = nil; NSString* path = [[NSBundle mainBundle] pathForResource:@"ar" ofType:@"lproj"]; languageBundle = [NSBundle bundleWithPath:path]; }else if ([currentLanguage isEqualToString:@"en"]){ // If ENGLISH. languageBundle = nil; NSString* path = [[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]; languageBundle = [NSBundle bundleWithPath:path]; } return languageBundle; } /// and call .xib SSBaseViewController *baseView= [SSLBaseViewController getBaseViewObjectWithBundle:nil]; /// and call string file [baseView setHeaderTitle:[ContentBundleManager getLocalizedStringForKey:@"FollowUp.FollowUpKey" value:@"" table:nil]]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload