File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11import Mustache from 'mustache'
22import util from '../util'
3+ import cn from './cn'
4+ import da from './da'
35import de from './de'
46import en from './en'
5- import pt from './pt'
67import es from './es'
7- import da from './da'
8- import cn from './cn'
8+ import pt from './pt'
99const { genItems, pad, traverse } = util
1010
1111const locales = {
@@ -14,7 +14,8 @@ const locales = {
1414 pt,
1515 es,
1616 da,
17- cn
17+ zh_cn : cn ,
18+ zh : cn
1819}
1920
2021class Locale {
@@ -40,7 +41,8 @@ class Locale {
4041 * @returns {Locale } Dictionary with all strings in the requested language
4142 */
4243function getLocale ( locale , mixin ) {
43- const l = locales [ locale ] || locales . en
44+ const [ language ] = locale . split ( '-' )
45+ const l = locales [ locale ] || locales [ language ] || locales . en
4446 const dict = util . deepMerge ( l , mixin || { } )
4547 return new Locale ( dict )
4648}
You can’t perform that action at this time.
0 commit comments