[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/fenix][tor-browser-82.0.0b4-10.0-1] 2 commits: Bug 40083: Make locale ordering in BuildConfig deterministic



Title: GitLab

Matthew Finkel pushed to branch tor-browser-82.0.0b4-10.0-1 at The Tor Project / Applications / fenix

Commits:

1 changed file:

Changes:

  • app/build.gradle
    ... ... @@ -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
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits