A-A+

Multilingual & Multi Domain Corporate Sites in WordPress

2009年07月31日 WordPress 暂无评论 阅读 1 次

One of the things we're doing more and more of recently is building multilingual, multi domain corporate sites in WordPress. Doing that used to be a fair amount of work, but we've been able to make it a lot simpler lately.

We start the process with a simple WordPress MU install, to which we then add the Multi Site Manager plugin, to be able to run multiple domains off of it. Now this is all pretty simple and straight forward. Now we used to have to build a theme in several languages, but we've recently developed some new stuff that makes that simpler.

Localized templates

One of the things I've done for the StudioPress themes is localize them, which is actually not even that much work if you read the how to for it that John Godley wrote. On top of doing that, we add some other code that I've written, which allows you to pick the language for a blog in the themes backend.

language select

Now this means, that we can run a multi domain, multilingual site in 1 WordPress install, while maintaining only 1 theme.

Localizing dates

One of the other things you need to take care of when you're localizing your WordPress theme is localizing the date output. To be honest the way I'm doing that right now is a bit of a hack, but it allows for us to translate dates from within a theme, without having to use the backend in the other language. It works by adding stuff like this to the themes functions.php:

$wp_locale->weekday[0] = __('Sunday','orangevalley');

So now, we can have an english backend, and a frontend in as many different languages on as many different domains as we want, served from one WordPress MU install, with only one theme to maintain. How cool is that?

给我留言

Copyright © 浩然东方 保留所有权利.   Theme  Ality 07032740

用户登录