Yii Framework Forum: Use Translation Of Another Module - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Use Translation Of Another Module Rate Topic: -----

#1 User is offline   Lumix1991 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 11-August 14

Posted 22 August 2014 - 03:48 AM

Dear,

How can I use a translation string of another module?

My translation files are located at /application/modules/admin/messages/nl/general.php.

Yii::t('adminModule.general', 'My string'); is what I am using on both locations, from within the admin module this is working properly, but from another module I'll get an error;

include(adminModule.php): failed to open stream: No such file or directory 


How can i access these from another module?
0

#2 User is offline   Emile Bons 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 54
  • Joined: 19-September 11
  • Location:Breda, The Netherlands

Posted 22 August 2014 - 04:01 AM

View PostLumix1991, on 22 August 2014 - 03:48 AM, said:

How can I use a translation string of another module?


Why would you do so in the first place? If a translation is used in more then one module, it seems it should be placed a level higher... Never tried it, but this post suggests to import the messages in your module. It also explains how to do so.
0

#3 User is offline   Lumix1991 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 11-August 14

Posted 22 August 2014 - 04:26 AM

I need to use a model from another module, but in this model i translated all labels with Yii:t(). The model itself is working from the other module, but only the translations are not.

Import doesn't work.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users