mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-28 20:53:12 -05:00
8293771f58
Migrate scripts/translation to esm GitOrigin-RevId: 475ec949f0ba238791df91de109169584e68c701
12 lines
348 B
JavaScript
12 lines
348 B
JavaScript
import { fileURLToPath } from 'url'
|
|
import fs from 'fs'
|
|
import Path from 'path'
|
|
|
|
const __dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
const LOCALES_FOLDER = Path.join(__dirname, '../../locales')
|
|
|
|
export function loadLocale(language) {
|
|
return JSON.parse(
|
|
fs.readFileSync(Path.join(LOCALES_FOLDER, `${language}.json`), 'utf-8')
|
|
)
|
|
}
|