File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,17 @@ describe("i18n", () => {
8989 // then.
9090 expect ( i18n . language ) . toBe ( "zh_CN" ) ;
9191 } ) ;
92+
93+ it ( "should map to simplified Chinese without region" , async ( ) => {
94+ // given.
95+ jest . spyOn ( window . navigator , "language" , "get" ) . mockReturnValue ( "zh" ) ;
96+
97+ // when
98+ const i18n = ( await import ( "../i18n" ) ) . default ;
99+
100+ // then.
101+ expect ( i18n . language ) . toBe ( "zh_CN" ) ;
102+ } ) ;
92103 } ) ;
93104 } ) ;
94105
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export class Internationalization {
4848 }
4949
5050 // Chinese Simplified
51- if ( language === "zh-Hans" || language === "zh-CN" ) {
51+ if ( language === "zh" || language === "zh -Hans" || language === "zh-CN" ) {
5252 return "zh_CN" ;
5353 }
5454
You can’t perform that action at this time.
0 commit comments