Opened 3 years ago
Closed 8 days ago
#7376 closed defect (bug) (fixed)
Plugin translation file missing plugin description if it is found in JS also
| Reported by: | swissspidy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Translate Site & Plugins | Keywords: | |
| Cc: |
Description
Originally reported at https://github.com/swissspidy/preferred-languages/issues/883
The Preferred Languages plugin contains the string "Choose languages for displaying WordPress in, in order of preference." in 3 places:
readme.txt- The description in the main plugin file header
- A JS file
The translation platform splits plugin translation files into MO and JSON files depending on the occurrence of the source string.
Since the plugin description doesn't have a source file reference but only a comment, the translation platform doesn't recognize that it needs to keep it in the MO file. So what happens is that the string is missing from there and the plugin description is not translated.
I see a couple of ways to solve this:
- In
wp i18n make-potadd a source file reference for plugin/theme metadata - Or, here on dotorog, try to improve the file splitting so that these strings are always included in the MO file as well.
Change History (3)
#3
@
8 days ago
- Resolution → fixed
- Status new → closed
This was fixed upstream in wp-cli/i18n-command (https://github.com/wp-cli/i18n-command/pull/377), which adds a file reference to plugin and theme header strings. Imported header strings now reference the main plugin file, for example #: preferred-languages.php in Preferred Languages’ current language packs. The language pack builder therefore keeps them in the PO/MO even when they also appear in JavaScript. Please reopen if a newly imported plugin version is still missing its translated description.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Here's a GitHub issue for (1): https://github.com/wp-cli/i18n-command/issues/376