Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii2 Generating translation messages

In Yii 1.x we generated translation messages with command ./framework/yiic message protected/messages/config.php How can we achieve the same with Yii2?

like image 687
heron Avatar asked Oct 24 '14 16:10

heron


1 Answers

Just run using yiic file in root directory of your project (where composer.json is). Here is help from the yiic. If you have specific problem let me know.

./yii help message

DESCRIPTION

Extracts messages to be translated from source files.

The extracted messages can be saved the following depending on format setting in config file:

  • PHP message source files.
  • ".po" files.
  • Database.

Usage: 1. Create a configuration file using the 'message/config' command: yii message/config /path/to/myapp/messages/config.php 2. Edit the created config file, adjusting it for your web application needs. 3. Run the 'message/extract' command, using created config: yii message /path/to/myapp/messages/config.php

SUB-COMMANDS

  • message/config: Creates a configuration file for the "extract" command.
  • message/extract (default): Extracts messages to be translated from source c...

To see the detailed information about individual sub-commands, enter:

yii help

like image 65
Stefano Mtangoo Avatar answered Oct 07 '22 01:10

Stefano Mtangoo