@@ -4,13 +4,7 @@ import com.github.plushaze.traynotification.animations.Animations
4
4
import com.github.plushaze.traynotification.notification.NotificationTypeImplementations
5
5
import com.github.plushaze.traynotification.notification.TrayNotificationBuilder
6
6
import com.msc.serverbrowser.constants.PathConstants
7
- import com.msc.serverbrowser.data.properties.AutomaticUpdatesProperty
8
- import com.msc.serverbrowser.data.properties.ChangelogEnabledProperty
9
- import com.msc.serverbrowser.data.properties.ClientPropertiesController
10
- import com.msc.serverbrowser.data.properties.LanguageProperty
11
- import com.msc.serverbrowser.data.properties.MaximizedProperty
12
- import com.msc.serverbrowser.data.properties.ShowChangelogProperty
13
- import com.msc.serverbrowser.data.properties.UseDarkThemeProperty
7
+ import com.msc.serverbrowser.data.properties.*
14
8
import com.msc.serverbrowser.gui.UncaughtExceptionHandlerController
15
9
import com.msc.serverbrowser.gui.UncaughtExceptionHandlerView
16
10
import com.msc.serverbrowser.gui.View
@@ -39,9 +33,7 @@ import java.net.URISyntaxException
39
33
import java.nio.file.Files
40
34
import java.nio.file.Paths
41
35
import java.nio.file.StandardCopyOption
42
- import java.util.Locale
43
- import java.util.MissingResourceException
44
- import java.util.ResourceBundle
36
+ import java.util.*
45
37
46
38
/* *
47
39
* This is the main class of the client.
@@ -320,11 +312,7 @@ class Client : Application() {
320
312
}
321
313
322
314
val javaBin = System .getProperty(" java.home" ) + File .separator + " bin" + File .separator + " java"
323
- val command = ArrayList <String >()
324
-
325
- command.add(javaBin)
326
- command.add(" -jar" )
327
- command.add(PathConstants .OWN_JAR .path)
315
+ val command = listOf (javaBin, " -jar" , PathConstants .OWN_JAR .path)
328
316
329
317
try {
330
318
val builder = ProcessBuilder (command)
@@ -359,20 +347,22 @@ class Client : Application() {
359
347
360
348
/* *
361
349
* ResourceBundle which contains all the localized strings.
362
- *
363
- * Using `lateinit`, since a method is used to avoid code duplication.
364
350
*/
365
- lateinit var languageResourceBundle: ResourceBundle
351
+ var languageResourceBundle: ResourceBundle
366
352
367
353
init {
368
354
createFolderStructure()
369
- applyCurrentLanguage ()
355
+ languageResourceBundle = loadChosenResourceBundle ()
370
356
}
371
357
372
358
fun applyCurrentLanguage () {
359
+ languageResourceBundle = loadChosenResourceBundle()
360
+ }
361
+
362
+ private fun loadChosenResourceBundle (): ResourceBundle {
373
363
val locale = Locale (ClientPropertiesController .getProperty(LanguageProperty ))
374
364
Locale .setDefault(locale)
375
- languageResourceBundle = ResourceBundle .getBundle(" com.msc.serverbrowser.localization.Lang" , locale)
365
+ return ResourceBundle .getBundle(" com.msc.serverbrowser.localization.Lang" , locale)
376
366
}
377
367
378
368
/* *
0 commit comments