Correct me if I'm wrong, but isn't WPML designed for translating static text? It doesn't look like it would work for text entered by the user, such as custom admin menu titles.
WPML is a complete multilingual website solution. It works for static as well as user-generated strings. Many plugins/themes support this already. For example, WordPress SEO by Yoast supports the translation of its admin texts that are entered by the user (such as titles for CPT archives etc.)
...if you look at the file
wpml-config.xml in root of WordPress SEO plugin folder, you'll get an idea of how this works. Your plugin stores these menu labels in
wp_options table, correct?
Yes, the plugin stores the menu configuration in the
wp_options table. However, the configuration data is not a flat array with predefined keys like what WordPress SEO uses, but a tree whose structure and keys can change depending on menu order, menu item URLs and so on.
wpml-config.xml does not appear to support dynamic keys.
It might be possible to use
icl_register_string() to translate the titles. I'll need to look into this more.
I was just going to tell you that
icl_register_string() is your friend :D
If you contact WPML team through their Go Global program page, they'll most probably help you out.
While working on this, I've been wondering: which menus do you want to translate?
So, I guess custom menus and menus with modified titles are needed here, but not WordPress default ones.
Custom menus already count as having modified titles, so that shouldn't be too hard to implement.
Okay, I've added basic WPML support to the development version of the plugin. Give it a try:
You will need to re-save your menu settings for the titles to show up in the translation interface.
Cool, it works!
You said "basic WPML support", does that mean something is missing from this version?
I called it "basic" because it only lets you translate menu items, but not the "Menu Editor" page itself (button labels, messages, and so on).
Ah, I see. Well, that does not necessarily fall under WPML support, but rather just i18n support.
Anyway, looking forward to the update!
Thanks, thanks, thanks. I hope that it is included in next release.
It's already in. Version 1.3 includes the partial WPML support discussed above.
Well, yes. Why would you expect them to be the same? The first link points to the development version which changes all the time, and the second one is a specific public release.
Thanks for your comments. I though that they were release versions.
You must log in to post.