File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,7 +226,14 @@ export type SourceLanguageCode = CommonLanguageCode | 'en' | 'pt';
226226 * Note: although the language code type definitions are case-sensitive, this package and the DeepL
227227 * API accept case-insensitive language codes.
228228 */
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' ;
230237
231238/**
232239 * 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(
167167 throw new DeepLError (
168168 "targetLang='pt' is deprecated, please use 'pt-PT' or 'pt-BR' instead." ,
169169 ) ;
170+ } else if ( targetLang === 'zh' ) {
171+ throw new DeepLError (
172+ "targetLang='zh' is deprecated, please use 'zh-HANS' or 'zh-HANT' instead." ,
173+ ) ;
170174 }
171175
172176 const searchParams = new URLSearchParams ( {
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ const internalExampleText: Record<string, string> = {
4545 tr : 'proton ışını' ,
4646 uk : 'протонний пучок' ,
4747 zh : '质子束' ,
48+ 'zh-HANS' : '质子束' ,
49+ 'zh-HANT' : '質子束' ,
4850} ;
4951
5052export const usingMockServer = process . env . DEEPL_MOCK_SERVER_PORT !== undefined ;
You can’t perform that action at this time.
0 commit comments