Proper Chinese translation for Select2 library strings

Created on 27 May 2021, over 3 years ago
Updated 5 May 2023, over 1 year ago

Problem/Motivation

The issue is what Drupal core calls "zh-hans", select2 library calls "zh-CN". So Select2's own messages remain English for Chinese user interface language.

Steps to reproduce

Configure a multilingual site, Select2 UI elements get translated into French, Spanish, etc, but not to Chinese.

Proposed resolution

Patch the underlying library to satisfy the missing language code.

A composer.json snippet inside patches

            "npm-asset/select2": {
              "Harmonize locale names with Drupal core": "patches/select2-zh-hans.patch"
            }

and a patch for the library solves this inconsistency. Symlinking zh-CN.js file is not enough, it contains a language code ID. That's why Drupal-level string and replace won't work either.

Remaining tasks

Figure out how to make it maintainable on the long run.

User interface changes

Not applicable.

API changes

Not applicable.

Data model changes

Not applicable.

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

User interface

Created by

πŸ‡­πŸ‡ΊHungary aron novak Hungary, Budapest

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024