【问题标题】:We want to support internationalization in cakephp我们希望在 cakephp 中支持国际化
【发布时间】:2015-07-13 08:29:29
【问题描述】:

我们使用的是 cakephp 1.2。

使用语言环境,我们要进行国际化。

在 cake/console/cake i18n 命令中,我们创建了一个 default.pot。

查看ctp,描述如下。

<title><?php echo __('site_title', true); ?></title>

app\locale\eng\LC_MESSAGES\default.po

msgid "site_title"
msgstr "welcome my site!"

控制器

App::import('Core', 'l10n');
Configure::write('Config.language', 'en');

但是,当您查看屏幕时, 它显示为“site_title”。

将显示 msgid 中指定的字符。

为什么我不知道是不是发生这种情况的原因。

【问题讨论】:

    标签: php cakephp internationalization


    【解决方案1】:

    您是否将此代码放入您的控制器中? :

    $this->L10n = new L10n();
    $this->L10n->get("eng");
    

    让我们试着告诉我们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-31
      • 2016-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多