# 语言包定义,左边是key,右边是value,建议key部分用下划线模式,value用单引号或者双引号包含起来
error_email_missing = 'You must submit an email address';
error_url_missing = 'You must submit a URL';
error_username_missing = 'You must submit a username';
</code></pre>
<p>语言包设置</p>
<pre><code class="php">'language' => array(
'default' => 'en', // 默认语言包
'fallback' => 'en', // 默认语言包不存在的情况下调用这个语言包
'locale' => 'en_US',
'always_load' => array( // 总是自动加载
'common', 'form_validate', 'upload', 'menu', 'content'
),
)
// 手动加载语言包
lang::load($langfile, $lang);
// 读取语言文本
lang::get($key, $defaultvalue = null, $replace = [], $log_errors = true)
<{lang key='' defaultvalue=null replace=[] log_errors=true}>
lang::get("There are {numer} million cars in {address}.", null, ['number'=>2, 'address'=>'Shanghai']);