Opened 9 months ago
Last modified 7 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.phpis 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.phpandwp-config-sample.phpand 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.phpfile already exists. This is always shown in English rather than the installed site language (from theWPLANGoption).- To reproduce, visit
wp-admin/setup-config.phpduring 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
@
9 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.phpwp-config-sample.php, I don't even get to the language chooser. I immediately get redirected tosetup-config.phpwith "Sorry, I need awp-config-sample.phpfile 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.phpfile isn't actually loaded, sowp-settings.php(which was loaded earlier by itself) andwpdbdon'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.