Reputation: 15158
I' creating a moodle local plugin
I created a language file in :local/myplugin/lang/en/local_usercertlist.php
with some keys
I created a language file in local/myplugin/lang/en/local_myplugin.php
with some keys:
<?php
$string['pluginname']="My Plug-in";
$string['testkey']="Test Val";
in lib.php
I use get_string
like this:
get_string('testkey','local_myplugin')
But I get [[testkey]]
instead of Test Val
!
why? what is the problem?
Upvotes: 0
Views: 2775
Reputation: 9
The solution is to simply purge the lang cache via admin control panel.
https://docs.moodle.org/28/en/Purge_all_cache
Upvotes: 0
Reputation: 15158
I just needed to increase plugin version & update moodle database;
Upvotes: 2
Reputation: 10221
local/myplugin/lang/en/local_usercertlist.php
Should be
local/usercertlist/lang/en/local_usercertlist.php
and
get_string('testkey','local_myplugin')
should be
get_string('testkey','local_usercertlist')
Upvotes: 1