Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
We are trying to set up a user role for translators on our site that gives them the permissions to edit and translate the content, but not to access plugins and theme options.

Solution:
Just add this code to the functions.php file:

add_filter('wpml_user_can_translate', function ($user_can_translate, $user){
    if (in_array('editor', (array) $user->roles, true) && current_user_can('translate')) {
        return true;
    }
     
    return $user_can_translate;
}, 10, 2);

67% of people find this useful.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 23 replies, has 2 voices.

Last updated by Radu 3 years, 2 months ago.

Assisted by: Radu.

Author Posts
November 14, 2021 at 7:25 pm #9991941

rachelA-6

Hey team,

We are trying to set up a user role for translators on our site that gives them the permissions to edit and translate the content, but not to access plugins and theme options etc.

We are using the plugin "Members" to create the user role and permissions. I have attached a screenshot of the permissions I have set for the role (which we have called "Editor").

I had a question:

As an administrator on the site, I am able to easily edit translations that have already been completed.

When our translators (Editors) go to edit a completed translation, they are not able to edit it and are instead taken to the translation queue.

Is there a permission that we can set to have a lesser user role than admin be capable of easily editing completed translations?

Let me know if this makes sense or requires further explanation.

Screen Shot 2021-11-15 at 6.11.59 am.png
November 17, 2021 at 1:42 pm #10014853

Radu

Hey Rachel,

You can find here a list of capabilities that you need to set for the custom roles:
https://wpml.org/documentation/support/wpml-admin-capabilities/

Basically, any user that has the wpml_manage_translation_management should be able to edit the translations. I had a look at the screenshot that you attached but I'm not sure if that list of taken from the admin or from the editor account role.

Also, you can go to the WPML → Translation Management → Translators tab and add the account that you'd like to edit the complete translation as a translation manager (the right side).

Thanks,
Rad

November 21, 2021 at 11:59 pm #10039817

rachelA-6

The list that I sent you on the screenshot was the permissions granted to the "Editor" role. Which I believe covered all of the capabilities listed in the link you sent through. Even when we list the "Editors" as Translation Managers they are still not able to edit completed translations easily, like an admin can.

If you have any more advice on this that would be brilliant.

November 23, 2021 at 1:33 pm #10051987

Radu

Hey Rachel,

I just installed this plugin on my website:
https://wordpress.org/plugins/user-role-editor/

then edited the editor role and selected all the options from the screenshot I attached. Also, please make sure that the editor account is set as presented in the screenshot in WPML → Translation Management → Translators.
Once I did that and used that account to access the dashboard area, I was able to press the pencil icon for a page, for example, and see the translation.

Can you give this a try and tell me how things work for you, please?

Thanks,
Radu

Screenshot 2021-11-23 at 15.31.43.png
Screenshot 2021-11-23 at 15.30.01.png
December 7, 2021 at 10:53 am #10139119

Radu

Hey Rachel,

My colleague asked me to open back this ticket. Can you tell me if you tried to make the changes from my previous message, please?

Thanks,
Radu

December 7, 2021 at 10:12 pm #10142479

rachelA-6

Hey Radu,

I have tried what you suggested, and it works in some instances and not in others.

I have created a test account for you with the editor capabilities.

When I click the pencil for the Spanish translation on the Post titled "Test to Find REAL LOVE", I get redirected to the Translation Queue page.

If you can look into this for us, and let us know if there is anything else you need.

December 8, 2021 at 12:20 pm #10146929

Radu

Hey Rachel,

I removed the credentials you attached to your previous message because they were publicly visible and we don't want that.

Can you attach again the credentials to the dashboard area, this time to the special fields available, please?
The next reply is set to be private so you can safely send me the credentials.

Thanks,
Radu

December 13, 2021 at 10:00 pm #10178563

Radu

Hey Rachel,

Can you give me admin access to the account that you created for me, please? Right now I can't access a few areas to check things out about the editor role.

Thanks,
Radu

December 15, 2021 at 7:30 pm #10193191

rachelA-6

Hey Radu,

Can I give you access to another account with admin privileges, so that you can switch between the two levels of account to test if needed?

I am not sure how to upload a private message with the details.

December 15, 2021 at 10:02 pm #10193787

Radu

Hey Rachel,

That would be very helpful. The next reply is set to be private so you can safely send me the credentials.

Thanks,
Radu

December 20, 2021 at 12:51 pm #10217361

Radu

Hey Rachel,

Thank you for giving me admin access too. I had another look at the editor account and I understand now what you're asking for. There are actually a lot more translations on the website (now that I have admin access), apart from the ones created by the editor account that you previously sent to me.
I couldn't find any other change for this so I asked my colleague to have a look at this and see if there's anything else I can do in order to achieve what you're looking for. I'll give you a message back once I get an update from one of my colleagues (which shouldn't take long).

Thanks,
Radu

December 21, 2021 at 8:13 am #10221997

Radu

Hey Rachel,

I checked this one more time and now I can see that you're using a plugin called Members in order to control the user account roles.

I'm not sure how this Members plugin works but I did test the editor account on my testing website, without using the Members plugin (so the editor account is created through the WordPress option) and I can edit the translations that are created by other users on the website.

In this case, can you deactivate the Members plugin, then create a new editor account on your website, set it as a translations manager in WPML → Translation Management → Translation Roles area, and try again to edit a translation that's done using another account, please? This is the setup I'm using on my test and I'm not redirected to the translation queue.

Thanks,
Radu

December 23, 2021 at 3:18 am #10235853

rachelA-6

Hey Radu,

I have deactivated the Members plugin and have created a new editor account.

I added the new account as both a translator and translation manager.

The account is under jonathan@emanationmedia.com.au

When I click to edit an existing translation it is still redirecting me to the translations editor page. Can you check this out to see if you are experiencing the same thing on your end?

I can send you the login to this new editor account if you can make the next message private.

December 27, 2021 at 9:19 pm #10252489

Radu

Hey Rachel,

I used the previous editor account to check things out (jonathanbaldwin8@gmail.com). I can see that you still cannot access the translations created by others.

Can you update the WPML to the latest version first, then use this plugin:
https://wordpress.org/plugins/user-role-editor/

to edit the editor role and add all the WPML capabilities to it, please? This is the setup that works on my testing website.

Thanks,
Radu

December 31, 2021 at 10:30 am #10268473

rachelA-6

Hey Radu,
I followed your instructions but am still experiencing the same issues. Can you look into this for us?