+ ' . $lang->get('history_col_datetime') . ' |
+ ' . $lang->get('history_col_user') . ' |
+ ' . $lang->get('history_col_minor') . ' |
+ ' . $lang->get('history_col_action_taken') . ' |
+ ' . $lang->get('history_col_extra') . ' |
+ |
+
';
$cls = 'row2';
while($r = $db->fetchrow()) {
@@ -658,23 +682,18 @@
// Action taken
echo '';
// Some of these are sanitized at insert-time. Others follow the newer Enano policy of stripping HTML at runtime.
- if ($r['action']=='prot') echo 'Protected page | Reason: ' . $r['edit_summary'];
- elseif($r['action']=='unprot') echo 'Unprotected page | Reason: ' . $r['edit_summary'];
- elseif($r['action']=='semiprot') echo 'Semi-protected page | Reason: ' . $r['edit_summary'];
- elseif($r['action']=='rename') echo 'Renamed page | Old title: '.htmlspecialchars($r['edit_summary']);
- elseif($r['action']=='create') echo 'Created page | ';
- elseif($r['action']=='delete') echo 'Deleted page | Reason: ' . $r['edit_summary'];
- elseif($r['action']=='reupload') echo 'Uploaded new file version | Reason: '.htmlspecialchars($r['edit_summary']);
+ if ($r['action']=='prot') echo $lang->get('history_log_protect') . ' | ' . $lang->get('history_extra_reason') . ' ' . $r['edit_summary'];
+ elseif($r['action']=='unprot') echo $lang->get('history_log_unprotect') . ' | ' . $lang->get('history_extra_reason') . ' ' . $r['edit_summary'];
+ elseif($r['action']=='semiprot') echo $lang->get('history_log_semiprotect') . ' | ' . $lang->get('history_extra_reason') . ' ' . $r['edit_summary'];
+ elseif($r['action']=='rename') echo $lang->get('history_log_rename') . ' | ' . $lang->get('history_extra_oldtitle') . ' '.htmlspecialchars($r['edit_summary']);
+ elseif($r['action']=='create') echo $lang->get('history_log_create') . ' | ';
+ elseif($r['action']=='delete') echo $lang->get('history_log_delete') . ' | ' . $lang->get('history_extra_reason') . ' ' . $r['edit_summary'];
+ elseif($r['action']=='reupload') echo $lang->get('history_log_uploadnew') . ' | ' . $lang->get('history_extra_reason') . ' '.htmlspecialchars($r['edit_summary']);
echo ' | ';
// Actions!
- echo 'View user contribs | ';
- echo 'Revert action | ';
-
- //echo '(rollback) ' . $r['date_string'] . ' ' . $r['author'] . ' (Userpage, Contrib): ';
-
- if($r['minor_edit']) echo ' - minor edit';
- echo '
';
+ echo '' . $lang->get('history_action_contrib') . ' | ';
+ echo '' . $lang->get('history_action_revert') . ' | ';
echo '';
}
@@ -897,6 +916,7 @@
function comments_raw($page_id, $namespace, $action = false, $flags = Array(), $_ob = '')
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
$pname = $paths->nslist[$namespace] . $page_id;
@@ -937,8 +957,8 @@
$q = 'UPDATE ' . table_prefix.'comments SET approved=' . $a . ' WHERE page_id=\'' . $page_id . '\' AND namespace=\'' . $namespace . '\' AND ' . $where . ';';
$e=$db->sql_query($q);
if(!$e) die('alert(unesape(\''.rawurlencode('Error during query: '.mysql_error().'\n\nQuery:\n' . $q) . '\'));');
- if($a=='1') $v = 'Unapprove';
- else $v = 'Approve';
+ if($a=='1') $v = $lang->get('comment_btn_mod_unapprove');
+ else $v = $lang->get('comment_btn_mod_approve');
echo 'document.getElementById("mdgApproveLink'.intval($_GET['id']).'").innerHTML="' . $v . '";';
break;
}
@@ -966,22 +986,32 @@
WHERE page_id=\'' . $page_id . '\'
AND namespace=\'' . $namespace . '\' ORDER BY c.time ASC;');
if(!$lq) _die('The comment text data could not be selected. '.mysql_error());
- $_ob .= 'Article Comments
';
+ $_ob .= '' . $lang->get('comment_heading') . '
';
+
$n = ( $session->get_permissions('mod_comments')) ? $db->numrows() : $num_app;
- if($n==1) $s = 'is ' . $n . ' comment'; else $s = 'are ' . $n . ' comments';
- if($n < 1)
+
+ $subst = array(
+ 'num_comments' => $n,
+ 'page_type' => '<FIXME> whatever'
+ );
+
+ $_ob .= '';
+ $_ob .= ( $n == 0 ) ? $lang->get('comment_msg_count_zero', $subst) : ( $n == 1 ? $lang->get('comment_msg_count_one', $subst) : $lang->get('comment_msg_count_plural', $subst) );
+
+ if ( $session->get_permissions('mod_comments') && $num_unapp > 0 )
{
- $_ob .= '
There are currently no comments on this '.strtolower($namespace).'';
- if($namespace != 'Article') $_ob .= ' page';
- $_ob .= '.
';
- } else $_ob .= 'There ' . $s . ' on this article.';
- if($session->get_permissions('mod_comments') && $num_unapp > 0) $_ob .= ' ' . $num_unapp . ' of those are unapproved.';
- elseif(!$session->get_permissions('mod_comments') && $num_unapp > 0) { $u = ($num_unapp == 1) ? "is $num_unapp comment" : "are $num_unapp comments"; $_ob .= ' However, there ' . $u . ' awating approval.'; }
+ $_ob .= ' ' . $lang->get('comment_msg_count_unapp_mod', array( 'num_unapp' => $num_unapp )) . '';
+ }
+ else if ( !$session->get_permissions('mod_comments') && $num_unapp > 0 )
+ {
+ $ls = ( $num_unapp == 1 ) ? 'comment_msg_count_unapp_one' : 'comment_msg_count_unapp_plural';
+ $_ob .= ' ' . $lang->get($ls, array( 'num_unapp' => $num_unapp )) . '';
+ }
$_ob .= '
';
$list = 'list = { ';
// _die(htmlspecialchars($ttext));
$i = -1;
- while($row = $db->fetchrow($lq))
+ while ( $row = $db->fetchrow($lq) )
{
$i++;
$strings = Array();
@@ -995,14 +1025,14 @@
// Determine the name, and whether to link to the user page or not
$name = '';
- if($row['user_id'] > 0) $name .= '';
+ if($row['user_id'] > 1) $name .= '';
$name .= $row['name'];
- if($row['user_id'] > 0) $name .= '';
+ if($row['user_id'] > 1) $name .= '';
$strings['NAME'] = $name; unset($name);
// Subject
$s = $row['subject'];
- if(!$row['approved']) $s .= ' (Unapproved)';
+ if(!$row['approved']) $s .= ' ' . $lang->get('comment_msg_note_unapp') . '';
$strings['SUBJECT'] = $s;
// Date and time
@@ -1013,16 +1043,17 @@
{
default:
case USER_LEVEL_GUEST:
- $l = 'Guest';
+ $l = $lang->get('user_type_guest');
break;
case USER_LEVEL_MEMBER:
- $l = 'Member';
+ case USER_LEVEL_CHPREF:
+ $l = $lang->get('user_type_member');
break;
case USER_LEVEL_MOD:
- $l = 'Moderator';
+ $l = $lang->get('user_type_mod');
break;
case USER_LEVEL_ADMIN:
- $l = 'Administrator';
+ $l = $lang->get('user_type_admin');
break;
}
$strings['USER_LEVEL'] = $l; unset($l);
@@ -1033,10 +1064,10 @@
if($session->get_permissions('edit_comments'))
{
// Edit link
- $strings['EDIT_LINK'] = 'edit';
+ $strings['EDIT_LINK'] = '' . $lang->get('comment_btn_edit') . '';
// Delete link
- $strings['DELETE_LINK'] = 'delete';
+ $strings['DELETE_LINK'] = '' . $lang->get('comment_btn_delete') . '';
}
else
{
@@ -1048,19 +1079,19 @@
}
// Send PM link
- $strings['SEND_PM_LINK'] = ( $session->user_logged_in && $row['user_id'] > 0 ) ? 'Send private message
' : '';
+ $strings['SEND_PM_LINK'] = ( $session->user_logged_in && $row['user_id'] > 1 ) ? '' . $lang->get('comment_btn_send_privmsg') . '
' : '';
// Add Buddy link
- $strings['ADD_BUDDY_LINK'] = ( $session->user_logged_in && $row['user_id'] > 0 ) ? 'Add to buddy list' : '';
+ $strings['ADD_BUDDY_LINK'] = ( $session->user_logged_in && $row['user_id'] > 1 ) ? '' . $lang->get('comment_btn_add_buddy') . '' : '';
// Mod links
$applink = '';
$applink .= '';
- if($row['approved']) $applink .= 'Unapprove';
- else $applink .= 'Approve';
+ if($row['approved']) $applink .= $lang->get('comment_btn_mod_unapprove');
+ else $applink .= $lang->get('comment_btn_mod_approve');
$applink .= '';
$strings['MOD_APPROVE_LINK'] = $applink; unset($applink);
- $strings['MOD_DELETE_LINK'] = 'Delete';
+ $strings['MOD_DELETE_LINK'] = '' . $lang->get('comment_btn_mod_delete') . '';
// Signature
$strings['SIGNATURE'] = '';
@@ -1078,32 +1109,31 @@
}
if(getConfig('comments_need_login') != '2' || $session->user_logged_in)
{
- if(!$session->get_permissions('post_comments'))
- {
- $_ob .= 'Got something to say?
Access to post comments on this page is denied.
';
- }
- else
+ if($session->get_permissions('post_comments'))
{
- $_ob .= 'Got something to say?
If you have comments or suggestions on this article, you can shout it out here.';
- if(getConfig('approve_comments')=='1') $_ob .= ' Before your comment will be visible to the public, a moderator will have to approve it.';
- if(getConfig('comments_need_login') == '1' && !$session->user_logged_in) $_ob .= ' Because you are not logged in, you will need to enter a visual confirmation before your comment will be posted.';
+ $_ob .= '' . $lang->get('comment_postform_title') . '
';
+ $_ob .= $lang->get('comment_postform_blurb');
+ if(getConfig('approve_comments')=='1') $_ob .= ' ' . $lang->get('comment_postform_blurb_unapp');
+ if(getConfig('comments_need_login') == '1' && !$session->user_logged_in)
+ {
+ $_ob .= ' ' . $lang->get('comment_postform_blurb_captcha');
+ }
$sn = $session->user_logged_in ? $session->username . '' : '';
- $_ob .= '
+ $_ob .= '
';
@@ -1818,6 +1848,7 @@
function pagediff($page_id, $namespace, $id1, $id2)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
if(!$session->get_permissions('history_view'))
return 'Access denied';
if(!preg_match('#^([0-9]+)$#', (string)$id1) ||
@@ -1836,7 +1867,7 @@
$time1 = date('F d, Y h:i a', $id1);
$time2 = date('F d, Y h:i a', $id2);
$_ob = "
- Comparing revisions: {$time1} → {$time2}
+ " . $lang->get('history_lbl_comparingrevisions') . " {$time1} → {$time2}
";
// Free some memory
unset($row1, $row2, $q1, $q2);
diff -r 30b857a6b811 -r 1316404e4ea8 index.php
--- a/index.php Sun Oct 28 19:57:29 2007 -0400
+++ b/index.php Sun Oct 28 21:19:36 2007 -0400
@@ -89,11 +89,12 @@
if(!$q) $db->_die('The comment data could not be selected.');
$row = $db->fetchrow();
$db->free_result();
+ $row['subject'] = str_replace('\'', ''', $row['subject']);
echo '';
break;
diff -r 30b857a6b811 -r 1316404e4ea8 language/english/enano.json
--- a/language/english/enano.json Sun Oct 28 19:57:29 2007 -0400
+++ b/language/english/enano.json Sun Oct 28 21:19:36 2007 -0400
@@ -17,15 +17,19 @@
var enano_lang = {
categories: [
- 'adm', 'meta', 'user', 'page', 'comment', 'onpage', 'etc'
+ 'adm', 'meta', 'user', 'page', 'comment', 'onpage', 'etc', 'editor', 'history',
],
strings: {
meta: {
+ adm: 'Administration panel nav menu',
meta: 'Language category strings',
user: 'Login, logout, and authentication',
page: 'Page creation and control',
comment: 'Comment display',
onpage: 'On-page controls',
+ etc: 'Miscellaneous strings',
+ editor: 'Page editor interface',
+ history: 'Page history and log viewer',
plural: 's'
},
user: {
@@ -150,6 +154,7 @@
postform_title: 'Got something to say?',
postform_blurb: 'If you have comments or suggestions on this article, you can shout it out here.',
postform_blurb_unapp: 'Before your post will be visible to the public, a moderator will have to approve it.',
+ postform_blurb_captcha: 'Because you are not logged in, you will need to enter a visual confirmation before your comment will be posted.',
postform_blurb_link: 'Leave a comment...',
postform_field_name: 'Your name/screen name:',
postform_field_subject: 'Comment subject:',
@@ -157,6 +162,8 @@
postform_field_captcha_title: 'Visual confirmation:',
postform_field_captcha_blurb: 'Please enter the confirmation code seen in the image on the right into the box. If you cannot read the code, please click on the image to generate a new one. This helps to prevent automated bot posting.',
postform_field_captcha_label: 'Confirmation code:',
+ postform_field_captcha_cantread_js: 'If you can\'t read the code, click on the image to generate a new one.',
+ postform_field_captcha_cantread_nojs: 'If you can\'t read the code, please refresh this page to generate a new one.',
postform_btn_submit: 'Submit comment',
},
adm: {
@@ -194,12 +201,57 @@
btn_keepalive_about: 'About keep-alive',
btn_keepalive_loading: 'Loading keep-alive button...'
},
- admhome: {
+ editor: {
+ msg_revert_confirm: 'Do you really want to revert your changes?',
+ msg_discard_confirm: 'Do you really want to discard your changes?',
+ msg_unload: 'If you do, any changes that you have made to this page will be lost.',
+ btn_graphical: 'graphical editor',
+ btn_wikitext: 'wikitext editor',
+ lbl_edit_summary: 'Edit summary:',
+ lbl_minor_edit: 'This is a minor edit',
+ btn_save: 'Save changes',
+ btn_preview: 'Show preview',
+ btn_revert: 'Revert changes',
+ btn_cancel: 'Cancel and return to page',
+ btn_closeviewer: 'Close viewer',
+ },
+ history: {
+ summary_clearlogs: 'Automatic backup created when logs were purged',
+ page_subtitle: 'History of edits and actions',
+ heading_edits: 'Edits:',
+ heading_other: 'Other changes:',
+ no_entries: 'No history entries in this category.',
+ btn_compare: 'Compare selected revisions',
+ col_diff: 'Diff',
+ col_datetime: 'Date/time',
+ col_user: 'User',
+ col_summary: 'Edit summary',
+ col_minor: 'Minor',
+ col_actions: 'Actions',
+ col_action_taken: 'Action taken',
+ col_extra: 'Extra info',
+ extra_reason: 'Reason:',
+ extra_oldtitle: 'Old title:',
+ tip_rdns: 'Click cell background for reverse DNS info',
+ action_view: 'View',
+ action_contrib: 'User contribs',
+ action_restore: 'Restore',
+ action_revert: 'Revert action',
+ log_protect: 'Protected page',
+ log_unprotect: 'Unprotected page',
+ log_semiprotect: 'Semi-protected page',
+ log_rename: 'Renamed page',
+ log_create: 'Created page',
+ log_delete: 'Deleted page',
+ log_uploadnew: 'Uploaded new file version',
+ lbl_comparingrevisions: 'Comparing revisions:',
},
etc: {
redirect_title: 'Redirecting...',
redirect_body: 'Please wait while you are redirected.',
redirect_timeout: 'If you are not redirected within %timeout% seconds, please click here.',
+ // Generic "Save Changes" button
+ save_changes: 'Save changes',
},
}
};