Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

strftime and multi language support


Guest

Recommended Posts

Posted

Hello,

 

This is my first message here, I hope this is the right place.

 

Well, I've a problem with my recently installed OsCommerce, that's some dates are showed in english but I've the front end installed in spanish and everything else works fine.

 

For example, in the new products box it shows this as title:

 

"Nuevos Productos En November"

 

While "November" doesn't exist in Spanish, it should be "Noviembre" instead.

 

Well, I've take a look at the code and I've found this on new_products.php:

 

$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 

The matter is that strftime function behaviour is controlled by the locale of the server, so it seems that there's not possible to have a site in the same server with different languages with this design.

 

I've seen that strftime is used in lot of include files, so the problem with date translation -if it exists- is not only on new_products.php.

 

I think -may be I'm wrong- the only way to solve this is using a custom function instead of strftime that uses the language of customer's navigator instead of locale of shop's host.

 

But before break my shop's code I'd like to see some feedback on this issue.

 

Thanks a million in advance (and BTW excuse my english).

Posted

I answer to myself. I've this line on my espanol.php file:

 

setlocale(LC_TIME, 'es_ES.ISO_8859-1');

 

So as locale is changed for each languaje, the problem that I've told before doesn't exist.

 

The solution to the problem was simply change es_ES.ISO_8859-1 by es_ES.utf8.

 

I hope I didn't lost your time too much...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...