UNPKG

365 BJavaScriptView Raw
1const getLocalesConfig = require('./get-locales-config')
2
3let result
4
5/**
6 * 获取 i18n 语种列表
7 * @returns {Array}
8 */
9module.exports = (() => {
10 if (!Array.isArray(result)) {
11 result = getLocalesConfig()
12 result = result.map(l => l[0])
13
14 if (!result.length)
15 result = ['']
16 }
17
18 return result
19})()