WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#16023 closed defect (bug) (invalid)

get_locale() should correct a shortened WPLANG

Reported by: nacin Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:

Description

Some locales have distributed WPLANG in wp-config-sample with incorrect values. For example NL used nl for a WPLANG value from 3.0 to 3.0.2. They now use nl_NL, but the damage has been done for new installs during that time.

One, on the wp.org side, we should check for a full WPLANG, matching the expression [a-z][a-z]_[A-Z][A-Z] and reject the build if it fails.

Two, get_locale() should correct for a shorthand WPLANG. More or less, if it's two characters (xy or XY), then make it the form of xy_XY.

Thoughts?

Attachments (1)

16023.diff (558 bytes) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (7)

@nacin5 years ago

comment:1 @nacin5 years ago

  • Milestone changed from Awaiting Review to 3.1

3.1 consideration.

comment:2 @ryan5 years ago

Many locales in the wordpress-i18n repo use only two letters. It's fine when the language and country code are the same.

comment:3 @westi5 years ago

  • Keywords 3.2-early added
  • Milestone changed from 3.1 to Future Release

Lang codes are not always xx_YY.

3 letter codes exist.

This is not a regression - moving to 3.2

comment:4 @defries5 years ago

Not sure this would solve the issue for all i18n installs. Also, AFAIK this fix won't help people currently using nl in their wp-config to have their installs update to the brand new nl_NL 3.1 version when we make that available?

What will happen when the Belgians, who are talking about creating a nl_BE for their version of Dutch in the future?

comment:5 @nbachiyski5 years ago

Locales standards are strange and we don't always follow them. That's why trying to automatically fix locale names will fail in many of the cases.

If we want to fix the problem with Dutch we should just add a specific exception replacing nl with nl_NL. In addition to that we should show users a notification to ask them change the locale in their wp-config.php.

comment:6 @nacin4 years ago

  • Keywords has-patch 3.2-early removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.