MCPcopy Index your code
hub / github.com/codecombat/codecombat / possibleLocaleKeysFn

Function possibleLocaleKeysFn

webpack.base.config.js:22–42  ·  view source on GitHub ↗
(keys)

Source from the content-addressed store, hash-verified

20const locale = require('./app/locale/locale')
21const localeKeys = Object.keys(locale)
22const possibleLocaleKeysFn = (keys) => {
23 const current = [...keys]
24 keys.forEach((key) => {
25 if (key.includes('-')) {
26 const langs = {
27 'zh-HANS': 'zh-cn',
28 'zh-HANT': 'zh-tw'
29 }
30 if (langs[key]) {
31 current.push(langs[key])
32 }
33 const possible = key.split('-')
34 const temp = []
35 for (let i = 0; i < possible.length - 1; i++) {
36 temp.push(possible[i])
37 current.push(temp.join('-'))
38 }
39 }
40 })
41 return current
42}
43const possibleLocaleKeys = possibleLocaleKeysFn(localeKeys)
44
45console.log(`Starting Webpack for product ${product}`)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected