I use french language for my app, no problem to set phpmaker to use french language (new french.xml file), it’s working fine.
Translate the 4 html files from \template\html, OK too but i have a little problem :
When receiving activation email, for exemple (Template : register.html), the account informations are given in the correct charset but the html part of the template is sent to the wrong charset.
Here is my register.html Template :
/--------------------------------------------------------------------------------------------------/
Subject: Informations d’inscription
From:
To:
Cc:
Bcc:
Format: HTML
Cher utilisateur,
Merci pour votre inscription. Voici vos informations:
Veuillez cliquer sur le lien suivant pour activer votre compte:
Activate account
Yes, my project uses the UTF-8 charset and I thought my templates were too.
Since it still didn’t work, I analyzed the Email class and found some very interesting things there.
1- public function load ($ fn, $ langId = “”).
I noticed that the function searches for the following three bytes at the start of the file: EF BB BF. I have seen on the web that files encoded in UTF-8 begin with these three bytes. so I opened my template with a hex editor and saw that these three bytes were not there.
in fact, my text editor was set to ANSI by default. After having configured it in UTF-8, I saved my template which, this time works correctly.
2- Still in this function, I noted something very interesting about the templates:
I saw somewhere on the board that to have emails in the chosen language, you had to replace the original templates with translated versions.
My research on this function allowed me to discover that it was enough to add a suffix to the name of the template once translated.
For example: I work with English and French. In the Template\html directory I kept the four original files (changepwd.html, notify.html, register.html and resetpwd.html). I then made a copy of these files which I translated into French and saved (in UTF-8 format) under the following names:
changepwd_fr.html
notify_fr.html
registe_fr.html
resetpwd_fr.html
(it also works with template names like register-fr.html)
In this way, emails will be sent automatically in the correct language, depending on the language chosen in the menu \ tools \ languages ​​of phpmaker.
If no language choosen in menu \Tools\Languages or bad language ID, English is used as long as the default templates (ex: register.html) are kept.