开发者

How to deal with multilingual web content?

Situation is simple. I'm starting to develop a website that should be localized based on visitor's origin IP address.

It's a PHP-MySQL stack. How do I go about the multilingual text content? I am thinking of having a language table in the database with the primary key as content identifier, another column for page identifier and separate columns for content in each language. Appropriate page content will be fetched as an array in the requested language a开发者_JS百科nd then displayed on the page.

Is this an efficient solution? I somewhat feel ridiculous to make database calls just for static content. I thought of having PHP definition files for each language and load the definitions during page load. But updating the definitions for each language are going to be like editing the files manually.

Has someone come out with an efficient solution for this kind of situation? Any input is much appreciated.


If the content is static like you say, why not use Gettext?

It's the standard regarding localization of content and has been discussed lots of times in StackOverflow.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜