chore(deps): update dependency nuxt to ^3.13.1 (#2946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
344ec56da0
commit
dd6fab86ee
13 changed files with 1489 additions and 1837 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Buffer } from 'node:buffer'
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { flatten, unflatten } from 'flat'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import fs from 'fs-extra'
|
||||
import { currentLocales } from '../config/i18n'
|
||||
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
@ -27,7 +27,7 @@ const sourceTranslations: Record<string, string> = {}
|
|||
|
||||
for (const file of sourceFiles) {
|
||||
const data = JSON.parse(Buffer.from(
|
||||
await fs.readFile(resolver.resolve(`../locales/${file as string}`), 'utf-8'),
|
||||
await readFile(resolver.resolve(`../locales/${file as string}`), 'utf-8'),
|
||||
).toString()) as Record<string, unknown>
|
||||
|
||||
merge(flatten(data), sourceTranslations)
|
||||
|
@ -41,7 +41,7 @@ async function removeOutdatedTranslations() {
|
|||
const path = resolver.resolve(`../locales/${file}`)
|
||||
|
||||
const data = JSON.parse(Buffer.from(
|
||||
await fs.readFile(path, 'utf-8'),
|
||||
await readFile(path, 'utf-8'),
|
||||
).toString())
|
||||
|
||||
const targetTranslations: Record<string, string> = flatten(data)
|
||||
|
@ -53,7 +53,7 @@ async function removeOutdatedTranslations() {
|
|||
|
||||
const unflattened = unflatten(targetTranslations)
|
||||
|
||||
await fs.writeFile(
|
||||
await writeFile(
|
||||
path,
|
||||
`${JSON.stringify(unflattened, null, 2)}\n`,
|
||||
{ encoding: 'utf-8' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue