mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 09:53:39 -05:00
13 lines
348 B
JavaScript
13 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')
|
||
|
)
|
||
|
}
|