@@ -60,7 +60,21 @@ class Translations extends \ArrayObject
6060 const HEADER_PLURAL = 'Plural-Forms ' ;
6161 const HEADER_DOMAIN = 'X-Domain ' ;
6262
63- public static $ insertDate = true ;
63+ public static $ options = [
64+ 'defaultHeaders ' => [
65+ 'Project-Id-Version ' => '' ,
66+ 'Report-Msgid-Bugs-To ' => '' ,
67+ 'Last-Translator ' => '' ,
68+ 'Language-Team ' => '' ,
69+ 'MIME-Version ' => '1.0 ' ,
70+ 'Content-Type ' => 'text/plain; charset=UTF-8 ' ,
71+ 'Content-Transfer-Encoding ' => '8bit ' ,
72+ ],
73+ 'defaultDateHeaders ' => [
74+ 'POT-Creation-Date ' ,
75+ 'PO-Revision-Date ' ,
76+ ]
77+ ];
6478
6579 private $ headers ;
6680
@@ -69,21 +83,14 @@ class Translations extends \ArrayObject
6983 */
7084 public function __construct ($ input = [], $ flags = 0 , $ iterator_class = 'ArrayIterator ' )
7185 {
72- $ this ->headers = [
73- 'Project-Id-Version ' => '' ,
74- 'Report-Msgid-Bugs-To ' => '' ,
75- 'Last-Translator ' => '' ,
76- 'Language-Team ' => '' ,
77- 'MIME-Version ' => '1.0 ' ,
78- 'Content-Type ' => 'text/plain; charset=UTF-8 ' ,
79- 'Content-Transfer-Encoding ' => '8bit ' ,
80- ];
86+ $ this ->headers = static ::$ options ['defaultHeaders ' ];
8187
82- if (static ::$ insertDate ) {
83- $ this ->headers [' POT-Creation-Date ' ] = $ this -> headers [ ' PO-Revision-Date ' ] = date ('c ' );
88+ foreach (static ::$ options [ ' defaultDateHeaders ' ] as $ header ) {
89+ $ this ->headers [$ header ] = date ('c ' );
8490 }
8591
8692 $ this ->headers [self ::HEADER_LANGUAGE ] = '' ;
93+
8794 parent ::__construct ($ input , $ flags , $ iterator_class );
8895 }
8996
0 commit comments