Petals icon indicating copy to clipboard operation
Petals copied to clipboard

Add language selection setting

Open AskoldMakaruk opened this issue 1 year ago • 1 comments

I found no way to change app language.

Describe the solution you'd like You already have a translation platform just add a drop down menu to settings page.

Describe alternatives you've considered Idk change system language? I don't want to go that far.

AskoldMakaruk avatar Aug 17 '24 22:08 AskoldMakaruk

Indeed. Currently the only way to change language is using the system.

Thanks for the suggestion!

LeoColman avatar Aug 17 '24 23:08 LeoColman

How do you envision this? We have a language map with key as code (en) and value as label (English) and when you support a new language you update this?

And when you change the language from app settings you set this locale and recreate the activity?.

If this sounds good you can assign this to me!

rubenquadros avatar Oct 02 '24 06:10 rubenquadros

Yes, @rubenquadros ! That's exactly what I was thinking. It's even what we are already doing here

https://github.com/LeoColman/Petals/blob/5ae0cecb486c1487695091e55f1ed3b6448c4dd3/app/src/androidTest/kotlin/br/com/colman/petals/ScreenshotTakerTest.kt#L59

I don't think there's a way to get all the locales available in an app, so a map with them is currently the way I go xD

LeoColman avatar Oct 02 '24 21:10 LeoColman

How are the current translations handled? I would want to add a label and description for the language setting.

rubenquadros avatar Oct 04 '24 13:10 rubenquadros

Translations are hosted on Weblate. https://hosted.weblate.org/engage/petals-app/

You can add your strings to values.xml and Weblate will take care of making it available for translations in other languages.

If you know any of them, feel free to also add to values-xx.xml of the given language

LeoColman avatar Oct 04 '24 15:10 LeoColman

I have created a PR! Check it out and let me know if it works!

rubenquadros avatar Oct 04 '24 15:10 rubenquadros