3.8.4-patch1

Fixed regexes broken for Android by #2538
This commit is contained in:
Yair Morgenstern
2020-04-30 15:57:08 +03:00
parent ba2e6d26e5
commit cc206494df
2 changed files with 12 additions and 10 deletions

View File

@ -33,8 +33,8 @@ allprojects {
version = '1.0.1' version = '1.0.1'
ext { ext {
appName = "Unciv" appName = "Unciv"
appCodeNumber = 421 appCodeNumber = 422
appVersion = "3.8.4" appVersion = "3.8.4-patch1"
gdxVersion = '1.9.10' gdxVersion = '1.9.10'
roboVMVersion = '2.3.1' roboVMVersion = '2.3.1'

View File

@ -143,17 +143,19 @@ class Translations : LinkedHashMap<String, TranslationEntry>(){
} }
// we don't need to allocate different memory for these every time we .tr() - or recompile them. // We don't need to allocate different memory for these every time we .tr() - or recompile them.
// Please note: The extra \] and \} are NOT removable, despite what Android Studio might recommend -
// they are necessary for Android Java 6 phones to parse the regex properly!
// Expect a literal [ followed by a captured () group and a literal ]. // Expect a literal [ followed by a captured () group and a literal ].
// The group may contain any number of any character except ] - pattern [^]] // The group may contain any number of any character except ] - pattern [^]]
val squareBraceRegex = Regex("""\[([^]]*)]""") val squareBraceRegex = Regex("""\[([^]]*)\]""")
// Just look for either [ or ] // Just look for either [ or ]
val eitherSquareBraceRegex = Regex("""\[|]""") val eitherSquareBraceRegex = Regex("""\[|\]""")
// Analogous as above: Expect a {} pair with any chars but } in between and capture that // Analogous as above: Expect a {} pair with any chars but } in between and capture that
val curlyBraceRegex = Regex("""\{([^}]*)}""") val curlyBraceRegex = Regex("""\{([^}]*)\}""")
fun String.tr(): String { fun String.tr(): String {