@@ -406,10 +406,6 @@ module.exports = function(redis) {
406406 if ( ! lang ) return config . default_lang
407407 const l = String ( lang ) . toLowerCase ( )
408408 const map = {
409- 'zh-hans' : 'zh' ,
410- 'zh-tw' : 'zh' ,
411- 'zh-hk' : 'zh' ,
412- 'zh-mo' : 'zh' ,
413409 'zh-min-nan' : 'nan' ,
414410 'zh-yue' : 'yue' ,
415411 'zh-classical' : 'lzh'
@@ -418,13 +414,6 @@ module.exports = function(redis) {
418414 return l . split ( '-' ) [ 0 ]
419415 }
420416
421- // Helper to check if a language code is Simplified Chinese
422- this . isSimplifiedChinese = ( lang ) => {
423- if ( ! lang ) return false
424- const l = String ( lang ) . toLowerCase ( )
425- return l === 'zh-hans'
426- }
427-
428417 this . validLang = ( lang , return_langs = false ) => {
429418 // Comprehensive list of Wikimedia-supported language codes including variants.
430419 const valid_langs = [
@@ -439,10 +428,7 @@ module.exports = function(redis) {
439428 'pcd' , 'pdc' , 'pfl' , 'pi' , 'pih' , 'pl' , 'pms' , 'pnb' , 'pnt' , 'ps' , 'pt' , 'qu' , 'rm' , 'rmy' , 'rn' , 'ro' , 'roa-rup' , 'roa-tara' , 'ru' , 'rue' , 'rw' , 'sa' , 'sah' , 'sc' , 'scn' , 'sco' ,
440429 'sd' , 'se' , 'sg' , 'sh' , 'shn' , 'si' , 'simple' , 'sk' , 'skr' , 'sl' , 'sm' , 'smn' , 'sn' , 'so' , 'sq' , 'sr' , 'srn' , 'ss' , 'st' , 'stq' , 'su' , 'sv' , 'sw' , 'szl' , 'szy' , 'ta' , 'tcy' , 'te' ,
441430 'tet' , 'tg' , 'th' , 'ti' , 'tk' , 'tl' , 'tn' , 'to' , 'tpi' , 'tr' , 'ts' , 'tt' , 'tum' , 'tw' , 'ty' , 'tyv' , 'udm' , 'ug' , 'uk' , 'ur' , 'uz' , 've' , 'vec' , 'vep' , 'vi' , 'vls' , 'vo' , 'wa' ,
442- 'war' , 'wo' , 'wuu' , 'xal' , 'xh' , 'xmf' , 'yi' , 'yo' , 'za' , 'zea' , 'zh' , 'zh-classical' , 'zh-min-nan' , 'zh-yue' , 'zu' ,
443- // explicit Chinese variants for manual selection
444- 'zh-hans' , 'zh-tw' , 'zh-hk' , 'zh-mo'
445- ]
431+ 'war' , 'wo' , 'wuu' , 'xal' , 'xh' , 'xmf' , 'yi' , 'yo' , 'za' , 'zea' , 'zh' , 'zh-classical' , 'zh-min-nan' , 'zh-yue' , 'zu' , ]
446432
447433 if ( return_langs ) {
448434 return valid_langs
@@ -527,11 +513,7 @@ module.exports = function(redis) {
527513
528514 // special mapping for Chinese variants as requested
529515 const specialMap = {
530- 'zh-hans' : '简体中文' ,
531- 'zh' : '繁體中文' ,
532- 'zh-tw' : '繁體中文 台湾' ,
533- 'zh-hk' : '繁體中文 香港' ,
534- 'zh-mo' : '繁體中文 澳門' ,
516+ 'zh' : '中文' ,
535517 'zh-classical' : '文言文' ,
536518 'zh-min-nan' : '閩南語' ,
537519 'zh-yue' : '粵語'
0 commit comments