Moodle

glossary should use format-specific strings for concept and definition

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.2, 1.9.3, 1.9.4, 1.9.5
  • Fix Version/s: None
  • Component/s: Glossary
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

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

Issue Links

Activity

Hide
Brian Jorgensen added a comment -

First attempt at a patch for this.

Show
Brian Jorgensen added a comment - First attempt at a patch for this.
Hide
Brian Jorgensen added a comment -

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

Show
Brian Jorgensen added a comment - 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
Hide
Brian Jorgensen added a comment -

Neither the random glossary entry block nor the glossary filter use the lang file strings as far as I could find.

Brian

Show
Brian Jorgensen added a comment - Neither the random glossary entry block nor the glossary filter use the lang file strings as far as I could find. Brian
Hide
Brian Jorgensen added a comment -

Fixed a typo.

Show
Brian Jorgensen added a comment - Fixed a typo.
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Brian Jorgensen added a comment -

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

Show
Brian Jorgensen added a comment - 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
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Dates

  • Created:
    Updated:
    Resolved: