Skip to content

Commit

Permalink
MDL-22050 removing moodle/langconfig duplicates
Browse files Browse the repository at this point in the history
AMOS BEGIN
  MOV [decsep,core],[decsep,core_langconfig]
  MOV [listsep,core],[listsep,core_langconfig]
  MOV [thousandsep,core],[thousandsep,core_langconfig]
AMOS END
  • Loading branch information
skodak committed Apr 10, 2010
1 parent 4248b15 commit 3c7e56c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion admin/uploaduser_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function definition (){
$mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'admin'), $choices);
if (array_key_exists('cfg', $choices)) {
$mform->setDefault('delimiter_name', 'cfg');
} else if (get_string('listsep') == ';') {
} else if (get_string('listsep', 'langconfig') == ';') {
$mform->setDefault('delimiter_name', 'semicolon');
} else {
$mform->setDefault('delimiter_name', 'comma');
Expand Down
2 changes: 1 addition & 1 deletion admin/user/user_bulk_download.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function user_download_csv($fields) {
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Pragma: public");

$delimiter = get_string('listsep');
$delimiter = get_string('listsep', 'langconfig');
$encdelim = '&#'.ord($delimiter);

$row = array();
Expand Down
8 changes: 4 additions & 4 deletions lib/mathslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ function get_error() {
*/
function localize($formula) {
$formula = str_replace('.', '$', $formula); // temp placeholder
$formula = str_replace(',', get_string('listsep'), $formula);
$formula = str_replace('$', get_string('decsep'), $formula);
$formula = str_replace(',', get_string('listsep', 'langconfig'), $formula);
$formula = str_replace('$', get_string('decsep', 'langconfig'), $formula);
return $formula;
}

Expand All @@ -125,8 +125,8 @@ function localize($formula) {
* @return string
*/
function unlocalize($formula) {
$formula = str_replace(get_string('decsep'), '$', $formula);
$formula = str_replace(get_string('listsep'), ',', $formula);
$formula = str_replace(get_string('decsep', 'langconfig'), '$', $formula);
$formula = str_replace(get_string('listsep', 'langconfig'), ',', $formula);
$formula = str_replace('$', '.', $formula); // temp placeholder
return $formula;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -8212,7 +8212,7 @@ function format_float($float, $decimalpoints=1, $localized=true) {
return '';
}
if ($localized) {
return number_format($float, $decimalpoints, get_string('decsep'), '');
return number_format($float, $decimalpoints, get_string('decsep', 'langconfig'), '');
} else {
return number_format($float, $decimalpoints, '.', '');
}
Expand All @@ -8234,7 +8234,7 @@ function unformat_float($locale_float) {

$locale_float = str_replace(' ', '', $locale_float); // no spaces - those might be used as thousand separators

return (float)str_replace(get_string('decsep'), '.', $locale_float);
return (float)str_replace(get_string('decsep', 'langconfig'), '.', $locale_float);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mod/data/export_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function definition() {
$mform->setDefault('exporttype', 'csv');
if (array_key_exists('cfg', $choices)) {
$mform->setDefault('delimiter_name', 'cfg');
} else if (get_string('listsep') == ';') {
} else if (get_string('listsep', 'langconfig') == ';') {
$mform->setDefault('delimiter_name', 'semicolon');
} else {
$mform->setDefault('delimiter_name', 'comma');
Expand Down

0 comments on commit 3c7e56c

Please sign in to comment.