23

When we wrote about better roles and capabilities for translation, we got great feedback from you. Here is what we came up with. Of course, we want to know that it’s good for you.

We want to allow specific users to edit and write in their languages. This way, you can create ‘reviewer’ or ‘language manager’ users who can edit everything, but only in their language. Today, it’s a little difficult to do it. You’ll need to make that user an editor in all languages.

1. Add Roles per Languages

This will start with the Translation Management screen, under the Translators tab. You’ll have a new column letting you choose elevated roles for the languages this translator works in.

Translators admin screen
Translators admin screen

The idea is, you can create a ‘subscriber’ user as translator. Then, make it ‘editor’ in the languages he/she translates in. In languages that you select, the translator will have the roles that you assign. You’ll be able to use standard WordPress roles (like author and editor) or your custom roles with custom capabilities.

2. The WordPress Admin Adapts to the Content Language

When translators go to the WordPress admin, they will see menus according to the language in which we’re showing content. When looking at Spanish content (not necessarily using Spanish localization for the GUI), the translator would get the role that you selected for him/her for Spanish.

If you created a ‘subscriber’ user, that translator will not see any content editing for the default language (let’s say English). But, when switching to a language that they can translate to, they will see all the WordPress editing menus.

Example - no privileges in English
Example – no privileges in English
Editor privileges in Spanish
Editor privileges in Spanish

When the translator changes the content language, using the language menu at the top of the screen, the role changes to that language. You can give different roles to different languages. Each role comes with its capabilities.

3. Create Custom Roles and Assign Capabilities

This step is optional. If you’re happy using the standard WordPress roles and capabilities, you’re all set. You can assign different roles to different languages and allow your translators to work as language reviewers.

However, if you want to go further and craft unique roles and capabilities for reviews and translators, we have a solution for you.

You can use our Access plugin lets you create custom roles and control the capabilities that these, as well standard roles, have.

Access plugin
Access plugin

Access will work with this new scheme without any change. As it creates roles and control capabilities in the standard WordPress way, it will work with WPML too. Any plugin (or your PHP code) that adds roles and modifies capabilities will play fine with this.

What do you think? Will this help you manage translations easier with WPML? Anything else you had in mind?

23 Responses to “Coming in WPML 3.0 – Multilingual Roles and Capabilities”

  1. This looks awesome guys. I don’t really need custom roles/capabilities at the moment, but good to know they will be there when I need them.

    I’d just like to take this opportunity to nag you (one more time!) about the aesthetics improvements for WPML as well as better admin CSS for RTL languages. We need to see a more polished and clean UI in this release. Please make my dream come true 😀

    • You’re not nagging, it’s fine. Let me just share our plan with you, so that you know what to expect.

      WPML 2.9.1 – in about two weeks: this is focused on new functionality that we need for e-commerce sites. This will come together with a very major release for WooCommerce Multilingual.

      WPML 2.9.2 – about 2 weeks after that: some (important) speed optimizations, mainly related to caching in the String Translation module. We have caching already, but we found out that we can do more.

      WPML 3.0 – about a month after: roles management, GUI improvements, better RTL CSS in the WordPress admin and various smaller improvements.

      Does this help?

      • Oh, yes. This does help.

        I remember seeing a screenshot you showed me once of the new GUI that v1.3 of your Views plugin will come with. Even though it’s not released yet (hey, when?) I did like that screenshot with the flat icons and other stuff. I hope WPML copies that design as well. You should make all your plugins consistent in their look and feel.

  2. I’m very sorry to say this Amir, but I cannot say that this is a good solution. I will go even further: I think it’s the worst possible way to tackle the upcoming challenge!

    I had a quick look at your Access plugin and apart from the fact that I actually CANNOT see that it can make capabilities, I also think that these manage-translations capabilities I spoke about in your previous post should come from WITHIN WPML.

    I for one will never buy yet another plugin just to be able to add roles and capabilities that work with WPML. We have Members for that for many years already.

    As I mentioned before over the years and lastly in the post you are referring to above: Gravity Forms adds a number of Capabilities to its plugin. If people don’t want to use them, they don’t, but people that have Role Managing plugins installed immediately see the GF-specific capabilities and can therefore play around with them.

    That easy?

    Yes, that easy!

    As far as I can see your Access plugin uses Levels? I hope you are aware that these levels were abolished and replaced with capabilities already a few years back???

    All in all I am very disappointed that an issue that people have been asking for well over two years already, now is implemented in this shortsighted way.

    What I don’t understand is that you said you understood it, Amir (http://wpml.org/2013/07/wpml-2-9-released/comment-page-1/#comment-522643)

    From what I read above I don’t see you did. If you want we can have a chat on Skype or something to explain the whole capabilities vs Roles thing.

    • Piet, this post stay “You can use our Access plugin”.
      It doesn’t say that you must use it.

      It also says “You can give different roles to different languages. Each role comes with its capabilities.” before talking about Access.

      You can still create custom roles in WordPress with few line of codes, or using one of many capability plugins available out there.

      • Thanks for helping out here. I had a talk with Piet and got to understand the suggestions better. Piet is talking about different things than I wrote in the post. Piet’s needs seem to be quite different than what we noticed and planned for.

        Nevertheless, these suggestions make sense and are fairly easy to implement. We’ll be adding several ‘capabilities’ to WPML, which will allow to use the String Translation, Translation Dashboard and Menu Sync sections without having an administrator account. This will be in addition to the roles-per-language settings that I wrote about here.

        And, like I wrote in the blog post, we’ll make sure that you can use all this with any role management plugin. Of course, we like our own Access plugin, but the solution uses the standard WordPress roles and capabilities, so you will be able to use it with any roles-management plugin.

        Again, thanks for being involved and helping out!

  3. Hello!

    My client is looking for this very feature…I’m wondering when it will be available? This was posted in July and reading it now, I kind of expected it to be here…but perhaps that’s just me being impatient.

    My client has several translators logging in to the admin and they don’t want each of them seeing / accessing other languages.

    Please let me know when this will be released? I’m eagerly awaiting these features!

    Thank you so much for a great plugin and keep up the good work!

    Paul.

    • You’re not impatient. We were planning to have it done before, but other issues came up. Recent versions of WPML have a lot of new code for e-commerce support. Now, we are back to our planned schedule, with better caching and custom capabilities. We need it too, for our own sites, so we feel the urgency.

  4. In addition to my last message…I noticed it states WPML 3…so I upgraded and everything is now up to date.

    However, following the instructions, I’m still a little confused as to how to achieve this.

    1. I created a new test user, with role as a ‘subscriber’.
    2. I add them as a translator for English to Italian in the Translation Management tab.
    3. In users, I switch to Italian and make this new user an Editor.

    However, I thought this would only make them an Editor in Italian and leave them as a Subscriber in all other languages…but this is not the case. It makes them an Editor for all languages. So, if I login with this new user, I am still able to edit in any language – not what I was after.

    Am I missing something really obvious here? I cannot afford the Access plugin right now and only require simple role functionality, so is it possible to do this with the current plugins?

    Essentially, I want to create users that can only access the certain languages I assign them to.

    Thanks for your help in advance.
    Paul.

      • It sounds close to what I need, but won’t fit the bill I think. I have a lot of custom fields…and I’d also like them to access other parts of the admin, not just to be able to translate the content – as I’d like them to be able to browse through everything in say, Italian…not just the content I assign them to translate. Sometimes for example, they may even want to create a new page in Italian that isn’t in English, I don’t think this method would allow that.

        Essentially, I just want to limit the admin to everything in Italian for this certain user. And German for another, etc etc, Hope that makes sense?

        When do you anticipate this feature will be available?

        Many thanks for your speedy reply!
        Paul.

      • Probably. Not, although we want to very much. This release will include a number of other fixes and improvements as well as very important performance optimizations and WordPress 3.8 support. It would be better to release a version with these updates and continue with better roles management in the following version.

  5. Hi!

    I’m very interested in this new feature. Do you have any idea of when it will be available?

    In the event that will take a long time, is there any method/function in the plugin called when the language changes in the admin? If so maybe I can add a hack to modify user privileges there.

    Thanks in advanced

    • We’re going to have it in WPML 3.2. It’s been delayed a little, but we’re getting there. WPML 3.2 is around 5 weeks from now.

      I really don’t recommend building a hack for it. That logic determines quite a lot. When we implement it, we’ll set up custom capabilities. Then, we you use existing role management plugins to control exactly who can do what.

      • Hi,

        Just wanted to know how things are going with the 3.2 release and the new capabilites?
        Thanks for a great plugin!

        • Almost there. We had some ups and downs and things are under control and stable now. You can use the WPML beta, which includes the support for capabilities. We are running it on our sites and it’s working great for us.

  6. Hello,

    Is the new capabilities system in the latest versions of WPML allowing the situations you guys described in this post ?

    I mean, is it now possible to have roles so that say the italian editor/author will only see the italian contents, and be able to create posts for example only in italian ?

    The aim for us is to simulate a multisite installation for the news part of a more general portal. In each language there would be a “subwebmaster” that would be able to add news in his language (which is NOT the same as translating existing news), and these news article would not necessarily be visible to other “subwebmasters”.

    Would this be possible ?

    Thanks
    Michael

    • Sorry, eventually we chose a different path. We are still planning to add this too, but people asked for different capabilities management in WPML. We’re going to add a ‘language manager’ role, but it’s not there now.

  7. For a current project I would like site-visitors to be able to apply for Translators for specific language pairs. For that I can use the User Registration addon of Gravity Forms.

    But I cannot select the Translator Role as it seems to be hidden and/or made invisible? I have been trying to look for it in the Translation Management files, but no joy yet…

    Is this at all possible or is it that I (again) want something that simply is not possible?

    On top of this I wonder why none of the Role Managing plugins can show the Translate capability? I know if exists as you can easily check for it with
    if ( current_user_can( 'translate' ) ) {
    echo 'You have the Translate Capability, Hurray!';
    }

    Would really save a lot of headache if that capability was simply visible… Any suggestions?

    Cheers,
    Piet

    I have found the translate capability, but only through a function as it does not show as an existing Capability in any of the Role Managing plugins.

    Wondering what will happen if I add the Translator Role with the Members plugin? And what will happen if I create a new capability translate and add that to users.

    • I think that we didn’t build it with the intention that other plugins will use that role. When you add translators, you also need to indicate which languages they can translate between. How will you do this with the GF addon? Just making it a ‘translator’ without languages is not going to give you much.

      How about hooking to the GF action, after a user is created, and adding this record yourself to WPML’s table? You can check what WPML adds when you set a new ‘translator’, including the language pair, and do a similar thing in your code.

      What’s important is how it’s saved in the database. WPML will see this and allow the user to translate, as you need.

      Would this approach work for you?

      • Thanks for your reply, Amir.

        Thing is that I cannot find any reference to the Translator Role. The way I have set it up for now is that I have made a form for an application to become a Translator. That user will become a Subscriber, which is not the default Role in this site’s setup.

        With the “List” feature in GF, the applicant can add up to 10 language pairs
        Then I have added a manual approval process as I have not found the way to add the language pairs data automatically, hooking into a GF action indeed is a good idea 🙂

        I spent quite some time yesterday going through the Translation Management files trying to figure out how the Translator Role is registered and how language pairs are added. To be honest I haven’t found much I would be able to use. As a matter of fact I cannot find anything on where the Translator Role would be registered… Could you give me a hint where to look?

        Cheers,
        Piet