Open tgely opened 5 years ago
Is not better to add a new field in language db and call the locale
setlocale(LC_ALL, explode(',', $this->getLocale()));
and a function :
public function getLocale()
{
$code = $this->getCode();
return $this->get('locale', $code);
}
Thanks @oitsuki :+1: To use locale field in language table is a good idea! I will do it later but not have to declare a new language class function for it.
setlocale(LC_ALL, explode(';', $OSCOM_Language->get('locale'));
Setlocale can not fixable on windows enviroment so I had to do another things. :disappointed:
Its an UTF-8 issue.
In windows enviroment on some wrong PHP versions required a date name template exchange function fixer and I have to add fix into DateTime::toLong() function too.
Here is the checkpoint:
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && strpos(setlocale(LC_TIME, 0), 'UTF-8') === false) {
// do stuff here
}
Look Oscommerce V3 for that.
https://github.com/osCommerce/oscommerce2/blob/de0e97d15d43ac6a9a6cfb2847134a82a0148f2b/catalog/includes/OSC/Sites/Shop/Shop.php#L88
For ages I have idiot character problems on hungarian languages in development enviroment because we live on windows... (New Product for July and so on)
The conflict was when LC_ALL redefined then disabled LC_TIME in windows enviroment.
Solution for windows developers:
Add
into main language collection and I have inserted the code you see above after reported lines.
At this moment I have issue on PHP5.6 version only, but this could be more seriously problem for others.