Is there json data with language codes and names
d668 opened this issue · comments
d668 commented
I am building an HTML dropdown and I need pairs like
{"cmn":"Mandarin Chinese","spa":"Spanish","eng":"English"....}
Can't find it anywhere except readme.md
Thanks
d668 commented
hm, did a parser
var codes = new WebClient().DownloadString(
[codes-json.txt](https://github.com/wooorm/franc/files/3124655/codes-json.txt)
"https://raw.githubusercontent.com/wooorm/franc/master/packages/franc/readme.md").Split('\n')
.Where(x => x.StartsWith("| [`"))
.Select(x => new
{
code = x.Split('`')[1],
name = x.Split('|')[2].Trim()
});
var json = JsonConvert.SerializeObject(codes);
File.WriteAllText("codes.json ", json);
Attached a file if someone needs
d668 commented