mirror of https://github.com/sbt/sbt.git
String upper/lower case no longer locale dependent
Fixed many instances of the Turkish i bug. Spare a thought for the poor Turks!
This commit is contained in:
parent
8883ab324b
commit
a3a3dc1226
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
import java.util.Locale
|
||||
|
||||
object Util
|
||||
{
|
||||
def makeList[T](size: Int, value: T): List[T] = List.fill(size)(value)
|
||||
|
|
@ -31,13 +33,13 @@ object Util
|
|||
def hypenToCamel(s: String): String = hyphenToCamel(s)
|
||||
def hyphenToCamel(s: String): String =
|
||||
if(hasHyphen(s))
|
||||
Hypen.replaceAllIn(s, _.group(1).toUpperCase)
|
||||
Hypen.replaceAllIn(s, _.group(1).toUpperCase(Locale.ENGLISH))
|
||||
else
|
||||
s
|
||||
|
||||
private[this] lazy val Camel = """(\p{javaLowerCase})(\p{javaUpperCase})""".r
|
||||
def camelToHypen(s: String): String =
|
||||
Camel.replaceAllIn(s, m => m.group(1) + "-" + m.group(2).toLowerCase)
|
||||
Camel.replaceAllIn(s, m => m.group(1) + "-" + m.group(2).toLowerCase(Locale.ENGLISH))
|
||||
|
||||
def quoteIfKeyword(s: String): String = if(ScalaKeywords.values(s)) '`' + s + '`' else s
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
import java.io.{BufferedWriter, PrintStream, PrintWriter}
|
||||
import java.io.{BufferedWriter, PrintStream, PrintWriter}
|
||||
import java.util.Locale
|
||||
|
||||
object ConsoleLogger
|
||||
{
|
||||
|
|
@ -99,7 +100,7 @@ object ConsoleLogger
|
|||
val noSuppressedMessage = (_: SuppressedTraceContext) => None
|
||||
|
||||
private[this] def os = System.getProperty("os.name")
|
||||
private[this] def isWindows = os.toLowerCase.indexOf("windows") >= 0
|
||||
private[this] def isWindows = os.toLowerCase(Locale.ENGLISH).indexOf("windows") >= 0
|
||||
|
||||
def apply(out: PrintStream): ConsoleLogger = apply(ConsoleOut.printStreamOut(out))
|
||||
def apply(out: PrintWriter): ConsoleLogger = apply(ConsoleOut.printWriterOut(out))
|
||||
|
|
|
|||
Loading…
Reference in New Issue