File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,14 @@ export type SourceLanguageCode = CommonLanguageCode | 'en' | 'pt';
226
226
* Note: although the language code type definitions are case-sensitive, this package and the DeepL
227
227
* API accept case-insensitive language codes.
228
228
*/
229
- export type TargetLanguageCode = CommonLanguageCode | 'en-GB' | 'en-US' | 'pt-BR' | 'pt-PT' ;
229
+ export type TargetLanguageCode =
230
+ | CommonLanguageCode
231
+ | 'en-GB'
232
+ | 'en-US'
233
+ | 'pt-BR'
234
+ | 'pt-PT'
235
+ | 'zh-HANS'
236
+ | 'zh-HANT' ;
230
237
231
238
/**
232
239
* All language codes, including source-only and target-only language codes.
Original file line number Diff line number Diff line change @@ -167,6 +167,10 @@ export function buildURLSearchParams(
167
167
throw new DeepLError (
168
168
"targetLang='pt' is deprecated, please use 'pt-PT' or 'pt-BR' instead." ,
169
169
) ;
170
+ } else if ( targetLang === 'zh' ) {
171
+ throw new DeepLError (
172
+ "targetLang='zh' is deprecated, please use 'zh-HANS' or 'zh-HANT' instead." ,
173
+ ) ;
170
174
}
171
175
172
176
const searchParams = new URLSearchParams ( {
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ const internalExampleText: Record<string, string> = {
45
45
tr : 'proton ışını' ,
46
46
uk : 'протонний пучок' ,
47
47
zh : '质子束' ,
48
+ 'zh-HANS' : '质子束' ,
49
+ 'zh-HANT' : '質子束' ,
48
50
} ;
49
51
50
52
export const usingMockServer = process . env . DEEPL_MOCK_SERVER_PORT !== undefined ;
You can’t perform that action at this time.
0 commit comments