MOLH icon indicating copy to clipboard operation
MOLH copied to clipboard

Language of UIActivityViewController Does not change when Reset

Open mEldewaik opened this issue 5 years ago • 16 comments

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

mEldewaik avatar Jan 29 '20 10:01 mEldewaik

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

abdallahnh avatar Jan 29 '20 10:01 abdallahnh

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

mEldewaik avatar Jan 29 '20 10:01 mEldewaik

@mEldewaik yes sure it does

abdallahnh avatar Jan 29 '20 10:01 abdallahnh

@abdallahnh the code please 🙏

mEldewaik avatar Jan 29 '20 10:01 mEldewaik

@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!

MoathOthman avatar Jan 29 '20 10:01 MoathOthman

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

mEldewaik avatar Jan 29 '20 10:01 mEldewaik

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.

MoathOthman avatar Jan 29 '20 10:01 MoathOthman

@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 .

mEldewaik avatar Jan 29 '20 11:01 mEldewaik

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

MoathOthman avatar Jan 29 '20 12:01 MoathOthman

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

mEldewaik avatar Jan 29 '20 12:01 mEldewaik

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.

MoathOthman avatar Jan 29 '20 12:01 MoathOthman

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

mEldewaik avatar Jan 29 '20 12:01 mEldewaik

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.

MoathOthman avatar Jan 29 '20 12:01 MoathOthman

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

abdallahnh avatar Jan 30 '20 14:01 abdallahnh

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

mEldewaik avatar Jan 30 '20 15:01 mEldewaik

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

mEldewaik avatar Feb 03 '20 11:02 mEldewaik