Create global resource bundle

This commit is contained in:
Marvin Elsen 2024-09-21 13:47:25 +02:00
parent 47d53d4df8
commit ac182c10c0
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2

View File

@ -29,6 +29,7 @@ class WillowApplication : Application() {
private const val FONT_SIZE = 12.0 private const val FONT_SIZE = 12.0
private const val JDBC_CONNECTION_STRING = "jdbc:sqlite:dictionary.db" private const val JDBC_CONNECTION_STRING = "jdbc:sqlite:dictionary.db"
val resourceBundle: ResourceBundle = ResourceBundle.getBundle("i18n/willow", Locale.US)
} }
override fun init() { override fun init() {
@ -45,7 +46,7 @@ class WillowApplication : Application() {
val model = Model(searchService, findWordsService) val model = Model(searchService, findWordsService)
val fxmlLoader = FXMLLoader() val fxmlLoader = FXMLLoader()
fxmlLoader.resources = ResourceBundle.getBundle("i18n/willow", Locale.US) fxmlLoader.resources = resourceBundle
fxmlLoader.controllerFactory = Callback { type -> fxmlLoader.controllerFactory = Callback { type ->
when (type) { when (type) {
MainController::class.java -> MainController(model) MainController::class.java -> MainController(model)