Opened 9 years ago
Closed 8 years ago
#1675 closed enhancement (fixed)
Provide more information when plugin is "not prepared properly for translation"
Reported by: | leewillis77 | Owned by: | ocean90 |
---|---|---|---|
Milestone: | Priority: | low | |
Component: | Translate Site & Plugins | Keywords: | |
Cc: |
Description
I'm receiving the following message against a couple of my plugins:
"This plugin is not properly prepared for localization. If you would like to translate this plugin, please contact the author."
Example: https://translate.wordpress.org/locale/en-gb/default/wp-plugins/cart-recovery
As far as I'm aware, this plugins *is* translatable. I've been through the linked article, but it's still not clear exactly why translate.wordpress.org is failing to pick things up.
I'm sure that the problem is ultimately mine - however there's currently no way of telling precisely what the issue is, making it difficult for plugin authors to "fix" things.
It would be nice if there was a way to determine the precise reasons that the plugin was being flagged as not properly prepared.
After a conversation on Slack with @ocean90 it appears that there is an additional FAQ here:
It would be great if either:
a) The information posted to slack was available on the plugin page on translate.wordpress.org
or
b) A link to that FAQ was in the error message
Change History (5)
This ticket was mentioned in Slack in #meta-i18n by leewillis77. View the logs.
9 years ago
#3
@
9 years ago
Hi Otto;
Yep - totally sure I'd done something wrong (and I'll get it fixed), but this ticket is still valid.
It's about exposing the detailed "You've got item X wrong" to plugin devs to make it easier to fix, rather than just the full list of things they need to check which isn't actually that helpful when you *think* you've done it right anyway ...
For reference, that plugin is not properly prepared for translation because:
a) It's using the wrong text domain.
https://plugins.svn.wordpress.org/cart-recovery/tags/1.7/cart-recovery-for-wordpress.php
This file has "Text Domain: crfw" in it, when the actual text-domain for this plugin is "cart-recovery".
Similarly, the function calls are using the wrong text-domains:
https://plugins.svn.wordpress.org/cart-recovery/tags/1.7/classes/CartTemplate.php
return _x( 'friend', 'Used as a first name if none is available.', 'crfw' );
The 'crfw' should be 'cart-recovery'.
b) Lots of the translation functions calls in the plugin are simply wholly missing the text-domains as well:
https://plugins.svn.wordpress.org/cart-recovery/tags/1.7/templates/admin-status-page.php
<?php _e( 'Pending' ); ?>
That should be:
<?php _e( 'Pending', 'cart-recovery' ); ?>
However, back to the original point: that line that you're referring to on translate.w.org points to this URL:
https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/
..which gives all this information about text-domains, how to use the translation functions properly, etc.