Allow translation via WPML plugin All in One SEO Pack Feature Requests Forum

The support forums have a new home! Please visit All in One SEO Pack's new residence at Semper Plugins to purchase a support plan.

 
You must be logged in to post
Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Allow translation via WPML plugin

Post
New Member

Amir

posts 8

2:43 am July 15, 2009

I am working on a plugin that lets WordPress run multilingual.

We are now adding support for translation of texts created by other plugins. Many of our users asked us to try make
it happen with your excellent All-in-One SEO.

If you add this support to your plugin, it would allow people who use AIO SEO and WPML to have everything multilingual. For people who don't use our
plugin, it will work normally as it does now (single language).

Users don't need to do anything special for this translation to happen. There are no language tags to insert anywhere. All the translation is done in the translation screen of our plugin. Here is a link to the integration API:

http://wpml.org/wordpress-tran…..nd-themes/

How it works

Everything that is per post/page already runs multilingual as it is (due to our plugin's architecture). What's missing are all the texts entered in the plugin's admin screen (Settings->AIO). For example, the home title and description.

When users run a multilingual WP site they need these texts to appear in the correct language, so if you're in example.com you'll get the title and description in the default language (say English), but if you're visiting example.com/es/ you'll see those texts in Spanish. All the texts entered in the AIO admin screen would need to be translated.

What our plugin does is allow other plugins to register strings that need to be translated. Then, the user has a translation interface to enter translations in the site's languages. Finally, the plugin calls our translation function to display the string in its correct language. It works very similar to gettext, just supports user entered texts and not only static texts.

Admin

WordPress Professional

Raleigh, NC

posts 442

2:57 am July 15, 2009

Post edited 8:59 am – July 15, 2009 by WordPress Professional
Post edited 9:00 am – July 15, 2009 by WordPress Professional


You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

Amir

posts 8

3:28 am July 15, 2009

I'm posting about it in our blog/newsletter and I'll ask WPML users to jump in.

Just for the record, it's not different contents for the same URL. Each URL has unique contents and different languages have different URLs.

For instance, have a look at our site. It uses our WPML plugin.

English: http://wpml.org/

Spanish: http://wpml.org/es/

Everything under http://wpml.org/es/ is in Spanish. Right now, we can't use AIOSEO because we would get the same title and meta data for all the 'home' pages, regardless of their language. If AIOSEO allowed WPML to translate those fields then we could enter the translation for the home title for each language (as well as translation for the category, search, etc.).

Our issue is only with the texts in the admin section. The title, keywords and meta-description entered per page are fine. WPML assigned a language to each page, so that translations are actually different pages (linked together).

Admin

WordPress Professional

Raleigh, NC

posts 442

3:59 am July 15, 2009

You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

Amir

posts 8

4:18 am July 15, 2009

We're already providing API functions for that, which you can use. This way, your plugin's texts will be translated using the translation GUI that we already provide.

In your admin screen, you call:

icl_register_string($context, $name, $value)

You do that for each string in the admin panel.

  • $context is any name you choose to describe your plugin. 'All in One SEO Pack' would be just fine.
  • $name is the name for the string. For example 'Home title'.
  • $value is what the user enters (the string's value).

Then, when the page is rendered, you call:

icl_t($context, $name, $value)

If there's translation for that string, it will be returned. Otherwise, the original string is returned.

Of course, you need to wrap these two calls with function_exists() so that if WPML is enabled, it uses it, otherwise, it works normally.

WPML knows what the display language is, so you don't need to do anything besides making these two calls. It's only required for the admin strings. The per page/post texts are already OK.

The way users see it

Users keep working with AIOSEOP normally. When they want to provide traslation for the AIOSEOP strings, as well as other strings in the site, they go to Admin->WPML->String translation.

There they see a table of all the strings. Each string lists its translation status and they can filter by it too.

Once they enter translation there, it gets returned by the icl_t() function. If the strings change (because they were edited in the AIOSEOP admin screen), they're flagged as 'need update' in WPML's string translation screen.

Admin

WordPress Professional

Raleigh, NC

posts 442

4:28 am July 15, 2009

You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

Amir

posts 8

4:45 am July 15, 2009

Yes. It's just a GUI that lets the admin see what needs translation and enter the translations.

Admin

WordPress Professional

Raleigh, NC

posts 442

5:03 am July 15, 2009

You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man if he shall gain the whole world and lose his own soul

New Member

Amir

posts 8

5:09 am July 15, 2009

Sure. If there are already hooks to set those texts, we can use them. Where is it documented?

Admin

hallsofmontezuma

Cary, NC

posts 202

5:36 am July 15, 2009

You must be a subscriber to view administrator posts. Click here to purchase a support subscription.

For what shall it profit a man, if he shall gain the whole world, and lose his own soul?

New Member

senlin

posts 6

4:42 pm July 15, 2009

Hi Admins and Amir,

I think it is an excellent initiative to try to make popular and great plugins collaborate with the multilingual project WPML offers. Translations are all manual, responsibility of the user and with that you see that people who are serious about having a true multi-lingual WordPress website, using WPML as their "partner" to get this done.

There was a plugin that tried and functioned for a bit, but the developers didn't evolve with WordPress, so apart from WPML there is not really any alternative. OK there are a few, but they don't offer the same user friendliness as WPML does and they certainly don't go as far as contacting developers of other plugins to collaborate.

I am aware that there are many people using WordPress for only language, but as global borders dissolve, I think also that being able to develop multi-lingual websites – with plugins that are adaptable to work in such environments – not only is important, but is a must…

It would be fantastic if All In One SEO Pack and WPML can start working together! 

New Member

Raven

posts 1

11:27 am July 28, 2009

Any news regarding possible cooperation between you? I would be amazingly pleased if both my most favorite plugins for WordPress will be finally compatible. And I'm pretty sure a lot of people out there are using your wonderful plugins and would love to see this update! Could you please let us know if there is any progress?

New Member

Amir

posts 8

3:30 pm July 28, 2009

Hi Michael,

We're out with WPML which allows translating the All In One SEO strings. It's already running in the Contact Form 7 plugin and being added to several of other popular plugins such as WP Polls, WP-Email and others.

Is there any way to reconsider adding this as to a future AIOSEOP version? If you like, we can help with the code for that.

New Member

rickitambo

posts 1

10:29 am August 10, 2009

Guys!

PLEASE come to terms!!! There are a ton of people out there, programming different WP-Sites just to have multilingual SEO-friendly sites. This combination would be out of this world! Collaborate and the international commnuity will be fixed to using solely these two plugins, no discussion of any other plugin-alternatives used!

New Member

senlin

posts 6

11:28 am August 10, 2009

I second @rickitambo's post!

If you're looking for critical mass of users that have bi/multi-lingual sites, I think we have reached that already long long time ago!

Apart from US-based websites I think most European and Asian websites in one way or another use 2 or more languages. People who now want 2 or more languages basically have the following choice:
- easy implementation of languages but SEO only in 1 language OR
- SEO for all languages but no easy language integration (necessary to set up multiple websites with multiple WP installations)

The international community is way larger than you think, you just don't hear them to much, because they have to put all their energy in programming double (or more) the amount of websites.

All In One SEO and WPML are a GREAT combination!

I would even go so far (speaking for myself here though) to pay a fee to both Michael and Amir to have access to this combo! 

New Member

Miketee

posts 3

4:59 am September 2, 2009

Hi

I am moving my blog from Movable Type to WP, it is multilingual and each languae has its own domain name. At first I went crazy trying to hack WP, but then I discovered WPML and life got easy. I also use AIOSEOP, another great plugin.

BUT ! As it stands now, all languages get the same home page meta and description, and the same title.  If I leave these blank in AIOSEOP, I can hack in my own metas, but the title reverts to the WP blog title (from Settings), again same for all languages.

Will you come up with a common solution?

In the mean time, any way to disable title rewriting so I can plonk in my own title in a home.php template?

thanks for all the great work

Mike

New Member

senlin

posts 6

6:31 am September 2, 2009

Post edited 12:32 pm – September 2, 2009 by senlin


Hi Mike,

I understand your concern and as I desribed in my previous post, for now it is still not possible to ue WPML and AIOSEO together.

The only solution is to use another plugin. It's a very simple plugin, from 2006 even) but still works perfect. With Custom Fields you fill in your own description and keywords and as long as you place wp_head right under the title tag, your meta description and keywords will be placed right under the title.

I could not reach the site of the plugin just now, but found a download link that works: http://www.g-loaded.eu/package…..gs-1.6.zip

Good luck!
Piet

New Member

Miketee

posts 3

6:36 am September 2, 2009

Thanks Piet.

I have gone so far with both plugins that I don;t feel like rolling back.  I think I'll do a dirty hack of lines 210, 228 and 595 in the class file, that should do it… until something better comes out!

cheers

Mike

New Member

senlin

posts 6

6:48 am September 2, 2009

Hmmm yeah I understand.

The only additional disadvantage of that is that when Michael comes with an update (and he does that on a regular basis) you have to dive back into the code. Or don't upgrade the plugin…

The Add Meta Tags plugin never receives an update and still works :)

Until Michael becomes convinced that he should cooperate with Amir the only "choice" I have is to use that one…

Good luck!
Piet

New Member

Amir

posts 8

6:49 am September 2, 2009

I'd be very happy to help with this. Since I first posted about providing a multilingual ready version of AIOSEOP, we've had a lot of progress. Some popular plugins such as Contact Form 7 and YARPP use WPML's translation interface. It was a pretty quick addition for both of them and we're move than happy to help with that.

If we'll be allowed to contribute this change to AIOSEOP, we'll do it. It can be ready in a couple of days.

Amir


About the WordPress Developer Forum

Forum Timezone: America/New_York

Most Users Ever Online: 205

Currently Online:
15 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 5
Forums: 23
Topics: 1543
Posts: 3447

Membership:

There are 6357 Members

There are 4 Admins
There are 3 Moderators