我正在创建一个moodle本地插件我在:local/myplugin/lang/en/local_usercertlist.php
中创建了一个语言文件,其中包含一些键
我在local/myplugin/lang/en/local_myplugin.php
中创建了一个语言文件,其中包含一些关键字:
<?php
$string['pluginname']="My Plug-in";
$string['testkey']="Test Val";
在lib.php
中我这样使用get_string
:
get_string('testkey','local_myplugin')
但我得到[[testkey]]
而不是Test Val
!
为什么?有什么问题吗?
我只需要增加插件版本&更新moodle数据库;
local/myplugin/lang/en/local_usercertlist.php
应该是
local/usercertlist/lang/en/local_usercertlist.php
和
get_string('testkey','local_myplugin')
应该get_string('testkey','local_usercertlist')