Moodle

Alphabetize lang/en_utf8/quiz.php

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Language
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

By Tim's request.

Activity

Hide
Olli Savolainen added a comment -

I would do it like this but I find no way of confirming this still is not screwing something up (just added the htmlspecialchars call).

ksort($string,SORT_STRING);
foreach($string as $k=>$v){
$current=str_replace("'","\'",$v);
$current=htmlspecialchars($current,ENT_NOQUOTES)
echo "$"."string['$k'] = '".$current."';\n";
}

Show
Olli Savolainen added a comment - I would do it like this but I find no way of confirming this still is not screwing something up (just added the htmlspecialchars call). ksort($string,SORT_STRING); foreach($string as $k=>$v){ $current=str_replace("'","\'",$v); $current=htmlspecialchars($current,ENT_NOQUOTES) echo "$"."string['$k'] = '".$current."';\n"; }
Hide
Olli Savolainen added a comment -

I had a flash in a dream, or something like it, that you could just remove the ksort and run the script, and then run a diff of the result of that, to confirm the script does not screw up anything in the strings themselves. But then, I guess you had a solution already.

Show
Olli Savolainen added a comment - I had a flash in a dream, or something like it, that you could just remove the ksort and run the script, and then run a diff of the result of that, to confirm the script does not screw up anything in the strings themselves. But then, I guess you had a solution already.
Hide
Tim Hunt added a comment -

Well, thanks to Australian television being so bad, I sorted the file by hand on my laptop (then use the unix sort command to find my own errors!) I know, I could have switched the TV off ...

Show
Tim Hunt added a comment - Well, thanks to Australian television being so bad, I sorted the file by hand on my laptop (then use the unix sort command to find my own errors!) I know, I could have switched the TV off ...

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: