mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-02 18:49:41 +08:00
🔨 Refactor(custom): remove unused file
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
import yaml from 'yaml'
|
||||
const languageFileName = 'zh-CN.yml'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
|
||||
const i18nFolder = join(__dirname, '../resources/i18n')
|
||||
const typeFolder = join(__dirname, '../src/universal/types')
|
||||
const languageFile = join(i18nFolder, languageFileName)
|
||||
|
||||
const langFile = readFileSync(languageFile, 'utf8')
|
||||
|
||||
const obj = yaml.parseDocument(langFile).toJSON()
|
||||
|
||||
const keys = Object.keys(obj)
|
||||
|
||||
const types = `export interface ILocales {
|
||||
${keys.map(key => `${key}: string`).join('\n ')}
|
||||
}
|
||||
export type ILocalesKey = keyof ILocales
|
||||
`
|
||||
|
||||
writeFileSync(join(typeFolder, 'i18n.ts'), types)
|
||||
Reference in New Issue
Block a user