翻译插件到前端

时间:2017-05-04 09:46:05

标签: octobercms octobercms-plugins

我正在制作插件(背面的一部分和前端的另一部分)。

我想将我的lang.php文件(在plugins / me / myplugin / lang / en / lang.php中)用于我的组件(我添加'使用Lang'),如https://octobercms.com/docs/plugin/localization#file-structure

如何在这个lang文件中使用前端的字段(在后端,一切正常)(我试试,即Lang :: get('me.myplugin :: lang.myfield.name'),如{ {3}},trans('me.myplugin :: lang.myfield.name'),但没有。

由于

1 个答案:

答案 0 :(得分:0)

你能否澄清一下这个问题。我假设您的Lang文件基本上只是返回一个关联数组。在这种情况下,你可以像普通的php数组一样访问它。

如果我错了,您可能需要查看这些https://octobercms.com/docs/services/helpers#method-trans

相关问题