Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changelog/20260721132553_ck_10480.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-translations
see:
- https://github.com/ckeditor/ckeditor5-commercial/issues/10480
---

The `languageCode` returned for the `zh_CN` and `zh_TW` locales is no longer the ambiguous `zh` for both. It is now `zh-Hans` for `zh_CN` (Simplified Chinese) and `zh-Hant` for `zh_TW` (Traditional Chinese).

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`.
4 changes: 2 additions & 2 deletions packages/ckeditor5-dev-translations/lib/utils/getlanguages.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ const SUPPORTED_LOCALES = [
'uz', // Uzbek
'vi' // Vietnamese
];

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

/**
Expand Down
19 changes: 15 additions & 4 deletions packages/ckeditor5-dev-translations/tests/utils/getlanguages.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,25 @@ describe( 'getLanguages()', () => {
} );
} );

it( 'should use predefined filename if defined', () => {
it( 'should return Chinese (Simplified) language', () => {
const languages = getLanguages();
const languageChineseTaiwan = languages.find( l => l.localeCode === 'zh_TW' );
const languageChineseSimplified = languages.find( l => l.localeCode === 'zh_CN' );

expect( languageChineseTaiwan ).toEqual( {
expect( languageChineseSimplified ).toEqual( {
localeCode: 'zh_CN',
languageCode: 'zh',
languageFileName: 'zh-hans'
Comment thread
cursor[bot] marked this conversation as resolved.
} );
} );

it( 'should return Chinese (Traditional) language', () => {
const languages = getLanguages();
const languageChineseTraditional = languages.find( l => l.localeCode === 'zh_TW' );

expect( languageChineseTraditional ).toEqual( {
localeCode: 'zh_TW',
languageCode: 'zh',
languageFileName: 'zh'
languageFileName: 'zh-hant'
} );
} );
} );