开发者

Localization of HTML documents?

开发者 https://www.devze.com 2022-12-10 06:02 出处:网络
XML documents can be localized by referring to an external DTD document that contains the translations. For example in Mozilla XULRunner it looks like this:

XML documents can be localized by referring to an external DTD document that contains the translations. For example in Mozilla XULRunner it looks like this:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://configpanel/locale/configpanel.dtd">
<window title="&CONFIG_PA开发者_开发百科NEL;">
  <label value="&WELCOME_TEXT;"/>
</window>

I've tried it in a HTML document but it didn't seem to work. Is this supposed to work for HTML documents? Or is there a similar mechanism that can be used here?


This isn't supposed to work in HTML. I suggest you just do the localisation on the server-side.


I'm going to go right ahead and say that that isn't really a good way of localizing XML, and it probably won't work for HTML in most browsers.

The canonical way of localizing XML documents is using the xml:lang attribute.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号