WordPress.org

Ready to get started?Download WordPress

Forums

Admin Menu Editor
Translate menu labels with WPML (17 posts)

  1. Hassan
    Member
    Posted 1 year ago #

    Hi Janis,

    I need to translate customized menu labels with the WPML plugin. It's fairly easy to add support for this. Take a look here.

    http://wordpress.org/plugins/admin-menu-editor/

  2. Janis Elsts
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. Hassan
    Member
    Posted 1 year ago #

    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.)

  4. Hassan
    Member
    Posted 1 year ago #

    ...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?

  5. Janis Elsts
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  6. Hassan
    Member
    Posted 1 year ago #

    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.

  7. Janis Elsts
    Member
    Plugin Author

    Posted 1 year ago #

    While working on this, I've been wondering: which menus do you want to translate?

    • All admin menu items, including defaults (like "Dashboard", "Settings" and so on).
    • Only custom menus that you have created yourself.
    • Only menus with modified titles.
  8. Hassan
    Member
    Posted 1 year ago #

    • Default menu items are already translated into other languages. So if I am running a multilingual site (or running WordPress with one language that's not English), I'll have those menus already translated. So, yeah no need to translate those
    • If by custom menus you mean any non-default ones, including menus added by plugins, then many plugins support translations, but it's good to be able to translate those if the language of my installation isn't officially supported by the plugin
    • Menus with modified titles are the main reason I asked for this feature. I have plugins with menu items that are properly translated. When I modify the title of one, this new title now appears as I wrote it regardless of the current language of the WordPress UI

    So, I guess custom menus and menus with modified titles are needed here, but not WordPress default ones.

  9. Janis Elsts
    Member
    Plugin Author

    Posted 1 year ago #

    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:
    http://downloads.wordpress.org/plugin/admin-menu-editor.zip

    You will need to re-save your menu settings for the titles to show up in the translation interface.

  10. Hassan
    Member
    Posted 1 year ago #

    Cool, it works!

    You said "basic WPML support", does that mean something is missing from this version?

  11. Janis Elsts
    Member
    Plugin Author

    Posted 1 year ago #

    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).

  12. Hassan
    Member
    Posted 1 year ago #

    Ah, I see. Well, that does not necessarily fall under WPML support, but rather just i18n support.

    Anyway, looking forward to the update!

  13. Josep Comas
    Member
    Posted 9 months ago #

    Thanks, thanks, thanks. I hope that it is included in next release.

  14. Janis Elsts
    Member
    Plugin Author

    Posted 9 months ago #

    It's already in. Version 1.3 includes the partial WPML support discussed above.

  15. Josep Comas
    Member
    Posted 9 months ago #

  16. Janis Elsts
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  17. Josep Comas
    Member
    Posted 9 months ago #

    Thanks for your comments. I though that they were release versions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic