Skip to content

Commit

Permalink
Merge pull request ckan#8432 from depositar/8424-datatables-chinese-l…
Browse files Browse the repository at this point in the history
…ocales

[ckan#8424] Fix Chinese locales in DataTables View
  • Loading branch information
amercader authored Sep 17, 2024
2 parents ffd2531 + dd6322a commit a7c3b18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/8432.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Load the right i18n files for Chinese locales in DataTables View.
5 changes: 5 additions & 0 deletions ckanext/datatablesview/assets/datatablesview.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ this.ckan.module('datatables_view', function (jQuery) {
// en is the default language, no need to load i18n file
if (languagefile === '/vendor/DataTables/i18n/en.json') {
activelanguage = ''
// load i18n files for zh_Hant_TW and zh_Hans_CN language
} else if (languagefile === '/vendor/DataTables/i18n/zh_Hant_TW.json') {
activelanguage = '/vendor/DataTables/i18n/zh_Hant.json'
} else if (languagefile === '/vendor/DataTables/i18n/zh_Hans_CN.json') {
activelanguage = '/vendor/DataTables/i18n/zh_CN.json'
}

// settings if gcurrentView === table
Expand Down

0 comments on commit a7c3b18

Please sign in to comment.