MoathOthman / MOLH

Localization helper for iOS apps mainly focusing on the LTR/RTL issue
MIT License
117 stars 36 forks source link

Font Isuus #27

Closed Ali-Alhasani closed 5 years ago

Ali-Alhasani commented 5 years ago

Hi

I would like to ask about MOLHFontLocalizableViews, how the library deals with two font localization. is it possible to change the font type as the language of the app change from Arabic to English, keeping the same labels,textFiled..etc text size?

thanks in advance

MoathOthman commented 5 years ago

for now, you need to subclass certain classes that found in MOLHFontLocalizableViews, e.g. all labels should subclass from MOLHFontLocalizableLabel, and on the start of the app set MOLHFont.shared.arabic to the family name , but for the current approach you don't get to use more than one arabic font variation(I never needed to though).

Ali-Alhasani commented 5 years ago

what do you mean by MOLHFont.shared.arabic to the family name?

MoathOthman commented 5 years ago

Font family name e.g arial

Sent from my iPhone

On Sep 22, 2018, at 3:48 PM, AliHassany notifications@github.com<mailto:notifications@github.com> wrote:

Hi

I would like to ask about MOLHFontLocalizableViews, how the library deals with two font localization. is it possible to change the font type as the language of the app change from Arabic to English, keeping the same labels,textFiled..etc text size?

thanks in advance

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/MoathOthman/MOLH/issues/27, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABHNh-4rkOXoSRrFW9_wJlW0L0L7s3P8ks5udjGqgaJpZM4W1QcQ.

Ali-Alhasani commented 5 years ago

thanks for the information, I have tried in the Demo code but I saw that it only work if the programmatically localized Label String, but not working with the interface localized Label, do you have information about implementing the different font for localized interface labels?

kindly see the edited Demo

MOLH-master-9.zip

Ali-Alhasani commented 5 years ago

I moved updateFont() function to awakeFromNib() instead of did set text, and it work! thanks for the library :)

MoathOthman commented 5 years ago

@AliHassany great to hear that , can you create a PR with your solution.