RemafoX icon indicating copy to clipboard operation
RemafoX copied to clipboard

[Feat] Use app-provided Locale

Open Sherlouk opened this issue 3 years ago • 5 comments
trafficstars

Problem Statement

Some applications (my app 😛 ) provides the user the option to choose which language it wants the app in, as opposed to relying solely on the system setting. Currently, ReMafoX's generated enum file uses static variables and system APIs which means only the device language is supported.

Suggested Solution

It may be possible to (optionally, using a new value in the ReMafoX config) add a function to the generated enum. This function would take a Locale override which would take priority over the device setting.

Additional Considerations

Sherlouk avatar Oct 15 '22 11:10 Sherlouk

Thank you for requesting this feature!

I'm open to implement a solution for this, so please make sure to leave an upvote so I can prioritize this feature accordingly.

Having that said: Have you considered pointing the user to the new system setting available since iOS 15, I believe, where the user can change the language of an app in the Settings app on an app-level? I know that this is not exactly the same as changing it right within the app, but it's not too far off either. Just asking in case you weren't aware of this new feature.

Jeehut avatar Oct 15 '22 14:10 Jeehut

Having that said: Have you considered pointing the user to the new system setting available since iOS 15, I believe, where the user can change the language of an app in the Settings app on an app-level? I know that this is not exactly the same as changing it right within the app, but it's not too far off either. Just asking in case you weren't aware of this new feature.

I'm aware of the Per-App settings for accessibility options, such as dynamic text size. I wasn't aware that you could change locale per app? Where is this preference?

Sherlouk avatar Oct 15 '22 14:10 Sherlouk

@Sherlouk Just open the Settings app, scroll down to your app's entry and select "Language".

Jeehut avatar Oct 15 '22 14:10 Jeehut

Today I learned! Thanks for sharing Cihat.

That lowers the priority for this feature for me. Still a nice to have (as I do prefer to have the option within the app) but not as critical.

Sherlouk avatar Oct 15 '22 14:10 Sherlouk

@Sherlouk Glad I could help!

By the way, to show the settings of your app programmatically from within your app, you can call:

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)

See also the related Apple documentation.

Jeehut avatar Oct 15 '22 14:10 Jeehut