Moodle

We can't display Wiki message "Site map for " on non-English Moodle.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.5
  • Component/s: Wiki (1.x)
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

We can't display Wiki message "Site map for " on non-English Moodle.
To fix this problem, we can modify "mod/wiki/ewiki/plugins/moodle/sitemap.php" as below.

Script: moodle/mod/wiki/ewiki/plugins/moodle/sitemap.php
Line: 47

[before]
}else{ $o = ewiki_make_title($id, ewiki_t("SITEMAPFOR")." ".$id, 2); [after] }else{
$o = ewiki_make_title($id, get_string("smfor","wiki")." ".$id, 2);

Activity

Hide
Tatsuya Shirai added a comment -

We can't display the title of special pages on non-English Moodle too.

mod/wiki/ewiki/ewiki.php, function ewiki_make_title()

      • get title
        if (!strlen($title)) { $title = $ewiki_title; // already in &html; format }
        elseif ($ewiki_config["split_title"] && $may_split) { $title = ewiki_split_title($title, $ewiki_config["split_title"], 0&($title!=$ewiki_title)); }
        else { // add from here $atitle = get_string(strtolower($title), 'wiki'); if (substr($atitle, 0, 2) != '[[') $title = $atitle; // add to here $title = s($title); }
Show
Tatsuya Shirai added a comment - We can't display the title of special pages on non-English Moodle too. mod/wiki/ewiki/ewiki.php, function ewiki_make_title()
      • get title if (!strlen($title)) { $title = $ewiki_title; // already in &html; format } elseif ($ewiki_config["split_title"] && $may_split) { $title = ewiki_split_title($title, $ewiki_config["split_title"], 0&($title!=$ewiki_title)); } else { // add from here $atitle = get_string(strtolower($title), 'wiki'); if (substr($atitle, 0, 2) != '[[') $title = $atitle; // add to here $title = s($title); }
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Mits,

I think I've fixed the problem with the "sitemap for" string. Instead of your fix, I've changed SITEMAPFOR by SMFOR, that was the correct lang string in Moodle langs (note the the ewiki_t() function is correct - and uses get_string() internally).

About Tatsuya comment: "We can't display the title of special pages on non-English Moodle too."

Can you provide some screenshot or so about what is that expected to fix? It's a really central function in wiki and I'm not sure if retrieving there strings is the correct approach to follow (perhaps the callers should have the correct strings passed instead?)

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Mits, I think I've fixed the problem with the "sitemap for" string. Instead of your fix, I've changed SITEMAPFOR by SMFOR, that was the correct lang string in Moodle langs (note the the ewiki_t() function is correct - and uses get_string() internally). About Tatsuya comment: "We can't display the title of special pages on non-English Moodle too." Can you provide some screenshot or so about what is that expected to fix? It's a really central function in wiki and I'm not sure if retrieving there strings is the correct approach to follow (perhaps the callers should have the correct strings passed instead?) Ciao
Hide
Tatsuya Shirai added a comment -

Hi Eloy!
I've attached screen shot (ewiki_special_page.jpg).

PageIndex, MostVisitedPages, MostOftenChangedPages, UpdatedPages, OrphanedPages, WikiExport, FileDownload

The page titles of these pages are displayed in English short name even if I select Japanese language mode.

#I guess that the name of special pages can not be used for our new page name, or can ?

Show
Tatsuya Shirai added a comment - Hi Eloy! I've attached screen shot (ewiki_special_page.jpg). PageIndex, MostVisitedPages, MostOftenChangedPages, UpdatedPages, OrphanedPages, WikiExport, FileDownload The page titles of these pages are displayed in English short name even if I select Japanese language mode. #I guess that the name of special pages can not be used for our new page name, or can ?
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Now all special pages show the heading translated.
(and yes, I think it's not recommendable to use those English strings as pagename. IMO they should be reserved)

Resolving this as fixed, ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now all special pages show the heading translated. (and yes, I think it's not recommendable to use those English strings as pagename. IMO they should be reserved) Resolving this as fixed, ciao
Hide
Sam Hemelryk added a comment -

All looks good thanks

Show
Sam Hemelryk added a comment - All looks good thanks

Dates

  • Created:
    Updated:
    Resolved: