-
-
Save propensive/ab862f2e77d3ba2bd39a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Scala version 2.10.5 (OpenJDK 64-Bit Server VM, Java 1.6.0_27). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import rapture.i18n._ | |
import rapture.i18n._ | |
scala> type IString = I18n[String, En with Fr with De with Pl with La] // English, French, German, Polish, Latin | |
defined type alias IString | |
scala> val msg: IString = en"Hello, world!" | |
<console>:11: error: Some language translations were not provided: fr, la, de, pl | |
val msg: IString = en"Hello, world!" | |
^ | |
scala> import rapture.translate._ | |
import rapture.translate._ | |
scala> val msg: IString = en"Hello, world!" | |
<console>:14: error: Not all required language translations have been provided. Consider appending the following translations to the expression: | |
| fr"Bonjour le monde!" | la"Salve, mundi!" | de"Hallo Welt!" | pl"Witaj świecie!" | |
val msg: IString = en"Hello, world!" | |
^ | |
scala> val msg: IString = en"Hello, world!" | fr"Bonjour le monde!" | la"Salve, mundi!" | de"Hallo Welt!" | pl"Witaj świecie!" | |
msg: IString = fr|la|de|en|pl:Hello, world! | |
scala> msg[De] | |
res0: String = Hallo Welt! | |
scala> msg[La] | |
res1: String = Salve, mundi! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment