Skip to content

Comments

Improve language data handling#1479

Merged
katydidnot merged 4 commits intomasterfrom
dhardy/T404882
Sep 23, 2025
Merged

Improve language data handling#1479
katydidnot merged 4 commits intomasterfrom
dhardy/T404882

Conversation

@DHardy-WMF
Copy link
Contributor

@DHardy-WMF DHardy-WMF commented Sep 19, 2025

Description

Rewrote the get_languages_from_locale_subdirectories function to handle both LANGUAGES and LANGUAGES_BIDI data, which keeps the rest of Django in sync better with the language-data.json file. Also updated the GitHub Action cron schedule to run monthly instead of daily.

Rationale

Further work and improvements to T404882. These changes replace the original solution with something simpler and more integrated with the Django web framework.

Phabricator Ticket

https://phabricator.wikimedia.org/T404882

How Has This Been Tested?

Locally

Screenshots of your changes (if appropriate):

Types of changes

What types of changes does your code introduce? Add an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Minor change (fix a typo, add a translation tag, add section to README, etc.)

This action will periodically download the latest version of
`language-data.json`, and replace the existing file in the repository.
If the file has been updated, it will create a pull request to recommend
merging the new changes.

Bug: T404882
We can leverage the existing Django variables and functions instead of
having to replace them all with custom ones in the models, views, and
controllers.
The GitHub Action doesn't need to run as periodically anymore since the
upstream `langugage-data.json` file doesn't seem to change that often.
@DHardy-WMF DHardy-WMF changed the title Dhardy/t404882 Improve language data handling Sep 19, 2025
Copy link
Contributor

@suecarmol suecarmol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pushed these changes to staging and reviewed the code, and everything seems to be working as expected. Thank you for your work on this!

@katydidnot katydidnot merged commit 6d4f4af into master Sep 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants