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
-
4a7a5f7b
by Matthew Finkel at 2020-10-13T14:02:44+00:00
1 changed file:
Changes:
... | ... | @@ -585,16 +585,22 @@ task buildTranslationArray { |
585 | 585 |
// This isn't running as a task, instead the array is build when the gradle file is parsed.
|
586 | 586 |
// https://github.com/mozilla-mobile/fenix/issues/14175
|
587 | 587 |
def foundLocales = new StringBuilder()
|
588 |
+ def languageCodes = []
|
|
588 | 589 |
foundLocales.append("new String[]{")
|
589 | 590 |
|
590 | 591 |
fileTree("src/main/res").visit { FileVisitDetails details ->
|
591 | 592 |
if(details.file.path.endsWith("/strings.xml")){
|
592 | 593 |
def languageCode = details.file.parent.tokenize('/').last().replaceAll('values-','').replaceAll('-r','-')
|
593 | 594 |
languageCode = (languageCode == "values") ? "en-US" : languageCode
|
594 |
- foundLocales.append("\"").append(languageCode).append("\"").append(",")
|
|
595 |
+ languageCodes.add(languageCode)
|
|
595 | 596 |
}
|
596 | 597 |
}
|
597 |
- |
|
598 |
+ // The order of files in a `FileTree` is not stable, even on a single
|
|
599 |
+ // computer. Thus we need to sort the `languageCode`s. See: fenix#40083.
|
|
600 |
+ languageCodes.sort()
|
|
601 |
+ languageCodes.each {
|
|
602 |
+ foundLocales.append("\"").append(it).append("\"").append(",")
|
|
603 |
+ }
|
|
598 | 604 |
foundLocales.append("}")
|
599 | 605 |
def foundLocalesString = foundLocales.toString().replaceAll(',}','}')
|
600 | 606 |
android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
|