简体   繁体   English

如何从fuelphp中的程序包加载语言文件?

[英]How to load a language file from a package in fuelphp?

Using the config.php always_load configuration, how does one load a language file from a package? 使用config.php always_load配置,如何从包中加载语言文件?

All of the fuelphp documentation alludes to being able to do this, but only shows the syntax for loading from a module. 所有fuelphp文档都暗示可以执行此操作,但是仅显示了从模块加载的语法。

Here's what I'm trying to do: 这是我想做的事情:

fuel/app/config/config.php fuel / app / config / config.php

'always_load' => [
    'language' => [
        // loads fuel/app/lang/en/login.php into login group
        'login',
    ],
], 

fuel/app/config/production/config.php fuel / app / config / production / config.php

'always_load' => [
    'language' => [     
        // override /config/config.php with contents from
        // /fuel/packages/pkg/lang/en/login.php
        'lang_file_from_package' => 'login',
    ],
], 

Packages are core extensions, which means it will merge the contents of the files found in app and in the package. 软件包是核心扩展,这意味着它将合并在app和软件包中找到的文件内容。

As such, there is no method to define you want to load it from the package only, other then by specifying a fully qualified pathname, which will always load just that file. 因此,没有方法可以定义仅从包中加载它,而只能通过指定完全限定的路径名​​来定义,而该路径名将始终仅加载该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM