douxueke5653 2014-04-27 11:56
浏览 269

opencart默认语言选择

I have set my default language from admin panel to Persian.

Now, every module uses persian language directory by default.

Thought there is one module that still persists in using English as its language. While I have set the translation in corresponding directory in language/persian.

My question is that how can I force the module to use the language/persian instead of language/english?

Here is the beginning of the module's Controller that fetches the language file:

$this->language->load('module/trackorder');

        $this->data['heading_title'] = $this->language->get('heading_title');
        $this->data['back'] = $this->url->link('common/home');
.....
  • 写回答

1条回答 默认 最新

  • doutu4335 2014-05-01 15:55
    关注

    Already checked if catalog/language/persian/module/trackorder.php exist, and isn't in english? there is only a way to force another language, instancing a new language object, as follows:

    $my_language = new Language('language_directory');
    $my_language->load('path-to/language-file'); // without extension
    $my_language->get('translation_index');
    

    example:

    $my_language = new Language('english');
    $my_language->load('module/cart');
    echo $my_language->get('heading_title');
    // this print 'Shopping Cart'
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号