Moodle
  1. Moodle
  2. MDL-32428

Random Glossary Entry - Title of block does not change with language switch

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Blocks
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      39292

      Description

      The Random Glossary Entry Block's title does not change to any other selected language pack except for the default "en".

      Testing instructions:

      1] Install any other language pack than the default "en" (easiest to see with anything other than "en")
      2] Add the Random Glossary Entry Block to a course
      3] Force the newly installed language pack within course settings
      4] Check to see if the title changed for the Random Glossary Entry Block.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Hi, Joseph.

          I've noticed that there are a number of strings that are set in the block's configuration, including the block title. These remain the same after a language change. There are appropriate strings translated for the title in various languages.

          Show
          Michael de Raadt added a comment - Hi, Joseph. I've noticed that there are a number of strings that are set in the block's configuration, including the block title. These remain the same after a language change. There are appropriate strings translated for the title in various languages.
          Hide
          Joseph Jacelone added a comment -

          Dear Michael,

          Thank you for the info. I am going to look into this tomorrow when I return to work to confirm.

          Joe

          Show
          Joseph Jacelone added a comment - Dear Michael, Thank you for the info. I am going to look into this tomorrow when I return to work to confirm. Joe
          Hide
          Joseph Jacelone added a comment - - edited

          Dear Michael,

          I just noticed this and did not put two and two together when I was creating the block. I guess this is a request for change then . I like the idea of being able to manage block headings, as much as the next person, on the fly but, I thought this was all managed via Language Customizations? I know the HTML block is a different situation.

          I have a user who has developed a script that allows for their site to be flipped from English to French on the fly which is the reason I submitted this tracker. Aside from the html block, I believe this is the only block that has it's title managed in the configuration rather than solely via the Language Customization page. Any chance this could be changed?

          Joe

          Show
          Joseph Jacelone added a comment - - edited Dear Michael, I just noticed this and did not put two and two together when I was creating the block. I guess this is a request for change then . I like the idea of being able to manage block headings, as much as the next person, on the fly but, I thought this was all managed via Language Customizations? I know the HTML block is a different situation. I have a user who has developed a script that allows for their site to be flipped from English to French on the fly which is the reason I submitted this tracker. Aside from the html block, I believe this is the only block that has it's title managed in the configuration rather than solely via the Language Customization page. Any chance this could be changed? Joe
          Hide
          Michael de Raadt added a comment -

          Hi, Joseph.

          Thanks for getting back on this issue.

          You may be correct about standard blocks and configurable titles, however I know of several contributed blocks that use configurable titles.

          This configuration is used allow teachers to use these blocks for different purposes, and I think the Random glossary block is an example of a block that could be used for different purposes. So I'm inclined to leave this option.

          You could modify your version of the block so that it always uses the title from the language file. This could be done by commenting out the lines that casue the title to be drawn from the configuration...

          /blocks/glossary_random/block_glossary_random.php, lines 19-24
          ...
                  // load userdefined title and make sure it's never empty
                  // if (empty($this->config->title)) {
                      $this->title = get_string('pluginname','block_glossary_random');
                  // } else {
                      // $this->title = $this->config->title;
                  // }
          
          Show
          Michael de Raadt added a comment - Hi, Joseph. Thanks for getting back on this issue. You may be correct about standard blocks and configurable titles, however I know of several contributed blocks that use configurable titles. This configuration is used allow teachers to use these blocks for different purposes, and I think the Random glossary block is an example of a block that could be used for different purposes. So I'm inclined to leave this option. You could modify your version of the block so that it always uses the title from the language file. This could be done by commenting out the lines that casue the title to be drawn from the configuration... /blocks/glossary_random/block_glossary_random.php, lines 19-24 ... // load userdefined title and make sure it's never empty // if (empty($ this ->config->title)) { $ this ->title = get_string('pluginname','block_glossary_random'); // } else { // $ this ->title = $ this ->config->title; // }
          Hide
          Joseph Jacelone added a comment -

          Hey Michael!

          Thank you very much for the additional information. After further research I would have to agree with you on this one as well. Thank you for the .php statement. I will present this as an option.

          Case closed and, as always, thank you!

          Joe

          Show
          Joseph Jacelone added a comment - Hey Michael! Thank you very much for the additional information. After further research I would have to agree with you on this one as well. Thank you for the .php statement. I will present this as an option. Case closed and, as always, thank you! Joe

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: