It seems we always have "Order @id (@count products)"
- products (what if I sale 1 product?)

Perhaps if you're going to release a new version you could take a look at the current code:

  $desc = t('Order @id (@count products)',
    array('@id' => $order->order_id, '@count' => $order->product_count));

So i can read php but building it the drupal way... i would make a simple if statement but i guess that is not the right way.
Perhaps you have a better idee?

Comments

janton’s picture

i did not test this code yet.. but i think something like this is what i should do.. but i'm not really a good coder :-)

  if ($order->product_count == 1){
  	$products = 'product';
	} 
	else {
	$products = 'products';
	}
  
  $desc = t('Order @id (@count @products)',
    array('@id' => $order->order_id, '@count' => $order->product_count, '@products' => $products));
janton’s picture

BUT then the issue for translations stays!
So this would be better:

  if ($order->product_count == 1){
    $desc = t('Order @id (@count product)',
    array('@id' => $order->order_id, '@count' => $order->product_count));
	} 
  else {
  $desc = t('Order @id (@count products)',
  array('@id' => $order->order_id, '@count' => $order->product_count));
	}
  
praseodym’s picture

Status: Active » Needs work

Drupal has format_plural for this purpose :)

praseodym’s picture

Also, to fix this the pot and po files need to be updated which is a bit of a hassle.

janton’s picture

OK sorry I don't quite follow you... should I use format_plural or should "we" use this in the module?

praseodym’s picture

Status: Needs work » Closed (won't fix)

Feel free to reopen with a patch.

praseodym’s picture

Issue summary: View changes

wrong copy