Faithlife / AndroidLint

Android Lint checks to enforce Faithlife house rules
MIT License
2 stars 2 forks source link

Detect missing schemes for url resources #20

Open jzbrooks opened 1 year ago

jzbrooks commented 1 year ago

If a string resource has a single variant that begins with common url schemes (http:, https:, mailto:, tel:, sms:, etc), every version of the string resource should begin with that prefix.

This has caused an issue where a string was updated in crowdin without a scheme for a specific locale which caused action view intents to not resolve, so the app would crash.

jzbrooks commented 1 year ago

Context - https://faithlife.slack.com/archives/C03R57MAPM2/p1675106094275229

jzbrooks commented 1 year ago

https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/TranslationDetector.kt

This might be a good starting point for this check since the translation detector also has to inspect every resource variant.