title: configuration generator in Scala
body: <p>Let say that I have a generic component implemented in Scala (like the one sugested from <a href="https://stackoverflow.com/questions/29531913/how-to-use-generics-in-scala">this post</a>):</p>
  
  <pre><code>import scala.collection.mutable.Map
  
  sealed trait Language {
    val messages: Map[String, String]
  }
  class English extends Language {
    val messages: Map[String, String] =
      Map("M01" -&gt; "Ready for cooking - press START",
        "M02" -&gt; "Close the door to start cooking")
  }
  class French extends Language {
    val messages: Map[String, String] =
      Map("M01" -&gt; "Pret pour la cuisson - presse START",
        "M02" -&gt; "Fermez la porte pour commencer la cuisson")
  }
  class Lang[A &lt;: Language] {
  
    private var language: Language = new English
  
    def chosen(lang: A): Unit = {
      language = lang
    }
  
    def displayMessage(msg: String): Unit = {
      println(language messages msg) 
    }
  
  }
  </code></pre>
  
  <p>My concern is how I can built a configuration generator (I am refering in the terminology of C++) to configure this component? At least any reference? Or another way, how I can use a configuration file for example to configure it?</p>