Here is an example of code to add in your functions.php file.
It’s definetly not the cleanest code, as it exit the page a bit quick and without any good design, but at least it works..
function limitTraducteur( $post_id, $post, $update ) {
$usermeta = wp_get_current_user();
if (in_array("translator", $usermeta->roles) && isset($_POST) && count($_POST)>0) {
// If it's a menu, block the role to a specific ID menu
if (isset($_POST["menu"]) && $_POST["menu"]!=9) {
echo "Error: You are not allowed to edit this menu. Please select the German menu.";
echo "<br/><br/><a href='javascript:history.go(-1)'>Back</a>";
exit;
// For the other content than menu
} elseif ($_POST["post_lang_choice"]!="de" && $update==true && !isset($_POST["menu"]) && $_POST["menu"]!=9) {
echo "Error: You are not allowed to edit a content in a different language than German.";
echo "<br/><br/><a href='javascript:history.go(-1)'>Back</a>";
exit;
}
}
}
add_action( 'save_post', 'limitTraducteur', 10, 3 );