From ff67afbd95290b3bdf55bd72b358eeeca5cd2629 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 11 Apr 2010 12:46:14 +0000 Subject: [PATCH] MDL-22054 converting course formats to have own lang packs AMOS START MOV [formatscorm,core],[pluginname,format_scorm] MOV [formatsocial,core],[pluginname,format_social] MOV [formattopics,core],[pluginname,format_topics] MOV [formatweeks,core],[pluginname,format_weeks] AMOS END --- admin/settings/courses.php | 5 +--- course/edit_form.php | 5 +--- course/format/scorm/lang/en/format_scorm.php | 26 +++++++++++++++++++ .../format/social/lang/en/format_social.php | 26 +++++++++++++++++++ .../format/topics/lang/en/format_topics.php | 26 +++++++++++++++++++ course/format/weeks/lang/en/format_weeks.php | 26 +++++++++++++++++++ lang/en/moodle.php | 4 --- lib/moodlelib.php | 2 +- 8 files changed, 107 insertions(+), 13 deletions(-) create mode 100644 course/format/scorm/lang/en/format_scorm.php create mode 100644 course/format/social/lang/en/format_social.php create mode 100644 course/format/topics/lang/en/format_topics.php create mode 100644 course/format/weeks/lang/en/format_weeks.php diff --git a/admin/settings/courses.php b/admin/settings/courses.php index dbe09cedb48..3fe8dd6fc5c 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -20,10 +20,7 @@ if ($hassiteconfig $courseformats = get_plugin_list('format'); $formcourseformats = array(); foreach ($courseformats as $courseformat => $courseformatdir) { - $formcourseformats["$courseformat"] = get_string("format$courseformat","format_$courseformat"); - if ($formcourseformats["$courseformat"]=="[[format$courseformat]]") { - $formcourseformats["$courseformat"] = get_string("format$courseformat"); - } + $formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat"); } $temp->add(new admin_setting_configselect('moodlecourse/format', get_string('format'), get_string('coursehelpformat'), 'weeks',$formcourseformats)); for ($i=1; $i<=52; $i++) { diff --git a/course/edit_form.php b/course/edit_form.php index 6837c7a46a8..bdd5a334af9 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -126,10 +126,7 @@ class course_edit_form extends moodleform { $courseformats = get_plugin_list('format'); $formcourseformats = array(); foreach ($courseformats as $courseformat => $formatdir) { - $formcourseformats["$courseformat"] = get_string("format$courseformat", "format_$courseformat"); - if($formcourseformats["$courseformat"]=="[[format$courseformat]]") { - $formcourseformats["$courseformat"] = get_string("format$courseformat"); - } + $formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat"); } $mform->addElement('select', 'format', get_string('format'), $formcourseformats); $mform->setHelpButton('format', array('courseformats', get_string('courseformats')), true); diff --git a/course/format/scorm/lang/en/format_scorm.php b/course/format/scorm/lang/en/format_scorm.php new file mode 100644 index 00000000000..f41af461ca9 --- /dev/null +++ b/course/format/scorm/lang/en/format_scorm.php @@ -0,0 +1,26 @@ +. + +/** + * Strings for component 'format_scorm', language 'en', branch 'MOODLE_20_STABLE' + * + * @package format_scorm + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'SCORM format'; diff --git a/course/format/social/lang/en/format_social.php b/course/format/social/lang/en/format_social.php new file mode 100644 index 00000000000..fb19d6537c1 --- /dev/null +++ b/course/format/social/lang/en/format_social.php @@ -0,0 +1,26 @@ +. + +/** + * Strings for component 'format_social', language 'en', branch 'MOODLE_20_STABLE' + * + * @package format_social + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'Social format'; diff --git a/course/format/topics/lang/en/format_topics.php b/course/format/topics/lang/en/format_topics.php new file mode 100644 index 00000000000..9126a98ca5a --- /dev/null +++ b/course/format/topics/lang/en/format_topics.php @@ -0,0 +1,26 @@ +. + +/** + * Strings for component 'format_topics', language 'en', branch 'MOODLE_20_STABLE' + * + * @package format_topics + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'Topics format'; diff --git a/course/format/weeks/lang/en/format_weeks.php b/course/format/weeks/lang/en/format_weeks.php new file mode 100644 index 00000000000..ab0070210d9 --- /dev/null +++ b/course/format/weeks/lang/en/format_weeks.php @@ -0,0 +1,26 @@ +. + +/** + * Strings for component 'format_weeks', language 'en', branch 'MOODLE_20_STABLE' + * + * @package format_weeks + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'Weekly format'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 0f3e0a2a0d2..22120db9678 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -716,12 +716,8 @@ $string['format'] = 'Format'; $string['formathtml'] = 'HTML format'; $string['formatmarkdown'] = 'Markdown format'; $string['formatplain'] = 'Plain text format'; -$string['formatscorm'] = 'SCORM format'; -$string['formatsocial'] = 'Social format'; $string['formattext'] = 'Moodle auto-format'; $string['formattexttype'] = 'Formatting'; -$string['formattopics'] = 'Topics format'; -$string['formatweeks'] = 'Weekly format'; $string['formatwiki'] = 'Wiki-like format'; $string['framesetinfo'] = 'This frameset document contains:'; $string['from'] = 'From'; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 29139878b75..894b0b58dd6 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5905,7 +5905,7 @@ class amos_string_manager implements string_manager { $string = $this->load_component_strings($component, $lang); if (!isset($string[$identifier])) { - if ($identifier !== 'parentlanguage' and strpos($component, 'format_') !== 0 and $component !== 'pix') { + if ($identifier !== 'parentlanguage' and $component !== 'pix') { debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER); } return "[[$identifier]]";