WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 6 months ago

#30049 reopened defect (bug)

wp_load_translations_early does not without WPLANG defined

Reported by: szepe.viktor Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.0
Component: I18N Keywords:
Focuses: Cc:
PR Number:

Description

In the Hungarian WP 4.0 the maintenance text appears in english.

Attachments (1)

30049.diff (556 bytes) - added by soulseekah 15 months ago.
HTTP_ACCEPT_LANGUAGE

Download all attachments as: .zip

Change History (15)

#1 @nacin
5 years ago

This is once WordPress is installed, yes?

#2 @nacin
5 years ago

And installed with the English package but then choosing Hungarian during install, rather than using the Hungarian package.

#3 @szepe.viktor
5 years ago

Yes, the Hungarian packages has $wp_local_package = 'hu_HU';

This ticket was mentioned in Slack in #polyglots by ocean90. View the logs.


4 years ago

#6 @kidsguide
4 years ago

This is a problem with all the language packages not just Hungarian.

#7 follow-up: @temuag
4 years ago

I may have found the solution, see:
https://wordpress.org/support/topic/translation-of-the-maintenance-mode?replies=19

You need to make sure $wp_local_package = 'YOUR LOCAL'; is defined at the end of wp-includes/version.php

The error may come from an upgrade, I had the same issue, and I could fix it this way.

Last edited 4 years ago by temuag (previous) (diff)

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


3 years ago

#9 in reply to: ↑ 7 ; follow-up: @ocean90
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to temuag:

You need to make sure $wp_local_package = 'YOUR LOCAL'; is defined at the end of wp-includes/version.php

This global variable is defined when you download a localized package from a local site like hu.wordpress.org.

Sadly, there is nothing we can do. We can't access the locale option because wp_maintenance() is loaded before a database connection can be initialized. wp_load_translations_early() is also used for database errors so we can't access the database here too.

Closing as a wontfix, but feel free to reopen if you have a patch ready.

#10 in reply to: ↑ 9 @ocean90
3 years ago

Replying to ocean90:

Sadly, there is nothing we can do.

Maybe $_SERVER['HTTP_ACCEPT_LANGUAGE'] could be an alternative source for setting the locale.

#11 @SergeyBiryukov
2 years ago

#41823 was marked as a duplicate.

#12 @SergeyBiryukov
2 years ago

  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Reopening to look into comment:10.

@soulseekah
15 months ago

HTTP_ACCEPT_LANGUAGE

#13 @soulseekah
15 months ago

Attached a simple HTTP_ACCEPT_LANGUAGE-based locale detection.

Regular expression based on a locale list from here https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes#3191729

This is in no way a substitute for the deprecated WPLANG constant. We need to find a way to set the language for those notices without using WPLANG now.

This ticket was mentioned in Slack in #core by ocean90. View the logs.


6 months ago

Note: See TracTickets for help on using tickets.