# HG changeset patch # User Dan # Date 1200980299 18000 # Node ID d0825e599853a5c8937079aaef5a07b18a35998b # Parent ed4f3ee072be9c4d86965a7fc98e231c8c9759cd Localized the 404 page, w00t. diff -r ed4f3ee072be -r d0825e599853 includes/pageprocess.php --- a/includes/pageprocess.php Tue Jan 22 00:22:14 2008 -0500 +++ b/includes/pageprocess.php Tue Jan 22 00:38:19 2008 -0500 @@ -1294,7 +1294,7 @@ $title = ( isset($page_data['name']) ) ? $page_data['name'] : $paths->nslist[$this->namespace] . htmlspecialchars( str_replace('_', ' ', dirtify_page_id( $this->page_id ) ) ); $b = '' . $title . ''; - $ob .= '(Redirected to ' . $b . ' from ' . $a . ')
'; + $ob .= '' . $lang->get('page_msg_redirected_from_to', array('from' => $a, 'to' => $b)) . '
'; } } @@ -1318,12 +1318,15 @@ function err_wrong_password() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $title = 'Password required'; - $message = ( empty($this->password) ) ? '

Access to this page requires a password. Please enter the password for this page below:

' : '

The password you entered for this page was incorrect. Please enter the password for this page below:

'; + $message = ( empty($this->password) ) ? + '

' . $lang->get('page_msg_passrequired') . '

' : + '

' . $lang->get('page_msg_pass_wrong') . '

'; $message .= '

-    +   

'; if ( $this->send_headers ) @@ -1373,6 +1376,7 @@ function err_page_not_existent($userpage = false) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; header('HTTP/1.1 404 Not Found'); @@ -1389,22 +1393,28 @@ { if ( $userpage ) { - echo '

There is no page with this title yet.

-

This user has not created his or her user page yet.'; + echo '

' . $lang->get('page_msg_404_title') . '

+

' . $lang->get('page_msg_404_body_userpage'); } else { - echo '

There is no page with this title yet.

-

You have requested a page that doesn\'t exist yet.'; + echo '

' . $lang->get('page_msg_404_title') . '

+

' . $lang->get('page_msg_404_body'); } if ( $session->get_permissions('create_page') ) { - echo ' You can create this page, or return to the homepage.'; + echo ' ' . $lang->get('page_msg_404_create', array( + 'create_flags' => 'href="'.makeUrlNS($this->namespace, $this->page_id, 'do=edit', true).'" onclick="ajaxEditor(); return false;"', + 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) + )); } else { - echo ' Return to the homepage.

'; + echo ' ' . $lang->get('page_msg_404_gohome', array( + 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) + )); } + echo '

'; if ( $session->get_permissions('history_rollback') ) { $e = $db->sql_query('SELECT * FROM ' . table_prefix . 'logs WHERE action=\'delete\' AND page_id=\'' . $this->page_id . '\' AND namespace=\'' . $this->namespace . '\' ORDER BY time_id DESC;'); @@ -1415,16 +1425,24 @@ if ( $db->numrows() > 0 ) { $r = $db->fetchrow(); - echo '

This page was deleted on ' . $r['date_string'] . '. The stated reason was:

' . $r['edit_summary'] . '

You can probably roll back the deletion.

'; + echo '

' . $lang->get('page_msg_404_was_deleted', array( + 'delete_time' => enano_date('d M Y h:i a', $r['time_id']), + 'delete_reason' => htmlspecialchars($r['edit_summary']), + 'rollback_flags' => 'href="'.makeUrl($paths->page, 'do=rollback&id='.$r['time_id']).'" onclick="ajaxRollback(\''.$r['time_id'].'\'); return false;"' + )) + . '

'; if ( $session->user_level >= USER_LEVEL_ADMIN ) { - echo '

Additional admin options: detag page

'; + echo '

' . $lang->get('page_msg_404_admin_opts', array( + 'detag_link' => makeUrl($paths->page, 'do=detag', true) + )) + . '

'; } } $db->free_result(); } echo '

- HTTP Error: 404 Not Found + ' . $lang->get('page_msg_404_http_response') . '

'; } $this->footer(); @@ -1491,9 +1509,10 @@ function send_error($message, $sql = false) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $content = "

$message

"; - $template->tpl_strings['PAGE_NAME'] = 'General error in page fetcher'; + $template->tpl_strings['PAGE_NAME'] = $lang->get('page_msg_general_error'); if ( $this->debug['works'] ) { diff -r ed4f3ee072be -r d0825e599853 language/english/core.json --- a/language/english/core.json Tue Jan 22 00:22:14 2008 -0500 +++ b/language/english/core.json Tue Jan 22 00:38:19 2008 -0500 @@ -111,9 +111,25 @@ Enano Wiki formatting guide.

This page redirects to %redirect_target%.', msg_redirected_from: '(Redirected from %from%)', + msg_redirected_from_to: '(Redirected from %from% to %to%)', + + msg_passrequired: 'Access to this page requires a password. Please enter the password for this page below:', + msg_pass_wrong: 'The password you entered for this page was incorrect. Please enter the password for this page below:', + lbl_password: 'Password:', + + msg_404_title: 'There is no page with this title yet.', + msg_404_body_userpage: 'This user has not created his or her user page yet.', + msg_404_body: 'You have requested a page that doesn\'t exist yet.', + msg_404_create: 'You can create this page, or return to the homepage.', + msg_404_gohome: 'Return to the homepage.', + msg_404_was_deleted: 'This page was deleted on %delete_time%. The stated reason was:

%delete_reason%

You can probably roll back the deletion.', + msg_404_admin_opts: 'Additional admin options: detag page', + msg_404_http_response: 'HTTP Error: 404 Not Found', msg_archived_title: 'Notice:', msg_archived_body: 'The page you are viewing was archived on %archive_date% at %archive_time%.
View current version | Restore this version', + + msg_general_error: 'General error in page fetcher', autosuggest_heading: 'Page name matches', autosuggest_col_name: 'Page title',