Вопрос

My situation is that languages that are left-to-right fits well on my UIStoryboard with some minor tweaks; that's no problem.

But I don't know how to handle languages that are right-to-left. Are we supposed to have different Storyboards for these languages? Since these languages are from right-to-left the alignment of labels and buttons should be right-aligned I guess.

What's the best way to deal with these languages?

Thanks for your help.

Это было полезно?

Решение

I had to once work on an app with multiple localized storyboard, and this was a mess. The problem is, instead of 1 storyboard to modify if something is wrong, you got multiple. Two times the job is bad...

When I was confronted to the same problem again (but I wasn't using storyboard), i dealed with it by detecting the phone language and applying differents options regarding the language :

+ (BOOL)isDeviceLocalizationFrench{
    NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
    return [language rangeOfString:@"fr"].location != NSNotFound;
}

Then make your label "seen" in your controllers by making IBOUlets, and modify the text alignment for thoses labels according to the language. This might seems a long process at first, but it's not as hard has managing multiple storyboard on the long term.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top