Opened 10 years ago
Last modified 3 months ago
#30049 assigned defect (bug)
wp_load_translations_early does not work without WPLANG defined
Reported by: | szepe.viktor | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | I18N | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
In the Hungarian WP 4.0 the maintenance text appears in english.
Attachments (1)
Change History (28)
#2
@
10 years ago
And installed with the English package but then choosing Hungarian during install, rather than using the Hungarian package.
This ticket was mentioned in Slack in #polyglots by ocean90. View the logs.
9 years ago
#7
follow-up:
↓ 9
@
9 years ago
I've 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.
This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.
8 years ago
#9
in reply to:
↑ 7
;
follow-up:
↓ 10
@
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
@
8 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.
#12
@
7 years ago
- Milestone set to Awaiting Review
- Resolution wontfix deleted
- Status changed from closed to reopened
Reopening to look into comment:10.
#13
@
6 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
#15
@
5 months ago
- Keywords needs-patch needs-unit-tests added
Using the heder for this could be interesting. If moved to a separate function, the logic can be testable.
#17
@
4 months ago
- Summary changed from wp_load_translations_early does not without WPLANG defined to wp_load_translations_early does not work without WPLANG defined
This ticket was mentioned in PR #6623 on WordPress/wordpress-develop by @swissspidy.
4 months ago
#18
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
To-do:
- Decide what to do with values such as
de
. I think treating those asde_DE
makes for the best experience, even though it's not super accurate.
Trac ticket: https://core.trac.wordpress.org/ticket/30049
This ticket was mentioned in PR #6842 on WordPress/wordpress-develop by @ramon fincken.
3 months ago
#20
#21
@
3 months ago
I have read ISO documentation and simplified and somewhat improved the regex a bit ( which was pretty good to be honest ).
Also I allowed for commandline WP-CLI / PHP where this header is not even present ( PHP Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" )
#22
@
3 months ago
@ramon-fincken Mind providing any suggestions on the existing PR instead? It is more sophisticated and includes tests already.
@swissspidy commented on PR #6842:
3 months ago
#24
There is already great progress over at #6623 with more edge cases covered and proper tests. I suggest focusing on that PR instead.
#25
@
3 months ago
No, I mean focusing our effort on the existing PR at https://github.com/WordPress/wordpress-develop/pull/6623 which is nearly complete.
This is once WordPress is installed, yes?