Msg#: 4435161 posted 9:49 am on Mar 30, 2012 (gmt 0)
In a project of my company there is a website available in 6 languages. The site sends some emails to customers/members. Every phrase/word is stored in database and all work well in the website. Our main problem appears in emails.
In each email there are daily reports. We use set_locale() to define each language and "show" the day names (months also) to the proper selected language. This works ok.
In some cases there are more than one emails to be send (in 2 different languages) - here we have problem. Every info in email appears correct - texts/translations from database. Day names (and month also) appear only in the first language in both emails. So, if the first email was in german and the second in french, the french email will have everything in french except the day names that will be in german (even though that we execute set_locale again before sending the second email)
so the actual sciprt will look something like:
setlocale(LC_ALL, $german); // send german email
setlocale(LC_ALL, $french); // send french email
Each language locale look like: "fr_FR.UTF8"
Why is that? Is this some set_locale bad behavior? How can we prevent/fix this? Thank you for any insight/tips
edit: server runs apache 2 and php4 if you need this info
Msg#: 4435161 posted 12:59 pm on Mar 30, 2012 (gmt 0)
yes, at first i checked if i get the proper language. It works ok The system is linux. The problem appears only on day names and month names - i use the set_locale() only for those 2. All other text is stored in database Further investigation shows the problem to be appear between english-german, english-french, german-french, english-italian, english-russian - still checking a couple more languages It is not a problem between english-greek!