/* Copying and distribution of this file, with or without modification,
 * are permitted in any medium without royalty provided the copyright
 * notice and this notice are preserved.  This file is offered as-is,
 * without any warranty.
 */

import std.stdio;
import std.json;

import amalthea.langlocal;

void main() {
    string txt = `[{"en_US": "One", "eo": "Unu"},{"en_US": "Two", "eo": "Du"}]`;
    JSONValue json = parseJSON(txt);
    initLocalizationWithJSON(json);

    writeln("English:");
    chooseLanguage("en_US");
    writeln("> ", "One"._s);
    writeln("> ", "Two"._s);

    writeln;

    writeln("Esperanto:");
    chooseLanguage("eo");
    writeln("> ", "One"._s);  // Unu
    writeln("> ", "Two"._s);  // Du
}
