1
0
Fork 0
mirror of https://github.com/cheeaun/phanpy.git synced 2025-05-10 17:05:48 +03:00

Alrighty, let's test this post translation out!

This commit is contained in:
Lim Chee Aun 2023-03-07 22:38:06 +08:00
parent f4275d27fe
commit 355b3be6e9
16 changed files with 1530 additions and 14 deletions

View file

@ -0,0 +1,18 @@
// Fetch https://lingva.ml/api/v1/languages/{source|target}
import fs from 'fs';
fetch('https://lingva.ml/api/v1/languages/source')
.then((response) => response.json())
.then((json) => {
const file = './src/data/lingva-source-languages.json';
console.log(`Writing ${file}...`);
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
});
fetch('https://lingva.ml/api/v1/languages/target')
.then((response) => response.json())
.then((json) => {
const file = './src/data/lingva-target-languages.json';
console.log(`Writing ${file}...`);
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
});