scala-iso-language is a minimalistic library compatible with Scala, Scala.js and Scala Native. It simplifies the representation of ISO 639 languages using Enumeratum and provides translations of language names into various languages.
To get started with SBT add the following to your build.sbt file:
libraryDependencies += "com.karadzhov" %% "scala-iso-language-core" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-ar" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-bg" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-cs" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-de" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-en" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-es" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-fr" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-hi" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-it" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-pl" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-pt" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-ru" % "0.5.0"
libraryDependencies += "com.karadzhov" %% "scala-iso-language-i18n-zh" % "0.5.0"
import com.karadzhov.iso.language.Language
import com.karadzhov.iso.language.i18n.LanguageNameDE
Language.values
// Vector(Language.Abkhazian, Language.Afar, Language.Afrikaans...)
Language.Chinese.entryName
// "zh"
Language.withNameOption("zh")
// Some(Language.Chinese)
Language.withNameOption("ac")
// None
object GermanLanguagePack extends LanguageNameDE
GermanLanguagePack.languageName(Language.Samoan)
// "Samoanisch"