I'm dabbling with writing my first block and one of the needs I'd like to cover is for it to have language strings but I'm having some problems finding the correct location for the language file.
The block I'm writing is using the name userclock so is placed in the directory blocks/userclock - within that directory I have block_userclock.php (block code) and also a directory lang/en_utf8 (giving path of $CFG->dirroot/blocks/userclock/lang/en_utf8) containing a file called block_userclock.php. This file contains the lines:
<?php
$string['block_title'] = "User Clock";
?>
$string['block_title'] = "User Clock";
?>
I try to access the string using
$text = get_string("block_title", "userclock");
but this just returns [ [ block_title ] ] (without the spaces)
Obviously I'm doing something wrong or I've missed something - if someone could suggest what I need to do it'd be much appreciated.
Thanks,
Simon