Re: Multilingual website, texts in external JavaScript problem

From: Date: Mon, 09 Nov 2009 11:54:51 +0000
Subject: Re: Multilingual website, texts in external JavaScript problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-299732@lists.php.net to get a copy of this message
leledumbo wrote: > I need to create a multilingual website and my framework already gives me > that facility. However, I also use JavaScript quite extensively and since > XHTML 1.0 Strict doesn't allow inline script, I must use external .js file. > The problem is in these scripts, there are strings that needs to be > translated as well. How can I make PHP parse these scripts as well? Or are > there alternative approaches? > I don't see why you can't use inline script in XHTML 1.0 Strict: just put the script in CDATA sections, like <script type="text/javascript"> /*<![CDATA[*/ // Inline javascript here /*]]>*/ </script> That seems to validate fine in XHTML 1.0 Strict for me... -- Peter Ford phone: 01580 893333 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent

« previous php.general (#299732) next »