mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-15688: readability improvement to the script
This commit is contained in:
parent
c49f8af39b
commit
7c56e8623b
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ function write_language_file($lang, $langdata) {
|
||||||
fwrite($file, "/* this file was automatically imported from TinyMCE's translations */\n");
|
fwrite($file, "/* this file was automatically imported from TinyMCE's translations */\n");
|
||||||
foreach($langdata as $id => $line) {
|
foreach($langdata as $id => $line) {
|
||||||
// the next two lines are there to make you enjoy how php deals with backslashes
|
// the next two lines are there to make you enjoy how php deals with backslashes
|
||||||
$line = preg_replace_callback('/\\\\u([\dABCDEF]{4})/', 'unichr', $line); // we're matching something like \u00E9
|
$line = preg_replace_callback('/\\\\u([0-9A-F]{4})/', 'unichr', $line); // we're matching something like \u00E9
|
||||||
// we're only escaping single quotes, but we gotta prevent escaping those that have already been escaped.
|
// we're only escaping single quotes, but we gotta prevent escaping those that have already been escaped.
|
||||||
fwrite($file, '$string[\''. $id ."']='". strtr($line, array('\\\'' => '\\\'', '\'' => '\\\'')) ."';\n");
|
fwrite($file, '$string[\''. $id ."']='". strtr($line, array('\\\'' => '\\\'', '\'' => '\\\'')) ."';\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue