Skip to content
Open
15 changes: 15 additions & 0 deletions .changelog/20260721132553_ck_10480.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-translations
see:
- https://github.com/ckeditor/ckeditor5-commercial/issues/10480
---

The `zh_CN` and `zh_TW` locale codes have been replaced with `zh_Hans` and `zh_Hant`, respectively, to correctly represent Simplified and Traditional Chinese as script variants instead of country/region variants.

As a result:

* The `zh_TW` language code is no longer mapped to the `zh.po` file. It now emits `zh-hant.po` instead.
* The `zh_CN` language code now emits `zh-hans.po` instead of `zh-cn.po`.
* The `languageCode` for these locales changed from `zh` (for both) to `zh-Hans` and `zh-Hant`, respectively.
15 changes: 9 additions & 6 deletions packages/ckeditor5-dev-translations/lib/utils/getlanguages.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const SUPPORTED_LOCALES = [
'bs', // Bosnian
'bg', // Bulgarian
'ca', // Catalan
'zh_CN', // Chinese (China)
'zh_TW', // Chinese (Taiwan)
'zh_Hans', // Chinese (Simplified)
'zh_Hant', // Chinese (Traditional)
'hr', // Croatian
'cs', // Czech
'da', // Danish
Expand Down Expand Up @@ -78,20 +78,23 @@ const SUPPORTED_LOCALES = [
'uz', // Uzbek
'vi' // Vietnamese
];

const LOCALES_FILENAME_MAP = {
'ne_NP': 'ne',
'si_LK': 'si',
'sr@latin': 'sr-latn',
'zh_TW': 'zh'
'sr@latin': 'sr-latn'
};

const LOCALES_LANGUAGE_CODE_MAP = {
'zh_Hans': 'zh-Hans',
'zh_Hant': 'zh-Hant'
};

/**
* @returns {Array.<Language>}
*/
export default function getLanguages() {
return SUPPORTED_LOCALES.map( localeCode => {
const languageCode = localeCode.split( /[-_@]/ )[ 0 ];
const languageCode = LOCALES_LANGUAGE_CODE_MAP[ localeCode ] || localeCode.split( /[-_@]/ )[ 0 ];
const languageFileName = LOCALES_FILENAME_MAP[ localeCode ] || localeCode.toLowerCase().replace( /[^a-z0-9]+/, '-' );

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe( 'getLanguages()', () => {
expect( languageChineseTaiwan ).toEqual( {
localeCode: 'zh_TW',
languageCode: 'zh',
languageFileName: 'zh'
languageFileName: 'zh-tw'
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
} );
} );
} );