Opened 4 months ago
Last modified 2 months ago
#63009 new defect (bug)
setup-config errors are not localised
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | needs-patch |
Focuses: | Cc: |
Description (last modified by )
There are two error messages shown in setup-config.php that are not localised.
- If
wp-config-sample.php
is missing during the initial installation, the error message stating this is always shown in English rather than the language chosen in the first step of installation (from$_REQUEST['language']
).- To reproduce, delete or rename both
wp-config.php
andwp-config-sample.php
and then attempt tp proceed through the installation steps.
- To reproduce, delete or rename both
- Manually visiting wp-admin/setup-config.php during normal site operation will show an error message stating that the
wp-config.php
file already exists. This is always shown in English rather than the installed site language (from theWPLANG
option).- To reproduce, visit
wp-admin/setup-config.php
during normal site operation.
- To reproduce, visit
Affected error messages: https://github.com/WordPress/wordpress-develop/blob/fc96319aa770050d22cfdc1bbab437154017bcf7/src/wp-admin/setup-config.php#L43-L82
Change History (6)
#3
@
4 months ago
Looks like I got confused while testing this. The wp-config-sample.php
error message is correctly localised when you attempt to install a localised package, for example the de_DE
package from https://de.wordpress.org/latest-de_DE.zip:
Die Datei wp-config-sample.php ist erforderlich. Bitte lade diese erneut zu deiner WordPress-Installation hoch.
There doesn't appear to be a way to reach this error message in the standard package, unless you manually delete wp-config-sample.php
after you've selected a language.
So it looks like the only actual issue is the second one, whereby visiting wp-admin/setup-config.php during normal site operation always shows the message in English.
For (1):
When I rename/delete both
wp-config.php
wp-config-sample.php
, I don't even get to the language chooser. I immediately get redirected tosetup-config.php
with "Sorry, I need awp-config-sample.php
file to work from.". In this case no language information is available of course and this will always be in English.Can you perhaps clarify this part?
For (2):
The main issue here seems to be that the found
wp-config.php
file isn't actually loaded, sowp-settings.php
(which was loaded earlier by itself) andwpdb
don't know the actual table prefix, so the locale information can't be loaded from the database.To change the behavior here, I think the file would need to be refactored quite a bit so that if a config file already exists, it is actually loaded. Then the locale information is known and the translation could be loaded.