Matthew Finkel pushed to branch tor-browser-82.0.0b4-10.0-1 at The Tor Project / Applications / fenix
Commits: 0c537f77 by Georg Koppen at 2020-10-13T07:43:35+00:00 Bug 40083: Make locale ordering in BuildConfig deterministic
- - - - - 4a7a5f7b by Matthew Finkel at 2020-10-13T14:02:44+00:00 Merge remote-tracking branch 'gkgl/bug_40083' into tor-browser-82.0.0b4-10.0-1
- - - - -
1 changed file:
- app/build.gradle
Changes:
===================================== app/build.gradle ===================================== @@ -585,16 +585,22 @@ task buildTranslationArray { // This isn't running as a task, instead the array is build when the gradle file is parsed. // https://github.com/mozilla-mobile/fenix/issues/14175 def foundLocales = new StringBuilder() + def languageCodes = [] foundLocales.append("new String[]{")
fileTree("src/main/res").visit { FileVisitDetails details -> if(details.file.path.endsWith("/strings.xml")){ def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-','').replaceAll('-r','-') languageCode = (languageCode == "values") ? "en-US" : languageCode - foundLocales.append(""").append(languageCode).append(""").append(",") + languageCodes.add(languageCode) } } - + // The order of files in a `FileTree` is not stable, even on a single + // computer. Thus we need to sort the `languageCode`s. See: fenix#40083. + languageCodes.sort() + languageCodes.each { + foundLocales.append(""").append(it).append(""").append(",") + } foundLocales.append("}") def foundLocalesString = foundLocales.toString().replaceAll(',}','}') android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
View it on GitLab: https://gitlab.torproject.org/tpo/applications/fenix/-/compare/1e797f9532bee...
tor-commits@lists.torproject.org