CatimaLoyalty / Android

Catima, a Loyalty Card & Ticket Manager for Android
https://catima.app
GNU General Public License v3.0
885 stars 151 forks source link

Write CI to protect app_name #2118

Open TheLastProject opened 1 month ago

TheLastProject commented 1 month ago

app_name shouldn't be translated in most languages and should be kept consistent with title.txt.

Write a small shell script or something for GitHub Actions to ensure they're consistent and to block it from being anything except "Catima" except in a list of languages explicitly on an allowlist.

DNotNice commented 1 month ago

Hi @TheLastProject , I would like to work on this issue. A basic script for GA would be perfect. Please assign me the issue if no one else is working on it. Thanks!

TheLastProject commented 1 month ago

Sure, go for it :)

It might be good to look at or possibly extend https://github.com/CatimaLoyalty/Android/blob/main/.scripts/generate_feature_graphic/generate_feature_graphic.sh as that file already reads title.txt, so you're halfway there in comparing it with app_name in the values directories. But take whatever direction you think works best :)

TheLastProject commented 1 month ago

(Actually, that script doesn't run on MRs so it's not sufficient for checking. But parts could maybe be re-used, who knows :))

DNotNice commented 1 month ago

Hi @TheLastProject , I am reading values from title.txt and comparing it with app_name. I just want to confirm if the languages on the allowlist are the ones listed in locale_values inside settings.xml, or if they are mentioned somewhere else.

TheLastProject commented 1 month ago

There's no real allowlist yet as I don't quite know in which languages it is normal to translate the name of the app/trademark, there are just too many languages out there :)

I think to keep it simple let's just say every language that already translated the app name is allowed, so any new ones will fail the CI (and I'll reach out to those translators to make sure or revert until sure) :)