Issue Details (XML | Word | Printable)

Key: MDL-20152
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Eloy Lafuente (stronk7)
Reporter: Brian Jorgensen
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

glossary should use format-specific strings for concept and definition

Created: 25/Aug/09 12:17 AM   Updated: 04/Sep/09 12:13 AM
Return to search
Component/s: Glossary
Affects Version/s: 1.9.2, 1.9.3, 1.9.4, 1.9.5
Fix Version/s: None

File Attachments: 1. Text File MDL-20152.glossary.format-strings.v1.patch (10 kB)
2. Text File MDL-20152.glossary.format-strings.v2.patch (10 kB)

Issue Links:
Relates
 

Participants: Anthony Borrow, Brian Jorgensen and Eloy Lafuente (stronk7)
Security Level: None
Difficulty: Easy
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
The glossary add/edit page uses an mform that does not do format-specific string lookups for the words "concept" and "definition".

My suggestion is to add two methods to each /mod/glossary/formats/XXX/XXX_format.php file:

function glossary_get_concept_string_XXX

and

function glossary_get_concetp_string_XXX

as well as two functions in /glossary/lib.php

function glossary_get_concept_string($displayformat)

and

function glossary_get_definition_string($displayformat)

This also requires calling these function in the mform in mod/glossary/edit_form.php, as well as a changes to each format to add these functions and to call them as required.

I will attach a patch for 1.9.x after the JIRA has been created.


Thanks,

Brian


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Brian Jorgensen added a comment - 25/Aug/09 12:25 AM
First attempt at a patch for this.

Brian Jorgensen added a comment - 25/Aug/09 12:30 AM
Thanks to Tim's suggestion

http://moodle.org/mod/forum/discuss.php?d=130212

I'll take a look at the random glossary entry block and the glossary filter and iterate the patch.

Brian


Brian Jorgensen added a comment - 25/Aug/09 01:36 AM
Neither the random glossary entry block nor the glossary filter use the lang file strings as far as I could find.

Brian


Brian Jorgensen added a comment - 25/Aug/09 01:57 AM
Fixed a typo.

Anthony Borrow added a comment - 29/Aug/09 02:51 PM
Brian - Just to raise the point here that we would need to improve the places_to_search_for_lang_strings if we want to keep glossary formats modular. I am thinking of something like:

get_string('concept','gformat_custom');

so that it would look in /mod/glossary/formats/custom/lang/en_utf8/gformat_custom.php for the string.

I had a quick look at http://docs.moodle.org/en/Development:Places_to_search_for_lang_strings and I am not sure if gformat should be added to core or not as part of get_plugin_types in /lib/moodelib.php. My inclination is that it should for consistency purposes like question formats, course formats, etc. I will raise this as a separate issue since currently we do not have a nice way of plugging in custom glossary formats.

Peace - Anthony


Brian Jorgensen added a comment - 04/Sep/09 12:13 AM
Hey, Anthony:

I think your idea of having individual lang files for each glossary format is consistent with what I know of the way Moodle adds extension points; my assumption with this patch is that glossary format authors would use the standard /lang/*/glossary.php file as is the current practice.

The two main reasons for this were:

1. keep the patch as simple as possible
2. since there is the idea of migrating the glossary to the database module, minimize the amount of investment.

If there is a preference to add format-specific lang files at this time, I could certainly look at what it would take to add this in.

Thanks,

Brian