You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When not using the translation management plugin (i.e. when the translations are loaded from the theme's languages directory, not WP's languages directory), theme translations fail to load correctly.
This is because of the way WordPress looks for translation files to load. If the source is a theme / child theme directory, it does not want a text domain prefix on the file name; if the source is WP's languages directory, it does want a text domain prefix on the file name.
This purely applies to .mo files, though (and possibly the new l10n.php files); for script translations (.json), it does want a text domain prefix on the file name always.
Unfortunately, because WP CLI generates the JSON files based on the PO file names, we can't rename the theme PO/MO files without breaking script translations.
To Reproduce
Steps to reproduce the behaviour:
install and activate the Query Monitor plugin, to make it easier to see which text domains are being loaded
view the frontend of a site
open Query Monitor to the Languages tab
look for the amnesty text domain
see that all searched-for files show Not Found
Expected behaviour
The site should be able to load the amnesty text domain from a found .mo file
Actual behaviour
The site cannot find an appropriate .mo file to load
Screenshots
Platform:
N/A
Additional context
The issue can be worked around by installing the Humanity Translation Management plugin, then saving the translations from its admin panel. This is because the plugin clones the translation files (.mo and .json) to WP's languages directory, in which every file is expected to be prefixed with the text domain.
The text was updated successfully, but these errors were encountered:
Describe the bug
When not using the translation management plugin (i.e. when the translations are loaded from the theme's languages directory, not WP's languages directory), theme translations fail to load correctly.
This is because of the way WordPress looks for translation files to load. If the source is a theme / child theme directory, it does not want a text domain prefix on the file name; if the source is WP's languages directory, it does want a text domain prefix on the file name.
This purely applies to
.mo
files, though (and possibly the newl10n.php
files); for script translations (.json
), it does want a text domain prefix on the file name always.Unfortunately, because WP CLI generates the JSON files based on the PO file names, we can't rename the theme PO/MO files without breaking script translations.
To Reproduce
Steps to reproduce the behaviour:
Languages
tabamnesty
text domainNot Found
Expected behaviour
The site should be able to load the
amnesty
text domain from a found.mo
fileActual behaviour
The site cannot find an appropriate
.mo
file to loadScreenshots
Platform:
N/A
Additional context
The issue can be worked around by installing the Humanity Translation Management plugin, then saving the translations from its admin panel. This is because the plugin clones the translation files (
.mo
and.json
) to WP's languages directory, in which every file is expected to be prefixed with the text domain.The text was updated successfully, but these errors were encountered: