File tree Expand file tree Collapse file tree
cloud-function/src/internal/locale-utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,34 @@ describe("getLocale", () => {
7272 ) ;
7373 } ) ;
7474
75+ it ( "resolves zh-Hant to zh-TW" , ( ) => {
76+ strictEqual (
77+ getLocale ( makeRequest ( { acceptLanguage : "zh-Hant" } ) , { } ) ,
78+ "zh-TW"
79+ ) ;
80+ } ) ;
81+
82+ it ( "resolves zh-Hant-TW to zh-TW" , ( ) => {
83+ strictEqual (
84+ getLocale ( makeRequest ( { acceptLanguage : "zh-Hant-TW" } ) , { } ) ,
85+ "zh-TW"
86+ ) ;
87+ } ) ;
88+
89+ it ( "resolves zh-Hans to zh-CN" , ( ) => {
90+ strictEqual (
91+ getLocale ( makeRequest ( { acceptLanguage : "zh-Hans" } ) , { } ) ,
92+ "zh-CN"
93+ ) ;
94+ } ) ;
95+
96+ it ( "resolves zh-Hans-CN to zh-CN" , ( ) => {
97+ strictEqual (
98+ getLocale ( makeRequest ( { acceptLanguage : "zh-Hans-CN" } ) , { } ) ,
99+ "zh-CN"
100+ ) ;
101+ } ) ;
102+
75103 it ( "respects quality values to pick zh-TW over zh-CN" , ( ) => {
76104 strictEqual (
77105 getLocale (
You can’t perform that action at this time.
0 commit comments