开发者

Useful ways for multilanguage navigation and static content on your site?

I have a big site running under Apache and PHP and in few mounths I should consider to add some diff开发者_开发知识库erent language version of it, but I'm not sure about the right way (or ways).

My problem it isn't the user data, because I can use db tables with different languages (en, de, it, etc.) so I want concentrate my answer on navigation and static content.

For now I can't use gettext because I don't have a dedicated server and I can't reboot it every time I want, but surely will be a future choice.

So my main problems are these:

In the site, I have classical XHTML elements like the menus, lists, div and various static texts in various pages (should be perferct for gettext, but I need a alternative)

The other part of the sites has XHTML elements which are dynamically created via AJAX and jQuery, and here I haven't any idea of what can I do...

So does exists some example I can see in some link to solve it (or some useful tecnique)?

Note:

• The user should be able to change language

• I'd like to avoid multiple divs for different languages in one page, this will be stole me too much bandwith I need, because it could be highly trafficated


This is explicitly provided for in the XML/XHTML and CSS specs: you want to read up on the lang attribute.

<!-- in english -->
<div lang="en">This is written in English.</div>
<!-- in french, excuse poor french please -->
<div lang="fr">Ceci c'est ecrit en francais.</div>
<!-- in dutch -->
<div lang="nl">Dit is geschreven in het Nederlands.</div>

There's special syntax for CSS to apply styles depending on the lang attribute, too.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜