diff --git a/src/main/kotlin/main/Main.kt b/src/main/kotlin/main/Main.kt index 495b26b..5d03c4f 100644 --- a/src/main/kotlin/main/Main.kt +++ b/src/main/kotlin/main/Main.kt @@ -663,13 +663,14 @@ fun chargerDonneesDepuisFichier(): List { } } +private val json = Json { prettyPrint = true } + fun sauvegarderDonneesDansFichier(listeMots: List) { try { - val content = Json.encodeToString(listeMots) + val content = json.encodeToString(listeMots) File("glossaire.json").writeText(content) } catch (e: IOException) { e.printStackTrace() - // Handle the exception as needed } }