toto10's picture
Upload folder using huggingface_hub (#4)
ea35075
raw
history blame
773 Bytes
import fs from 'fs-extra'
import path from 'path'
const resource = {
de: {
Generate: 'Generieren',
},
en: {
Generate: 'Generate',
},
ja: {
Generate: 'η”Ÿζˆγ™γ‚‹',
},
sp: {
Generate: 'Generar',
},
'zh-CN': {
Generate: 'η”Ÿζˆ',
},
'zh-HK': {
Generate: 'η”Ÿζˆ',
},
'zh-TW': {
Generate: 'η”Ÿζˆ',
},
}
async function main() {
Object.entries(resource).forEach(([lng, content]) => {
const file = path.join('src/locales', `${lng}.json`)
const old = fs.readJSONSync(file)
const output = {
...old,
...content,
}
fs.writeJSONSync(file, output, {
spaces: 4,
})
})
}
main()