MoathOthman / MOLH

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

Language of UIActivityViewController Does not change when Reset #50

Open mEldewaik opened 4 years ago

mEldewaik commented 4 years ago

When Change Language from english to Arabic Or reverse UIAlertViewController does not localized unless i restart the app please i need fix i faced this issue and tried alot but can not find solution.

`let activityViewController = UIActivityViewController(activityItems: sharingItems, applicationActivities: nil)

    if let avc = activityViewController.popoverPresentationController {
        avc.sourceView = sView
    }
    sender.present(activityViewController, animated: true, completion: nil)`

Image from iOS (1) Image from iOS

abdallahnh commented 4 years ago

@mEldewaik did you tried UIAlertController instead, I'm using it and it is fine.

mEldewaik commented 4 years ago

@abdallahnh i use UIAlertViewController to share text does UIAlertController do the same ?

abdallahnh commented 4 years ago

@mEldewaik yes sure it does

mEldewaik commented 4 years ago

@abdallahnh the code please 🙏

MoathOthman commented 4 years ago

@mEldewaik can you share a screenshot of what are you trying to localize. I guess you mean UIActivityViewController not UIAlertViewController as there is no such thing AFAIK!

mEldewaik commented 4 years ago

@MoathOthman yes i mean UIActivityViewController it can not be localized unless i close the app and open it again

MoathOthman commented 4 years ago

I don\t there is a straight way to achieve it since its part of uikit and , check https://medium.com/@dark_torch/working-with-localization-in-swift-part-2-e7c8a660eb2a on "Other Frameworks and bundles" section , at best you get to change the localization but not the layout.

mEldewaik commented 4 years ago

@MoathOthman i don't think it is the answer as it is already translated but its is not flipped and translated until i close and open the app again .

MoathOthman commented 4 years ago

@mEldewaik I don't think it is possible, but I will look into it soon.

mEldewaik commented 4 years ago

@MoathOthman so can i disable localization for UIActivityViewController and use only english in all cases ?

MoathOthman commented 4 years ago

no because you don't have access to the layout code and the localization is handled in another bundle.

if you can find the localization keys for the strings in the activityview , then there is a way. but i forgot tbh how to do that, if you managed to do that please let me know.

mEldewaik commented 4 years ago

@MoathOthman i saw before application support english and arabic and the UIActivityViewController only in english

MoathOthman commented 4 years ago

it would be interesting to be able to force certain language for certain strings, or even certain view controllers. am not aware of any currently, but will look into it.

abdallahnh commented 4 years ago

@mEldewaik i added some appearance changes please try from master and let me know if this fixed your issue

mEldewaik commented 4 years ago

@abdallahnh so how can i test it please can you advice ? how can i try your fix ?

mEldewaik commented 4 years ago

@abdallahnh i download the pod and implement button and make a share but the issue still exist i can not find solution :(