Using translation center : hardcoded htmlentities
Posted: Wed May 12, 2010 3:02 pm
Well, this topic belongs here and in the translation section I guess.
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
I translated it in french through the translation center, and it became
But, in the generated file, it became
Okay.
That htmlentities, or looks like it.
In the module.php file, i wrote :
(Where preuninstall links to the text I wrote before)
When I uninstall the module, instead of reading
I read
The solution I found, that isn't entirely satisfactory, is to write in the module.php file :
Well, if anyone as a better solution, let me know ! If not, well... I thought it be worth sharing.
--
Redwarp
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