From ab10765eaf3efe467faa9270f3a5020b27d0f830 Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Wed, 17 Nov 2021 00:58:16 +0100 Subject: [PATCH] Add: Automatic languages detector script --- build.gradle | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/build.gradle b/build.gradle index ede96428..26d23947 100644 --- a/build.gradle +++ b/build.gradle @@ -155,3 +155,21 @@ dependencies { implementation 'androidx.room:room-ktx:2.3.0' kapt 'androidx.room:room-compiler:2.3.0' } + +// using a task as a preBuild dependency instead of a function that takes some time insures that it runs +task detectAndroidLocals { + Set langsList = new HashSet<>() + + // in /res are (almost) all languages that have a translated string is saved. this is safer and saves some time + fileTree("src/main/res").visit { FileVisitDetails details -> + if (details.file.path.endsWith("strings.xml") + && details.file.canonicalFile.getText('UTF-8').contains("