messageConfig.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. return [
  3. // string, required, root directory of all source files
  4. 'sourcePath' => __DIR__ . DIRECTORY_SEPARATOR . '..',
  5. // array, required, list of language codes that the extracted messages
  6. // should be translated to. For example, ['zh-CN', 'de'].
  7. 'languages' => ['de'],
  8. // string, the name of the function for translating messages.
  9. // Defaults to 'Yii::t'. This is used as a mark to find the messages to be
  10. // translated. You may use a string for single function name or an array for
  11. // multiple function names.
  12. 'translator' => 'Yii::t',
  13. // boolean, whether to sort messages by keys when merging new messages
  14. // with the existing ones. Defaults to false, which means the new (untranslated)
  15. // messages will be separated from the old (translated) ones.
  16. 'sort' => false,
  17. // boolean, whether to remove messages that no longer appear in the source code.
  18. // Defaults to false, which means these messages will NOT be removed.
  19. 'removeUnused' => false,
  20. // boolean, whether to mark messages that no longer appear in the source code.
  21. // Defaults to true, which means each of these messages will be enclosed with a pair of '@@' marks.
  22. 'markUnused' => true,
  23. // array, list of patterns that specify which files (not directories) should be processed.
  24. // If empty or not set, all files will be processed.
  25. // See helpers/FileHelper::findFiles() for pattern matching rules.
  26. // If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
  27. 'only' => ['*.php'],
  28. // array, list of patterns that specify which files/directories should NOT be processed.
  29. // If empty or not set, all files/directories will be processed.
  30. // See helpers/FileHelper::findFiles() for pattern matching rules.
  31. // If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
  32. 'except' => [
  33. '.svn',
  34. '.git',
  35. '.gitignore',
  36. '.gitkeep',
  37. '.hgignore',
  38. '.hgkeep',
  39. '/messages',
  40. ],
  41. // 'php' output format is for saving messages to php files.
  42. 'format' => 'php',
  43. // Root directory containing message translations.
  44. 'messagePath' => __DIR__,
  45. // boolean, whether the message file should be overwritten with the merged messages
  46. 'overwrite' => true,
  47. /*
  48. // File header used in generated messages files
  49. 'phpFileHeader' => '',
  50. // PHPDoc used for array of messages with generated messages files
  51. 'phpDocBlock' => null,
  52. */
  53. /*
  54. // Message categories to ignore
  55. 'ignoreCategories' => [
  56. 'yii',
  57. ],
  58. */
  59. /*
  60. // 'db' output format is for saving messages to database.
  61. 'format' => 'db',
  62. // Connection component to use. Optional.
  63. 'db' => 'db',
  64. // Custom source message table. Optional.
  65. // 'sourceMessageTable' => '{{%source_message}}',
  66. // Custom name for translation message table. Optional.
  67. // 'messageTable' => '{{%message}}',
  68. */
  69. /*
  70. // 'po' output format is for saving messages to gettext po files.
  71. 'format' => 'po',
  72. // Root directory containing message translations.
  73. 'messagePath' => __DIR__ . DIRECTORY_SEPARATOR . 'messages',
  74. // Name of the file that will be used for translations.
  75. 'catalog' => 'messages',
  76. // boolean, whether the message file should be overwritten with the merged messages
  77. 'overwrite' => true,
  78. */
  79. ];