- πΊπΈUnited States smustgrave
Have not seen any errors during import of translations? Wonder if this is still an issue in D10?
- πΊπΈUnited States calebtr
I ran into this on a Drupal 10.3 site. From what I see in the 11.x code, it is still an issue.
For me, the specific issue is that in
locale.bulk.inc
, exceptions caught inlocale_translate_batch_import()
log only generic messages.To replicate:
1. Create a .po file with an error it. I have attached an example.
2. Create a site with the language for the .po file enabled.
3. Attempt to import the .po file at /admin/config/regional/translate/import.
4. See the error, "One translation file could not be imported. See the log for details."
5. See log, no details are included.
What I expect to happen:
Specific error messages are logged. In this case, "The plural formula could not be parsed."
Next steps
The patch in this issue wouldn't apply; it calls watchdog() instead of \Drupal::logger().
I don't see any other places in locale.bulk.inc where a specific error message isn't logged, but I may have missed something and there may be other places in the module.
A simple way to address this is to assign the Exception to a variable and include
$e->getMessage()
in the log. - Merge request !10037#1757340 - log specific error messages when importing translations throws exceptions β (Open) created by calebtr
- πΊπΈUnited States calebtr
I'm happy to do more work on this at the maintainers' direction.
- πΊπΈUnited States smustgrave
Have not reviewed yet but issue summary appears to be incomplete, recommend using standard template for that. May need test coverage as well.
- πΊπΈUnited States calebtr
I erred on the side of contributing to an existing issue. Would you rather I open a new one?