Issue Details (XML | Word | Printable)

Key: MDL-10373
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Minor Minor
Assignee: Dongsheng Cai
Reporter: Valery Fremaux
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-14610

Chat dates printing does not switch language

Created: 06/Jul/07 09:20 PM   Updated: 10/Jun/08 03:25 PM
Return to search
Component/s: Chat
Affects Version/s: 1.8.1
Fix Version/s: 1.9.2

Environment: Php 5.0.23, MySQL 5.2.x Apache 2.0.59, Win XP

Database: MySQL
Participants: Dongsheng Cai and Valery Fremaux
Security Level: None
QA Assignee: Nicolas Connault
Resolved date: 01/May/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
When using chat in other languages some printings call userdate() without fixing locale

example of location : mod/chat/report.php §169

adding the marked line fixes the issue and make userdate print in the correct locale.

        else {
            $sessionstart = $lasttime;
            if ($sessionend - $sessionstart > 60 and count($sessionusers) >= 1) {

>>>> setLocale(LC_TIME, substr(current_language(), 0, 2)); <<<<<
                echo '<p align="center">'.userdate($sessionstart).' --> '. userdate($sessionend).'</p>';

                print_simple_box_start('center');


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Dongsheng Cai added a comment - 01/May/08 12:08 PM
You don't need to call setlocale before you call userdate, because moodle take care all of these, moodle_setlocale will change locale.

It works very well on my server.

Feel free to reopen it if you still could use date in your language.