From fa0626c6f4233757d0fb18cc4b0e2f2c90b53810 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 4 Jul 2002 07:52:06 +0000 Subject: [PATCH] Language-related fixes --- config-dist.php | 11 +++++- course/view.php | 16 +++++--- lang/en/strings.php | 85 ++++++++++++++++++++++++++++++++++------ lib/setup.php | 2 +- login/index.php | 14 +++---- login/index_confirm.html | 21 ++-------- login/index_form.html | 43 ++++++-------------- user/edit.html | 55 +++++++++++++------------- user/edit.php | 1 + user/index.php | 27 +++++++------ user/view.php | 35 +++++++++-------- 11 files changed, 179 insertions(+), 131 deletions(-) diff --git a/config-dist.php b/config-dist.php index 0ab586b10c..40b87882f9 100644 --- a/config-dist.php +++ b/config-dist.php @@ -59,10 +59,17 @@ $CFG->dataroot = "/home/moodledata"; $CFG->theme = "standard"; -// Choose a sitewide language - this will affect navigation, help etc +// Choose a sitewide language - this will affect text, buttons etc // See lib/languages.php for a full list of standard language codes. -$CFG->lang = "en"; +$CFG->lang = "en"; + +// Choose a sitewide locale - this will affect the display of dates +// You need to have this locale data installed on your operating +// system. If you don't know what to choose try using the same +// string as the language. + +$CFG->locale = "en"; // Give the full names of local SMTP servers that Moodle should use to diff --git a/course/view.php b/course/view.php index 766a52aa88..85f5c52647 100644 --- a/course/view.php +++ b/course/view.php @@ -31,7 +31,9 @@ redirect("$CFG->wwwroot"); } - print_header("Course: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true, + $courseword = get_string("course"); + + print_header("$courseword: $course->fullname", "$course->fullname", "$course->shortname", "search.search", "", true, update_course_icon($course->id)); if (! $modtypes = get_records_sql_menu("SELECT name,fullname FROM modules ORDER BY fullname") ) { @@ -72,15 +74,19 @@ function make_editing_buttons($moduleid) { + $delete = get_string("delete"); + $moveup = get_string("moveup"); + $movedown = get_string("movedown"); + $update = get_string("update"); return "    Delete + SRC=../pix/t/delete.gif BORDER=0 ALT=\"$delete\"> \"Move + SRC=../pix/t/up.gif BORDER=0 ALT=\"$moveup\"> \"Move + SRC=../pix/t/down.gif BORDER=0 ALT=\"$movedown\"> Update"; + SRC=../pix/t/edit.gif BORDER=0 ALT=\"$update\">"; } function print_side_block($heading="", $list=NULL, $footer="", $icons=NULL) { diff --git a/lang/en/strings.php b/lang/en/strings.php index 3551c2a560..edf662201b 100644 --- a/lang/en/strings.php +++ b/lang/en/strings.php @@ -1,30 +1,93 @@ An email should have been sent to your address at \$a +

It contains easy instructions to complete your registration. +

If you continue to have difficulty, contact the site administrator."; $string[entercourse] = "Click to enter this course"; - +$string[firsttime] = "Is this your first time here?"; +$string[forgotten] = "Forgotten your username or password?"; +$string[fullprofile] = "Full profile"; +$string[home] = "Home"; +$string[htmlformat] = "Pretty HTML format"; +$string[icqnumber] = "ICQ number"; +$string[idnumber] = "ID number"; +$string[invalidlogin] = "Invalid login, please try again"; +$string[lastaccess] = "Last access"; +$string[location] = "Location"; $string[loggedinas] = "You are logged in as \$a."; - $string[loggedinnot] = "You are not logged in."; - $string[login] = "Login"; - +$string[loginas] = "Login as"; +$string[loginguest] = "Login as a guest"; +$string[loginsite] = "Login to the site"; +$string[loginusing] = "Login using your username and password"; +$string[loginsteps] = " + Hi! For full access to courses you'll need to take a minute to create + a new account for yourself on this web site. + Each of the individual courses may also have a one-time + "enrolment key", which you won't need until later. Here are + the steps: +

    +
  1. Fill out the New Account form with your details. +
  2. An email will be immediately sent to your email address. +
  3. Read your email, and click on the web link it contains. +
  4. Your account will be confirmed and you will be logged in. +
  5. Now, select the course you want to participate in. +
  6. If you are prompted for a "enrolment key" - use the one + that your teacher has given you. This will "enrol" you in the + course. +
  7. You can now access the full course. From now on you will only need + to enter your personal username and password (in the form on this page) + to log in and access any course you have enrolled in. +
"; $string[logout] = "Logout"; - $string[mainmenu] = "Main menu"; - +$string[movedown] = "Move down"; +$string[moveup] = "Move up"; +$string[mustconfirm] = "You need to confirm your login"; +$string[newpicture] = "New picture"; +$string[notenrolled] = "\$a is not enrolled in this course."; +$string[participants] = "Participants"; +$string[password] = "Password"; +$string[personalprofile] = "Personal profile"; +$string[phone] = "Phone"; +$string[returningtosite] = "Returning to this web site?"; +$string[selectacountry] = "Select a country"; +$string[senddetails] = "Send my details via email"; +$string[serverlocaltime] = "Server's local time"; $string[sitelogs] = "Site logs"; - $string[sitenews] = "Site news"; - $string[sitesettings] = "Site settings"; +$string[someallowguest] = "Some courses may allow guest access"; +$string[startsignup] = "Start now by creating a new account!"; +$string[teacheronly] = "for the \$a only"; +$string[textformat] = "Plain text format"; +$string[timezone] = "Timezone"; +$string[todaylogs] = "Today's logs"; +$string[unenrol] = "Unenrol"; +$string[unenrolme] = "Unenrol me from \$a"; +$string[update] = "Update"; +$string[updatemyprofile] = "Update my profile"; +$string[userdescription] = "Description"; +$string[username] = "Username"; +$string[webpage] = "Web page"; ?> diff --git a/lib/setup.php b/lib/setup.php index d72642c952..de7fb49258 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -36,7 +36,7 @@ // Set language/locale of printed times (must be supported by OS) - setlocale ("LC_TIME", $CFG->lang); + setlocale ("LC_TIME", $CFG->locale); // Load up theme variables (colours etc) diff --git a/login/index.php b/login/index.php index fb49395915..ab73b0b7a2 100644 --- a/login/index.php +++ b/login/index.php @@ -28,7 +28,7 @@ if ($user) { if (! $user->confirmed ) { // they never confirmed via email - print_header("Need to confirm", "Not confirmed yet", "", ""); + print_header(get_string("mustconfirm"), get_string("mustconfirm") ); include("index_confirm.html"); die; } @@ -56,16 +56,10 @@ reset_login_count(); - if ($CFG->smsnotify) { - $time = date("H:i D j M", time()); - $smstring = "$time - $USER->firstname $USER->lastname logged in to $CFG->sitename"; - system("echo \"$smstring \" | /opt/bin/sendsms &> /dev/null &"); - } - die; } else { - $errormsg = "Invalid login, please try again"; + $errormsg = get_string("invalidlogin"); } } @@ -82,7 +76,9 @@ $focus = "form.username"; } - print_header("Login to the site", "Login to the site", "Login", $focus); + $loginsite = get_string("loginsite"); + + print_header($loginsite, $loginsite, get_string("login"), $focus); include("index_form.html"); diff --git a/login/index_confirm.html b/login/index_confirm.html index 5a1568b586..e3327aaf04 100644 --- a/login/index_confirm.html +++ b/login/index_confirm.html @@ -1,20 +1,7 @@
- -

Sorry, firstname) ?>, but you can't log in until you have confirmed your registration

- -

Please check your email!

- -

-An email should have been sent to your address at email) ?> - -

-

-It contains easy instructions to complete your registration. -

- -

If you continue to have difficulty, contact the site administrator. - +

+email) ?>
-
-

Home

+

+
diff --git a/login/index_form.html b/login/index_form.html index 17a106682a..89ad7e5cd2 100644 --- a/login/index_form.html +++ b/login/index_form.html @@ -3,15 +3,15 @@
cellheading2?>> -

Returning to this web site?

+

cellheading2?>> -

Is this your first time here?

+

-

Log in using your username and password:
+

:

@@ -20,19 +20,19 @@
- + - +

Username:

:

Password:

:

- + ">
@@ -40,47 +40,30 @@

-

Some courses may allow guest access:

+

:

- + ">

-

Forgotten your username or password?

+

- + ">
-

Hi! For full access to courses you'll need to take a minute to create - a new account for yourself on this web site. - Each of the individual courses may also have a one-time - "enrolment key", which you won't need until later. Here are - the steps:

-
    -
  1. Fill out the New Account form with your details. -
  2. An email will be immediately sent to your email address. -
  3. Read your email, and click on the web link it contains. -
  4. Your account will be confirmed and you will be logged in. -
  5. Now, select the course you want to participate in. -
  6. If you are prompted for a "enrolment key" - use the one - that your teacher has given you. This will "enrol" you in the - course. -
  7. You can now access the full course. From now on you will only need - to enter your personal username and password (in the form on this page) - to log in and access any course you have enrolled in. -
+

- + ">
@@ -89,4 +72,4 @@
-

Home

+

diff --git a/user/edit.html b/user/edit.html index 0d883d82b4..5718a6cedc 100644 --- a/user/edit.html +++ b/user/edit.html @@ -1,83 +1,83 @@
- + - + - + - + - + - + - - + - - + - - + - - + - + - - + - + + - +

New picture:

:

- ( .jpg or .png ) + ( .jpg / .png )

Description:

:

Email address:

:

Email format:

:

mailformat, "") ?>

Web address (URL):

:

ICQ number:

:

ID Number:

(for the only) +

:

Phone number 1:

(for the only) +

1:

Phone number 2:

(for the only) +

2:

Street Address:

(for the only) +

:

City/town:

:

Country:

country, "Select a country...", "", "") ?> +

:

country, get_string("selectacountry")."...", "", "") ?>

Timezone:

:

timezone) > 12) { $user->timezone = 99; @@ -88,22 +88,23 @@ $zone = (float)$tz/2.0; $usertime = $timenow + ($tz * 1800); if ($tz == 0) { - $timezones["$zone"] = gmdate("D, h:i a", $usertime)." (GMT)"; + $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT)"; } else if ($tz < 0) { - $timezones["$zone"] = gmdate("D, h:i a", $usertime)." (GMT$zone)"; + $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT$zone)"; } else { - $timezones["$zone"] = gmdate("D, h:i a", $usertime)." (GMT+$zone)"; + $timezones["$zone"] = gmstrftime("%a, %I:%M %p", $usertime)." (GMT+$zone)"; } } - choose_from_menu ($timezones, "timezone", $user->timezone, "Use the server's local time", "", "99"); + choose_from_menu ($timezones, "timezone", $user->timezone, get_string("serverlocaltime"), "", "99"); + echo "(".get_string(currentlocaltime).")"; ?> - (Your current local time)
">
diff --git a/user/edit.php b/user/edit.php index 9e06031e2e..343899b273 100644 --- a/user/edit.php +++ b/user/edit.php @@ -136,6 +136,7 @@ } $teacher = strtolower($course->teacher); + $teacheronly = "(".get_string("teacheronly", "", $teacher).")"; print_simple_box_start("center", "", "$THEME->cellheading"); echo "

User profile for $user->firstname $user->lastname

"; diff --git a/user/index.php b/user/index.php index 9c325df881..d6dc6fdc45 100644 --- a/user/index.php +++ b/user/index.php @@ -17,10 +17,12 @@ add_to_log($course->id, "user", "view all", "index.php?id=$course->id", ""); if ($course->category) { - print_header("$course->shortname: Participants", "$course->fullname", - "id>$course->shortname -> Participants", ""); + print_header("$course->shortname: ".get_string("participants"), "$course->fullname", + "id>$course->shortname -> ". + get_string("participants"), ""); } else { - print_header("$course->shortname: Participants", "$course->fullname", "Participants", ""); + print_header("$course->shortname: ".get_string("participants"), "$course->fullname", + get_string("participants"), ""); } @@ -67,24 +69,25 @@ function print_user($user, $course, $teacherlinks) { echo ""; echo ""; echo "$user->firstname $user->lastname"; - echo "

Email: email\">$user->email
"; - echo "Location: $user->city, ".$COUNTRIES["$user->country"]."
"; - echo "Last access: ".userdate($user->lastaccess); + echo "

"; + echo get_string("email").": email\">$user->email
"; + echo get_string("location").": $user->city, ".$COUNTRIES["$user->country"]."
"; + echo get_string("lastaccess").": ".userdate($user->lastaccess); echo "  (".format_time(time() - $user->lastaccess).")"; echo ""; echo ""; if ($teacherlinks) { $timemidnight = usergetmidnight(time()); - echo "id&user=$user->id\">Contributions
"; - echo "id&user=$user->id&date=$timemidnight\">Today's logs
"; - echo "id&user=$user->id\">All logs
"; - echo "id&user=$user->id\">Unenrol
"; + echo "id&user=$user->id\">".get_string("contributions")."
"; + echo "id&user=$user->id&date=$timemidnight\">".get_string("todaylogs")."
"; + echo "id&user=$user->id\">".get_string("alllogs")."
"; + echo "id&user=$user->id\">".get_string("unenrol")."
"; if (isstudent($course->id, $user->id)) { - echo "id&user=$user->id\">Login as
"; + echo "id&user=$user->id\">".get_string("loginas")."
"; } } - echo "id&course=$course->id\">Full profile..."; + echo "id&course=$course->id\">".get_string("fullprofile")."..."; echo "
"; echo ""; diff --git a/user/view.php b/user/view.php index e490ceb8a9..dd2fe22f45 100644 --- a/user/view.php +++ b/user/view.php @@ -23,22 +23,23 @@ require_login($course->id); } - $fullname = "$user->firstname $user->lastname"; - - add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id"); + $fullname = "$user->firstname $user->lastname"; + $personalprofile = get_string("personalprofile"); + $participants = get_string("participants"); + if ($course->category) { - print_header("Personal profile: $fullname", "Personal profile: $fullname", + print_header("$personalprofile: $fullname", "$personalprofile: $fullname", "id\">$course->shortname -> - id\">Participants -> $fullname", ""); + id\">$participants -> $fullname", ""); } else { - print_header("Personal profile: $fullname", "Personal profile: $fullname", "$fullname", ""); + print_header("$personalprofile: $fullname", "$personalprofile: $fullname", "$fullname", ""); } if ($course->category and ! isguest() ) { if (!isstudent($course->id, $user->id) && !isteacher($course->id, $user->id)) { - print_heading("$fullname is not enrolled in this course"); + print_heading(get_string("notenrolled", "", $fullname)); print_footer($course); die; } @@ -58,13 +59,13 @@ // Print name and edit button across top echo "
"; - echo "

$user->firstname $user->lastname

"; + echo "

$fullname

"; echo "
"; if ($id == $USER->id and !isguest()) { echo "

"; echo ""; echo "id\">"; - echo ""; + echo ""; echo "

"; } echo "
"; @@ -82,25 +83,25 @@ echo "city or $user->country) { - print_row("Location:", "$user->city, ".$COUNTRIES["$user->country"]); + print_row(get_string("location").":", "$user->city, ".$COUNTRIES["$user->country"]); } if (isteacher($course->id)) { if ($user->address) { - print_row("Address:", "$user->address"); + print_row(get_string("address").":", "$user->address"); } if ($user->phone1) { - print_row("Phone:", "$user->phone1"); + print_row(get_string("phone").":", "$user->phone1"); } if ($user->phone2) { - print_row("Phone:", "$user->phone2"); + print_row(get_string("phone").":", "$user->phone2"); } } - print_row("Email:", "email\">$user->email"); + print_row(get_string("email").":", "email\">$user->email"); if ($user->url) { - print_row("Web page:", "url\">$user->url"); + print_row(get_string("webpage").":", "url\">$user->url"); } if ($user->icq) { @@ -108,7 +109,7 @@ } $datestring = userdate($user->lastaccess)."  (".format_time(time() - $user->lastaccess).")"; - print_row("Last access:", $datestring); + print_row(get_string("lastaccess").":", $datestring); echo "
"; @@ -119,7 +120,7 @@ echo "

"; echo ""; echo "

"; echo "id\">"; - echo "shortname\">"; + echo "shortname)."\">"; echo "

\n"; } -- 2.39.5