![]() |
XML noob
Okay, so I built a language pack using a PHP array, very simple, no hit to my speed, works really well. Then I read this: TalkPHP - The Framework Basics of Creating Multilingual PHP Applications
So I figured, even though I don't understand why using XML is that much better than the method I've already employed (no speed gains, anyways), I'd give it a go. I got it working fine, except for one small thing... two of my phrases include HTML, and that breaks the whole thing. Not the HTML itself, but apparently adding any kind of attribute to an HTML element seems to break it. Code:
<phrase id="admin_module_failed">The specified administrative module could not be loaded:<br /><span style=\"font-weight: normal;\">%s</span></phrase>-m |
try wrapping the elements test in a <![CDATA[ ]]> tag, because xml elements can have sub elements the parser will look inside your phrase element for '<' then interpret them as XML, CDATA tells the parser to ignore it.
XML CDATA |
Also, another way around it is to actually use the encoded format of hte html your trying to use.
Code:
<phrase id="admin_module_failed">The specified administrative module could not be loaded:<br /><span style=\"font-weight: normal;\">%s</span></phrase> |
That did the trick, thanks sketch.
-m |
| All times are GMT. The time now is 03:13 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0