JsonSource

A TranslationSource that uses a JSON file to store and retrieve translations.

Author

TOTHTOMI

Since

Jul. 23, 2023

Parameters

path

the path of the JSON file

Constructors

Link copied to clipboard
constructor(path: Path)

Initialize the json object from the file or create a new one if the file does not exist

Functions

Link copied to clipboard
open override fun getRawString(key: String, defaultValue: String?): String?

Gets the raw string value for the given key from the JSON object. If the key does not exist, it writes the default value to the JSON object and returns it.