Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#30049 reopened defect (bug)

wp_load_translations_early does not without WPLANG defined

Reported by: szepeviktor's profile szepe.viktor Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.0
Component: I18N Keywords:
Focuses: Cc:

Description

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

Attachments (1)

30049.diff (556 bytes) - added by soulseekah 5 years ago.
HTTP_ACCEPT_LANGUAGE

Download all attachments as: .zip

Change History (15)

#1 @nacin
9 years ago

This is once WordPress is installed, yes?

#2 @nacin
9 years ago

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

#3 @szepe.viktor
9 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.


9 years ago

#6 @kidsguide
9 years ago

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

#7 follow-up: @temuag
9 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 9 years ago by temuag (previous) (diff)

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


8 years ago

#9 in reply to: ↑ 7 ; follow-up: @ocean90
8 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
7 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
6 years ago

#41823 was marked as a duplicate.

#12 @SergeyBiryukov
6 years ago

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

Reopening to look into comment:10.

@soulseekah
5 years ago

HTTP_ACCEPT_LANGUAGE

#13 @soulseekah
5 years 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.


5 years ago

Note: See TracTickets for help on using tickets.