Don’t send a 301 when you mean a 404. The 404 page sends an error to anyone (or anything) trying to access the page, e.g. Google won’t index a page that sends a 404 header.
You could put a Snippet on your 404 page (choose which page acts as your 404 page in your site config), and then print out the language specific text using a series of if/elseif statements or switch block (i.e. a select/case), but this would limit the response only to the page’s CONTENT, and not to its title, description, etc.
A better alternative to this is create a series of 404 pages for each language your site supports, then create a plugin that fires on the
OnPageNotFound event with a similar if/elseif or switch block:
$niz = $_SERVER['REQUEST_URI'];
$ogranichenie = substr($niz, 1, 3);
switch ($ogranichenie) {
case 'en':
$modx->sendForward( 123, 'HTTP/1.0 404 Not Found'); // where 123 is the page_id of the English 404 page
exit();
break;
case 'sp':
$modx->sendForward( 243, 'HTTP/1.0 404 Not Found'); // where 243 is the page_id of the Spanish 404 page
exit();
break;
default:
$modx->sendForward( 333, 'HTTP/1.0 404 Not Found'); // where 333 is the page_id of the catch-all 404 page
exit();
break;
}
See the MODx API:
http://wiki.modxcms.com/index.php/API:sendForward
Alternatively, you could use one of the multi-lingual solutions that rely on xml-style tags to delineate blocks of language-specific text, but I think the above solution is easier.