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:
parent
f4275d27fe
commit
355b3be6e9
16 changed files with 1530 additions and 14 deletions
scripts
18
scripts/fetch-lingva-languages.js
Normal file
18
scripts/fetch-lingva-languages.js
Normal 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');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue