Recently, an add-on I'm working on got added to the translation center, and it's awesome.
But I noticed that the lang files generated through the translation center go through the htmlentities function before being saved.
It's actually causing problem with some popup, when your langage uses accented chars (For exemple : french.). For instance, the popup that shows up when you uninstall a module :
English text was
Code: Select all
Authorized IP list will be destroyed. Are you sure you wan\'t to uninstall IPLock ?
Code: Select all
La liste des IP autorisée sera détruite. Êtes-vous sur de vouloir désinstaller IPLock ?
Code: Select all
La liste des IP autorisée sera détruite. Êtes-vous sur de vouloir désinstaller IPLock ?
That htmlentities, or looks like it.
In the module.php file, i wrote :
Code: Select all
function UninstallPreMessage() {
return $this->Lang ( 'preuninstall' );
}
When I uninstall the module, instead of reading
,La liste des IP autorisée sera détruite. Êtes-vous sur de vouloir désinstaller IPLock ?
I read
Huuugh. Looks like javascript popup don't do well with htmlentities. Crap.La liste des IP autorisée sera détruite. Êtes-vous sur de vouloir désinstaller IPLock ?
The solution I found, that isn't entirely satisfactory, is to write in the module.php file :
Code: Select all
function UninstallPreMessage() {
return html_entity_decode($this->Lang ( 'preuninstall' ),ENT_NOQUOTES, 'UTF-8');
}
--
Redwarp