Please make it easier to translate your plugin
-
In a couple of places you’ve got this:
$filtered_comments = sprintf( esc_html( _n( 'Showing %1$d of %2$d review (%3$d star). ', 'Showing %1$d of %2$d reviews (%3$d star). ', $all, IVOLE_TEXT_DOMAIN ) ), $this->count_ratings( $product_id, $rating ), $all, $rating );
The problem here is that_n()
lets the translator adjust the string translation depending on a number for only ONE dimension, whereas you’ve included TWO or THREE dimensions, that all ought to be handled by_n()
.
In Slavic languages, for instance, you’ll use three different word forms:
1, 21, 31, 41… use “singular”.
2, 3, 4, 22, 23, 24… use “dual”,
5-20, 25-30, 35-40… use “plural”.
Here, you’ve arbitrarily chosen to let $all steer the choice of string.
But “1 star” vs “2 stars” is different already in English.You should also add a
// Translators:
comment on the line before in order to clarify which variable steers the selection.Also: Text-domain should be the static string “customer-reviews-woocommerce” and not a variable.
—————-
Also: please don’t take for granted that you always can “glue” parts of a sentence together in the same way as in English.
Here’s one example (there are several similar cases in your code):
'desc' => __( 'Enable manual sending of follow-up emails with a reminder to submit a review. Manual reminders can be sent for completed orders from <a href="' . admin_url( 'edit.php?post_type=shop_order' ) . '">Orders</a> page after enabling this option.', IVOLE_TEXT_DOMAIN ),
Use printf() instead of the concatenation operator.
In this case, a much better string to translate would have been:
Enable manual sending of follow-up emails with a reminder to submit a review. Manual reminders can be sent for completed orders from %1$sOrders%2$s page after enabling this option.
- The topic ‘Please make it easier to translate your plugin’ is closed to new replies.