Skip to content

Rename Ukrainian locale from 'ua' to 'uk'#986

Closed
uttam12331 wants to merge 1 commit into
python-pendulum:masterfrom
uttam12331:rename-ukrainian-locale-uk-955
Closed

Rename Ukrainian locale from 'ua' to 'uk'#986
uttam12331 wants to merge 1 commit into
python-pendulum:masterfrom
uttam12331:rename-ukrainian-locale-uk-955

Conversation

@uttam12331

Copy link
Copy Markdown

Closes #955

The Ukrainian locale added in #793 was registered under ua, which is the ISO 3166 country code. The correct ISO 639-1 language code for Ukrainian is uk — which is also the code CLDR uses (the source the locale data is generated from; there is no ua locale in CLDR).

This renames src/pendulum/locales/ua/src/pendulum/locales/uk/ and updates the locale's internal import.

Verified:

>>> import pendulum
>>> pendulum.datetime(2026, 3, 15).format("dddd DD MMMM YYYY", locale="uk")
'неділя 15 березня 2026'
>>> pendulum.datetime(2026, 3, 15).format("dddd", locale="ua")   # now correctly rejected
ValueError

Note on backwards compatibility: set_locale("ua") / locale="ua" will no longer resolve, since ua was never a valid language code. As ua was only introduced in 3.2.0 I've done a straight rename, but if you'd prefer to keep ua as a temporary alias for one release I'm happy to add that — just say the word.

Changelog updated.

The Ukrainian locale added in python-pendulum#793 used 'ua', which is the ISO 3166 country
code. The correct ISO 639-1 language code for Ukrainian is 'uk' (as used by
CLDR, from which the locale data is generated). Rename the locale directory
and fix its internal import accordingly.

Closes python-pendulum#955
@Secrus

Secrus commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Duplicate #957

@Secrus Secrus closed this Jul 16, 2026
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.

Ukrainian locale should be uk not ua

2 participants