Page MenuHomePhabricator

operations/software/bitu shows zh-hans "文档" instead of zh-hant "文件" with Accept-Language zh-Hant-TW
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

It shows zh-hans "文档".

What should have happened instead?:

It should show zh-hant "文件".

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Browser: Firefox Android 126.0

Event Timeline

SLyngshede-WMF claimed this task.
SLyngshede-WMF triaged this task as Medium priority.
SLyngshede-WMF subscribed.

This is a translation automatically provided by the framework used by Bitu.

I suspect that issues is related to the language mappings here: https://github.com/django/django/blob/main/.tx/config#L3 where zh-Hant-TW should be added to the zh_TW mapping.

My suggestion is to get the translation fixed within the Django project, that way it will be correct on all Django powered sites in the future.

That's weird, as it should already been handled here:

# If 'zh-hant-tw' is not supported, try special fallback or subsequent
# language codes i.e. 'zh-hant' and 'zh'.

https://github.com/django/django/blob/main/django%2Futils%2Ftranslation%2Ftrans_real.py#L506

Also, .tx/config is only used for Transifex configuration, it's not used elsewhere.

That's weird, as it should already been handled here:

# If 'zh-hant-tw' is not supported, try special fallback or subsequent
# language codes i.e. 'zh-hant' and 'zh'.

https://github.com/django/django/blob/main/django%2Futils%2Ftranslation%2Ftrans_real.py#L506

This code was added in Django 4, but Bitu runs the 3.2 LTS series of Django as shipped in Debian Bookworm.

Looks like Django 3.2 (LTS) has been ended active support 1 month and 3 weeks ago (April 1, 2024) and ended security support 2 years and 5 months ago (December 7, 2021)?

Looks like Django 3.2 (LTS) has been ended active support 1 month and 3 weeks ago (April 1, 2024) and ended security support 2 years and 5 months ago (December 7, 2021)?

That's true, but we're using the Django version shipped in Debian Bookworm, which will backport security updates until 2028.