1

I have very interesting request from a client:

They want to have website in two languages for different countries and also are asking whether it possible to have domains for each langues.

Goal is so that both countries with think that its local business (it is in both situation).

They have quite complex database of products, so having only 1 database would be great. Is it possible to have something like this:

coolproduct.co.uk/category/bicycle coolproduct.dk/kategori/cykle

Having one database (technically one website?). If no, what whould be the best practice, while taking in consideration complex items with sometimes changing special pages?

1

For the multilingual setup I´d recommend using WordPress Multisite. You can give each site it´s own top-level domain, or host them on subdomains or subdirectories.

All sites in the network will share the same database (although they´ll have separate tables). To query the products you have a few options:

  1. Use switch_to_blog to query the other blog´s table
  2. Create a separate site for the products only and use the RSS feed as an XML service (import this feed in both of your sites).
  3. Use an external database?

These are just some ideas, there are probably more ways to do this.

0

You could override the language programmatically based on domain. Something like this off the top of my head.

function change_textdomain ($domain) {
    switch($domain){
        case 'domain1.com':
            $poFile = 'filename';
            break;
        case 'domain2.com':
            $poFile = 'filename2';
            break;
    }
        load_textdomain('text_domain', $poFile);
}

add_filter('override_load_textdomain', 'my_load_textdomain');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.