Skip to content

Commit

Permalink
Fix language preference: Properly show all languages (PR #1453 by @gs…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Oct 2, 2021
1 parent b5513b0 commit 7ff1f13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ static String findUsedAndroidLocales() {
Set<String> langs = new HashSet<>()
new File('.').eachFileRecurse(groovy.io.FileType.DIRECTORIES) {
final foldername = it.name
if (foldername.startsWith('values-') && !it.canonicalPath.contains("build" + File.separator + "intermediates") && !it.canonicalPath.contains("gradle" + File.separator + "daemon")) {
if (foldername.contains('values-') && !it.absolutePath.contains("build" + File.separator + "intermediates") && !foldername.matches(".*values-((.*[0-9])|(land)|(port)).*")) {
new File(it.toString()).eachFileRecurse(groovy.io.FileType.FILES) {
if (it.name.toLowerCase().endsWith(".xml") && it.getCanonicalFile().getText('UTF-8').contains("<string")) {
if (it.exists() && it.name.toLowerCase().endsWith(".xml") && it.getText('UTF-8').contains("<string")) {
langs.add(foldername.replace("values-", ""))
}
}
}
}
langs = langs.sort()
return '{' + langs.collect { "\"${it}\"" }.join(",") + '}'
}

Expand Down

0 comments on commit 7ff1f13

Please sign in to comment.