package eu.midnightdust.yaytris;

import eu.midnightdust.yaytris.util.NightJson;

import java.util.HashMap;
import java.util.Map;

public class Translation {
    public static Map<String, String> jsonMap = new HashMap<>();

    public static void load(String locale) {
        NightJson json = new NightJson(Translation.class, String.format("translation/%s.json5", locale));
        json.readJson();
    }

    public static String t(String key, Object... args) {
        return String.format(jsonMap.getOrDefault(key, key), args);
    }
}
