Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sysrqb/fenix
  • acat/fenix
  • gk/fenix
  • ahf/fenix
  • gaba/fenix
  • torrrrrrrrrrrrrrrr/fenix
  • boklm/fenix
  • aguestuser/fenix
  • ma1/fenix
  • morgan/fenix
  • dan/fenix
  • t-m-w/fenix
  • cypherpunks1/fenix
13 results
Show changes
......@@ -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
......