跳过导航
25

WPML includes full support for untranslated content, using the new Content Duplication feature. It also lets you translate custom fields using a Visual WYSIWYG editor.

Displaying Untranslated Content

It turns out that displaying untranslated content across different languages is not as simple as you’d think. WPML 2.4.2 supports this by allowing you to duplicate that content to different languages. For example, if you want English blog posts to appear in Spanish, you can duplicate them all in one go.

To see how to duplicate content in different languages, have a look at the previous post about it.

There are interesting results to this and we hope that we have them all covered.

For example, if your Spanish blog now includes English posts, you want search engines to understand what’s going on.

Google will assume that your Spanish blog contains Spanish content. We’re added a way for you to tell Google that these duplicate posts are indeed in English and where they’re coming from.

First, all Spanish posts will include the rel=”canonical” tag, linking to the original English post.

Then, your index page (where different posts are displayed) will include a mix of content in different languages. There’s a way to handle this as well.

We’ve added a new API call – wpml_get_language_information.

This returns an array that contains the locale, language name, text direction and other useful information. If you’re planning to display untranslated content, we recommend that you call this function in your theme and wrap texts in language information. This will tell Google exactly how to understand what it sees.

Translating Custom Fields using a Visual Editor (WYSIWYG)

If you’re using Types to manage custom fields and custom post types (and you should), you now have a way to create custom fields that use the native WordPress Visual editor. This means that you can have different full-featured editors for different parts of posts.

WPML 2.4.2 follows and allows your translators to use WYSIWYG editors. When you use WPML’s Translation Editor and send content to translation, WPML automatically adjusts the translation interface to display fields in the same way writers see them.

It supports single-line fields, text-area (multiple lines) and now, also WYSIWYG fields.

SEO Love with Per-Language Sitemaps

This version of WPML also includes a fix for a very old problem. When you use languages-per-domains, you’ll need a separate XML sitemap to give to Google. If your single sitemap includes all pages, in all languages, Google rejects it.

WPML 2.4.2 adds support for creating per-domain sitemap with Yoast’s WordPress SEO plugin (which we use and recommend).

When you use WPML 2.4.2 together with WordPress SEO (version 1.1.1 and above), you’ll get individual sitemaps – one per language.

Open your sitemap_index.xml and you’ll see links to the different sitemaps per type and language. It will look like this:

  http://wpml.local/post-sitemap.xml
  http://wpml.local/page-sitemap.xml
  http://wpml.local/category-sitemap.xml
  http://fr.wpml.local/post-fr-sitemap.xml
  http://fr.wpml.local/page-fr-sitemap.xml
  http://fr.wpml.local/category-fr-sitemap.xml
  http://de.wpml.local/post-de-sitemap.xml
  http://de.wpml.local/page-de-sitemap.xml
  http://de.wpml.local/category-de-sitemap.xml
  http://es.wpml.local/post-es-sitemap.xml
  http://es.wpml.local/page-es-sitemap.xml
  http://es.wpml.local/category-es-sitemap.xml

In the Google Webmasters console, you need to submit all the sitemaps for each language. So, for instance, in our Spanish domain, we’ll need to submit:

  http://es.wpml.local/post-es-sitemap.xml
  http://es.wpml.local/page-es-sitemap.xml
  http://es.wpml.local/category-es-sitemap.xml

It’s been a pleasure working with Joost on this functionality. You can expect more great stuff for multilingual SEO in the near future.

Bugs Fixed

The joy is never complete without a few bugs to crush. In this release, we’ve significantly improved handling duplicate slugs. This is something that we added to WPML 2.4.1, but had some glitches in some cases. Now, it looks like all cases are handled.

We also included fixes for everything reported in the forum until now. I you have anything that’s not working as expected, don’t hold hack. Let us know about it.

Oh, and I almost forgot, Happy WordPress 3.3! (yes, WPML has been WP 3.3 compatible for a few weeks now)