3

I installed the yii-web-start extension, it uses a database for message translation, but I need use gettext instead.

Where and how can I configure YII-i18n?

1 Answer 1

5

You can set up i18n in your config (protected/config/main.php) with CGettextMessageSource to use gettext.

'components' => array(
    'messages' => array(
        'class' => 'CGettextMessageSource'
     )
 ),

By default, you should store your .po-files under protected/messages.

2
  • 1
    What is the naming convention for the po files? Directory structure?
    – Nathan H
    Nov 13, 2012 at 11:52
  • @NathanH see stackoverflow.com/a/26947408/2482457 Excerpt from CGettextMessageSource: All translations are saved under the basePath directory. Translations in one language are kept as MO or PO files under an individual subdirectory whose name is the language ID. The file name is specified via catalog property, which defaults to 'messages'.
    – Maug Lee
    Nov 15, 2014 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.