From cf38360f584a664d18d83d7b37ebaf69ab273fa8 Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 3 Sep 2002 13:11:40 +0000 Subject: [PATCH] Language fixes, added english strings etc --- admin/site.php | 2 +- course/lib.php | 2 +- course/teacher.php | 31 ++++++++++++++-------- index.php | 2 +- lang/en/forum.php | 16 ++++++++++++ lang/en/moodle.php | 16 +++++++++++- login/forgot_password_form.html | 2 +- login/index.php | 6 ++--- mod/forum/lib.php | 2 +- mod/forum/post.php | 46 +++++++++++++++++---------------- 10 files changed, 83 insertions(+), 42 deletions(-) diff --git a/admin/site.php b/admin/site.php index 4db51968342..057565453d0 100644 --- a/admin/site.php +++ b/admin/site.php @@ -65,7 +65,7 @@ "wwwroot/admin/\">$stradmin -> $strsitesettings", "$focus"); print_simple_box_start("center", "", "$THEME->cellheading"); - print_heading("Editing site settings"); + print_heading($strsitesettings); include("site.html"); print_simple_box_end(); print_footer(); diff --git a/course/lib.php b/course/lib.php index dbc5460d38f..e367527c856 100644 --- a/course/lib.php +++ b/course/lib.php @@ -197,7 +197,7 @@ function print_all_courses($cat=1, $style="full", $maxcount=999) { } } else { - echo "

No courses have been defined yet

"; + echo "

".get_string("nocoursesyet")."

"; } } diff --git a/course/teacher.php b/course/teacher.php index e9221f4906b..99d53495e6d 100644 --- a/course/teacher.php +++ b/course/teacher.php @@ -18,6 +18,15 @@ $strassignteachers = get_string("assignteachers"); $stradministration = get_string("administration"); + $strexistingteachers = get_string("existingteachers"); + $strnoexistingteachers = get_string("noexistingteachers"); + $strpotentialteachers = get_string("potentialteachers"); + $strnopotentialteachers = get_string("nopotentialteachers"); + $straddteacher = get_string("addteacher"); + $strremoveteacher = get_string("removeteacher"); + $strsearch = get_string("search"); + $strsearchagain = get_string("searchagain"); + $strtoomanytoshow = get_string("toomanytoshow"); if (!$id) { print_header("$site->fullname: $strassignteachers", "$site->fullname", @@ -25,7 +34,7 @@ if ($courses = get_records_sql("SELECT * from course WHERE category > 0 ORDER BY fullname")) { - print_heading("Choose a course to add teachers to"); + print_heading(get_string("choosecourse")); print_simple_box_start("CENTER"); foreach ($courses as $course) { echo "id\">$course->fullname
"; @@ -111,17 +120,17 @@ /// Print the lists of existing and potential teachers echo ""; - echo ""; + echo ""; echo "
Existing TeachersPotential Teachers
$strexistingteachers$strpotentialteachers
"; /// First, show existing teachers for this course if (! $teachers) { - echo "

No existing teachers"; + echo "

$strnoexistingteachers"; } else { foreach ($teachers as $teacher) { - echo "

$teacher->firstname $teacher->lastname, $teacher->email    id&remove=$teacher->id\" TITLE=\"Remove teacher\">

"; + echo "

$teacher->firstname $teacher->lastname, $teacher->email    id&remove=$teacher->id\" TITLE=\"$strremoveteacher\">

"; } } @@ -134,10 +143,10 @@ AND (firstname LIKE '%$search%' OR lastname LIKE '%$search%' OR email LIKE '%$search%') - AND username <> 'guest'"); + AND username <> 'guest' AND username <> 'changeme'"); } else { $users = get_records_sql("SELECT * from user WHERE confirmed = 1 - AND username <> 'guest'"); + AND username <> 'guest' AND username <> 'changeme'"); } @@ -155,22 +164,22 @@ } if (! $potential) { - echo "

No potential teachers"; + echo "

$strnopotentialteachers"; if ($search) { echo "

"; echo "id\">"; echo ""; - echo ""; + echo ""; echo "
"; } } else { if ($search) { - echo "

(Search results)

"; + echo "

($strsearchresults)

"; } if (count($potential) <= 20) { foreach ($potential as $user) { - echo "

id&add=$user->id\" TITLE=\"Add teacher\">  $user->firstname $user->lastname, $user->email"; + echo "

id&add=$user->id\" TITLE=\"$straddteacher\">  $user->firstname $user->lastname, $user->email"; } } else { echo "

There are too many users to show.
"; @@ -178,7 +187,7 @@ echo "

"; echo "id\">"; echo ""; - echo ""; + echo ""; echo "
"; } } diff --git a/index.php b/index.php index 4174ba821a9..9b9b54e5dc5 100644 --- a/index.php +++ b/index.php @@ -52,7 +52,7 @@ if (isediting($site->id)) { echo "
"; popup_form("$CFG->wwwroot/course/mod.php?id=$site->id§ion=0&add=", - $modnames, "section0", "", "Add..."); + $modnames, "section0", "", get_string("add")."..."); echo "
"; } diff --git a/lang/en/forum.php b/lang/en/forum.php index b6885f92c5c..458eae78030 100644 --- a/lang/en/forum.php +++ b/lang/en/forum.php @@ -14,13 +14,22 @@ $string[anyfile] = "Any file"; $string[attachment] = "Attachment"; $string[bynameondate] = "by \$a->name - \$a->date"; $string[canstudentsstart] = "Can a \$a start new discussions?"; +$string[couldnotadd] = "Could not add your post due to an unknown error"; +$string[couldnotdeleteratings] = "Sorry, that cannot be deleted as people have already rated it"; +$string[couldnotdeletereplies] = "Sorry, that cannot be deleted as people have already responded to it"; +$string[couldnotupdate] = "Could not update your post due to an unknown error"; $string[delete] = "Delete"; +$string[deleteddiscussion] = "The discussion topic has been deleted"; +$string[deletedpost] = "The post has been deleted"; +$string[deletesure] = "Are you sure you want to delete this post?"; $string[discussion] = "Discussion"; $string[discussions] = "Discussions"; $string[discussionsstartedby] = "Discussions started by \$a"; $string[discussthistopic] = "Discuss this topic"; $string[eachuserforum] = "Each person posts one discussion"; $string[edit] = "Edit"; +$string[editing] = "Editing"; +$string[emptymessage] = "Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved."; $string[everyonecanchoose] = "Everyone can choose to be subscribed"; $string[everyoneissubscribed] = "Everyone is subscribed to this forum"; $string[forcesubscribe] = "Force everyone to be subscribed"; @@ -37,6 +46,7 @@ $string[intronews] = "General news and announcements"; $string[introsocial] = "An open forum for chatting about anything you want to"; $string[introteacher] = "A forum for teacher-only notes and discussion"; $string[learningforums] = "Learning forums"; +$string[maxtimehaspassed] = "Sorry, but the maximum time for editing this post (\$a) has passed!"; $string[message] = "Message"; $string[modeflatoldestfirst] = "Display replies flat, with oldest first"; $string[modeflatnewestfirst] = "Display replies flat, with newest first"; @@ -47,6 +57,7 @@ $string[namenews] = "News forum"; $string[namesocial] = "Social forum"; $string[nameteacher] = "Teacher forum"; $string[nodiscussions] = "There are no discussion topics yet in this forum"; +$string[noguestpost] = "Sorry, guests are not allowed to post"; $string[noposts] = "No posts"; $string[nosubscribers] = "There are no subscribers yet for this forum"; $string[nownotsubscribed] = "\$a->name will NOT receive copies of '\$a->forum' by email."; @@ -54,6 +65,7 @@ $string[nowsubscribed] = "\$a->name will receive copies of '\$a->forum' by email $string[numposts] = "\$a posts"; $string[olderdiscussions] = "Older discussions"; $string[parentofthispost] = "Parent of this post"; +$string[postadded] = "Your post was successfully added.

You have \$a to edit it if you want to make any changes."; $string[postmailinfo] = "This is a copy of a message posted on the \$a website. To add your reply via the website, click on this link:"; @@ -74,10 +86,12 @@ While writing: $string[postrating1] = "Shows mostly SEPARATE knowing"; $string[postrating2] = "Equally separate and connected"; $string[postrating3] = "Shows mostly CONNECTED knowing"; +$string[postupdated] = "Your post was updated"; $string[processingpost] = "Processing post \$a"; $string[rate] = "Rate"; $string[ratings] = "Ratings"; $string[readtherest] = "Read the rest of this topic"; +$string[re] = "Re:"; // Put in front of subjects that are replies to another post $string[repliesmany] = "\$a replies so far"; $string[repliesone] = "\$a reply so far"; $string[reply] = "Reply"; @@ -93,5 +107,7 @@ $string[subscribers] = "Subscribers"; $string[subscribersto] = "Subscribers to '\$a'"; $string[unsubscribe] = "Unsubscribe from this forum"; $string[youratedthis] = "You rated this"; +$string[yournewtopic] = "Your new discussion topic"; +$string[yourreply] = "Your reply"; ?> diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 91e3e7c4d32..37046e51cb9 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -11,6 +11,7 @@ $string[addinganewto] = "Adding a new \$a->what to \$a->to"; $string[addnewcourse] = "Add a new course"; $string[addnewuser] = "Add a new user"; $string[address] = "Address"; +$string[addteacher] = "Add teacher"; $string[admin] = "Admin"; $string[administration] = "Administration"; $string[again] = "again"; @@ -29,6 +30,8 @@ $string[category] = "Category"; $string[changepassword] = "Change password"; $string[changedpassword] = "Changed password"; $string[changessaved] = "Changes saved"; +$string[checklanguage] = "Check language (\$a)"; +$string[checklanguagediff] = "The following differences were found between the current language and English:"; $string[choose] = "Choose"; $string[choosecourse] = "Choose a course"; $string[chooselivelogs] = "Or watch current activity"; @@ -117,6 +120,7 @@ $string[enrolmentkeyhint] = "That enrolment key was incorrect, please try again< $string[entercourse] = "Click to enter this course"; $string[enteremailaddress] = "Enter in your email address to reset your password and have the new password sent to you via email."; +$string[existingteachers] = "Existing teachers"; $string[error] = "Error"; $string[feedback] = "Feedback"; $string[files] = "Files"; @@ -148,10 +152,12 @@ GNU General Public License for more details: http://www.gnu.org/copyleft/gpl.html"; $string[grade] = "Grade"; +$string[guestskey] = "Allow guests who have the key"; $string[guestsno] = "Do not allow guests in"; $string[guestsnotallowed] = "Sorry, '\$a' does not allow guests to enter."; $string[guestsyes] = "Allow guests without the key"; -$string[guestskey] = "Allow guests who have the key"; +$string[guestuser] = "Guest User"; +$string[guestuserinfo] = "This user is a special user that allows read-only access to some courses."; $string[help] = "Help"; $string[helppicture] = "How to upload a picture"; $string[helptext] = "How to write text"; @@ -268,7 +274,9 @@ $string[newsitems] = "news items"; $string[newsitemsnumber] = "News items to show"; $string[no] = "No"; $string[nocoursesyet] = "There are no courses yet"; +$string[noexistingteachers] = "No existing teachers"; $string[nograde] = "No grade"; +$string[nopotentialteachers] = "No potential teachers"; $string[nostudentsyet] = "No students enrolled in this course yet"; $string[nosuchemail] = "No such email address"; $string[noteachersyet] = "No teachers in this course yet"; @@ -299,17 +307,22 @@ $string[passwordsenttext] = " $string[people] = "People"; $string[personalprofile] = "Personal profile"; $string[phone] = "Phone"; +$string[potentialteachers] = "Potential teachers"; $string[preview] = "Preview"; $string[previeworchoose] = "Preview or choose a theme"; $string[question] = "Question"; $string[readme] = "README"; // This is a file name $string[recentactivity] = "Recent activity"; +$string[removeteacher] = "Remove teacher"; $string['rename'] = "Rename"; $string[resources] = "Resources"; $string[returningtosite] = "Returning to this web site?"; $string[requireskey] = "This course requires an enrolment key"; $string[revert] = "Revert"; $string[savechanges] = "Save changes"; +$string[search] = "Search"; +$string[searchagain] = "Search again"; +$string[searchresults] = "Search results"; $string[section] = "Section"; $string[selectacountry] = "Select a country"; $string[senddetails] = "Send my details via email"; @@ -348,6 +361,7 @@ $string[theme] = "Theme"; $string[themesaved] = "New theme saved"; $string[today] = "Today"; $string[todaylogs] = "Today's logs"; +$string[toomanytoshow] = "There are too many users to show"; $string[topic] = "Topic"; $string[topicoutline] = "Topic outline"; $string[turneditingoff] = "Turn editing off"; diff --git a/login/forgot_password_form.html b/login/forgot_password_form.html index 8a1b2d2ae24..0a745ae20d6 100644 --- a/login/forgot_password_form.html +++ b/login/forgot_password_form.html @@ -15,7 +15,7 @@

"> - + " onClick="javascript: history.go(-1)">
diff --git a/login/index.php b/login/index.php index d9ddbe33253..348882116ab 100644 --- a/login/index.php +++ b/login/index.php @@ -6,10 +6,10 @@ if (! record_exists("user", "username", "guest")) { $guest->username = "guest"; $guest->password = md5("guest"); - $guest->firstname = "Guest"; - $guest->lastname = "User"; + $guest->firstname = get_string("guestuser"); + $guest->lastname = " "; $guest->email = "root@localhost"; - $guest->description = "This user is a special user that allows read-only access to some courses."; + $guest->description = get_string("guestuserinfo"); $guest->confirmed = 1; $guest->timemodified= time(); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 127167dd3fb..2f27c45c584 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -127,7 +127,7 @@ function forum_make_mail_post(&$post, $user, $touser, $course, if ($ownpost) { $output .= "wwwroot/mod/forum/post.php?delete=$post->id\">".get_string("delete", "forum").""; if ($reply) { - $output .= "| wwwroot/mod/forum/post.php?reply=$post->id\">".get_string("reply", "forum").""; + $output .= " | wwwroot/mod/forum/post.php?reply=$post->id\">".get_string("reply", "forum").""; } $output .= "  "; } else { diff --git a/mod/forum/post.php b/mod/forum/post.php index c8b2683d9f7..c0842eb81b3 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -7,7 +7,7 @@ require("lib.php"); if (isguest()) { - error("Guests are not allowed to post.", $HTTP_REFERER); + error(get_string("noguestpost", "forum"), $HTTP_REFERER); } if (match_referer() && isset($HTTP_POST_VARS)) { // form submitted @@ -19,7 +19,7 @@ $post->attachment = $HTTP_POST_FILES["attachment"]; if (!$post->subject and !$post->message) { - error("Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved."); + error(get_string("emptymessage", "forum")); } require_login(); @@ -28,9 +28,9 @@ $post->id = $post->edit; if (forum_update_post($post)) { add_to_log($post->course, "forum", "update post", "discuss.php?d=$post->discussion&parent=$post->id", "$post->id"); - redirect(forum_go_back_to("discuss.php?d=$post->discussion"), "Your post was updated", 1); + redirect(forum_go_back_to("discuss.php?d=$post->discussion"), get_string("postupdated", "forum"), 1); } else { - error("Could not update your post due to an unknown error"); + error(get_string("couldnotupdate", "forum")); } } else if ($post->discussion) { // Adding a new post to an existing discussion @@ -41,9 +41,9 @@ add_to_log($post->course, "forum", "add post", "discuss.php?d=$post->discussion&parent=$post->id", "$post->id"); redirect(forum_go_back_to("discuss.php?d=$post->discussion"), - "Your post was successfully added.

You have ".format_time($CFG->maxeditingtime)." to edit it if you want to make any changes.", 3); + get_string("postadded", "forum", format_time($CFG->maxeditingtime)), 3); } else { - error("Could not add the post due to an unknown error"); + error(get_string("couldnotadd", "forum")); } } else { // Adding a new discussion $discussion = $post; @@ -55,9 +55,9 @@ } add_to_log($post->course, "forum", "add discussion", "discuss.php?d=$discussion->id", "$discussion->id"); redirect(forum_go_back_to("view.php?f=$post->forum"), - "Your post was successfully added.

You have ".format_time($CFG->maxeditingtime)." to edit it if you want to make any changes.", 5); + get_string("postadded", "forum", format_time($CFG->maxeditingtime)), 3); } else { - error("Could not insert the new discussion."); + error(get_string("couldnotadd", "forum")); } } die; @@ -117,8 +117,9 @@ $post->user = $USER->id; $post->message = ""; - if (!(substr($post->subject, 0, 3) == "Re:")) { - $post->subject = "Re: ".$post->subject; + $strre = get_string("re", "forum"); + if (!(substr($post->subject, 0, 3) == $strre)) { + $post->subject = "$strre $post->subject"; } forum_set_return(); @@ -132,7 +133,7 @@ error("You can't edit other people's posts!"); } if ((time() - $post->created) > $CFG->maxeditingtime) { - error("Sorry, but the maximum time for editing this post (".format_time($CFG->maxeditingtime).") has passed!"); + error( get_string("maxtimehaspassed", "forum", format_time($CFG->maxeditingtime)) ); } if ($post->parent) { if (! $parent = forum_get_post_full($post->parent)) { @@ -177,12 +178,11 @@ if (isset($confirm)) { // User has confirmed the delete if ($post->totalscore) { - notice("Sorry, that cannot be deleted as people have already rated it", + notice(get_string("couldnotdeleteratings", "forum"), forum_go_back_to("discuss.php?d=$post->discussion")); } else if (record_exists("forum_posts", "parent", $delete)) { - error("Sorry, that cannot be deleted as people have - already responded to it", + error(get_string("couldnotdeletereplies", "forum"), forum_go_back_to("discuss.php?id=$post->discussion")); } else { @@ -195,13 +195,13 @@ add_to_log($discussion->course, "forum", "delete discussion", "view.php?id=$discussion->forum", "$post->id"); redirect("view.php?f=$discussion->forum", - "The discussion topic has been deleted", 1); + get_string("deleteddiscussion", "forum"), 1); } else if (forum_delete_post($post)) { add_to_log($discussion->course, "forum", "delete post", "discuss.php?d=$post->discussion", "$post->id"); redirect(forum_go_back_to("discuss.php?d=$post->discussion"), - "The post has been deleted", 1); + get_string("deletedpost", "forum"), 1); } else { error("An error occurred while deleting record $post->id"); } @@ -213,7 +213,7 @@ forum_set_return(); print_header(); - notice_yesno("Are you sure you want to delete this post?", + notice_yesno(get_string("deletesure", "forum"), "post.php?delete=$delete&confirm=$delete", $HTTP_REFERER); @@ -245,7 +245,7 @@ error("Could not find top parent of post $post->id"); } } else { - $toppost->subject = "New discussion topic"; + $toppost->subject = get_string("yournewtopic", "forum"); } if ($post->subject) { @@ -255,12 +255,14 @@ } if ($post->parent) { - $navtail = "id\">$toppost->subject -> Editing"; + $navtail = "id\">$toppost->subject -> ".get_string("editing", "forum"); } else { $navtail = "$toppost->subject"; } - $navmiddle = "id\">Forums -> id\">$forum->name"; + $strforums = get_string("modulenameplural", "forum"); + + $navmiddle = "id\">$strforums -> id\">$forum->name"; if ($course->category) { print_header("$course->shortname: $discussion->name: $toppost->subject", "$course->fullname", @@ -275,9 +277,9 @@ echo "

"; if (isset($parent)) { forum_print_post($parent, $course->id, $ownpost=false, $reply=false, $link=false); - echo "

Your reply:

"; + echo "

".get_string("yourreply", "forum").":

"; } else { - echo "

Your new discussion topic:

"; + echo "

".get_string("yournewtopic", "forum")."

"; } echo "
";