Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
61c7ac9d
Commit
61c7ac9d
authored
Aug 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #722.
parent
6c3f2390
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
MessageController.php
framework/yii/console/controllers/MessageController.php
+1
-1
config.php
framework/yii/messages/config.php
+45
-0
No files found.
framework/yii/console/controllers/MessageController.php
View file @
61c7ac9d
...
@@ -98,7 +98,7 @@ class MessageController extends Controller
...
@@ -98,7 +98,7 @@ class MessageController extends Controller
$messages
=
array
();
$messages
=
array
();
foreach
(
$files
as
$file
)
{
foreach
(
$files
as
$file
)
{
$messages
=
array_merge
(
$messages
,
$this
->
extractMessages
(
$file
,
$config
[
'translator'
]));
$messages
=
array_merge
_recursive
(
$messages
,
$this
->
extractMessages
(
$file
,
$config
[
'translator'
]));
}
}
foreach
(
$config
[
'languages'
]
as
$language
)
{
foreach
(
$config
[
'languages'
]
as
$language
)
{
...
...
framework/yii/messages/config.php
0 → 100644
View file @
61c7ac9d
<?php
return
array
(
// string, required, root directory of all source files
'sourcePath'
=>
__DIR__
.
'/..'
,
// string, required, root directory containing message translations.
'messagePath'
=>
__DIR__
,
// array, required, list of language codes that the extracted messages
// should be translated to. For example, array('zh_cn', 'de').
'languages'
=>
array
(
'de'
),
// string, the name of the function for translating messages.
// Defaults to 'Yii::t'. This is used as a mark to find the messages to be
// translated. You may use a string for single function name or an array for
// multiple function names.
'translator'
=>
'Yii::t'
,
// boolean, whether to sort messages by keys when merging new messages
// with the existing ones. Defaults to false, which means the new (untranslated)
// messages will be separated from the old (translated) ones.
'sort'
=>
false
,
// boolean, whether the message file should be overwritten with the merged messages
'overwrite'
=>
true
,
// boolean, whether to remove messages that no longer appear in the source code.
// Defaults to false, which means each of these messages will be enclosed with a pair of '@@' marks.
'removeUnused'
=>
false
,
// array, list of patterns that specify which files/directories should be processed.
// If empty or not set, all files/directories will be processed.
// A path matches a pattern if it contains the pattern string at its end. For example,
// '/a/b' will match all files and directories ending with '/a/b';
// and the '.svn' will match all files and directories whose name ends with '.svn'.
// Note, the '/' characters in a pattern matches both '/' and '\'.
// If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
'only'
=>
array
(
'.php'
),
// array, list of patterns that specify which files/directories should NOT be processed.
// If empty or not set, all files/directories will be processed.
// Please refer to "only" for details about the patterns.
'except'
=>
array
(
'.svn'
,
'.git'
,
'.gitignore'
,
'.gitkeep'
,
'.hgignore'
,
'.hgkeep'
,
'/messages'
,
),
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment