a little $CFG->showstrings option to display the location of the translation file
that is responsible for that element. and display it inside brackets adjacent to it, on the screen.
(i use $CFG->showstrings = ture; inside config.php to activate this feature )
very very helpful for new comers to the world of Moodle translation.
i bet, you should have seen this one coming
here is the new get_string_from_file() function that should replace the one inside "lib/moodlelib.php"
( it is actually, a tiny change. i guess )
function get_string_from_file($identifier, $langfile, $destination) {
global $CFG;
static $strings; // Keep the strings cached in memory.
if (empty($strings[$langfile]))
{ $string = array(); include ($langfile); $strings[$langfile] = $string; }else
{ $string = &$strings[$langfile]; }if (!isset ($string[$identifier]))
{ return false; }if ($CFG->showstrings)
{ //echo "<div style=\"direction:ltr;\">'$identifier'='$string[$identifier]' >> '".ltrim($langfile,"$CFG->dataroot/lang/")."'</div>"; return $destination .'= sprintf("'.$string[$identifier] .'('. ltrim($langfile,"$CFG->dataroot/lang/").')");'; } return $destination .'= sprintf("'. $string[$identifier] .'");';
}
- duplicates
-
MDL-19467 show language strings in-situ to make translations and local language mods easier
-
- Closed
-