File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ function wordAwareStringSplit(string $string, int $maxLengthOfLine): array
119119
120120$ potCreationDate = date ('Y-m-d H:i:O ' );
121121
122- $ head = <<<POT
122+ $ potfile = <<<POT
123123#, fuzzy
124124msgid ""
125125msgstr ""
@@ -133,26 +133,25 @@ function wordAwareStringSplit(string $string, int $maxLengthOfLine): array
133133POT ;
134134
135135// Add search paths
136- $ head .= trim ($ head ) . "\n" ;
136+ $ potfile .= trim ($ potfile ) . "\n" ;
137137foreach ($ paths as $ i => $ path ) {
138- $ head .= '"X-Poedit-SearchPath- ' . $ i . ': ' . $ path . '\\n" ' . "\n" ;
138+ $ potfile .= '"X-Poedit-SearchPath- ' . $ i . ': ' . $ path . '\\n" ' . "\n" ;
139139}
140140
141- $ body = '' ;
142141foreach ($ strings as $ string => $ locations ) {
143- $ body .= "\n" ;
142+ $ potfile .= "\n" ;
144143 foreach ($ locations as $ location ) {
145- $ body .= '#: ' . $ location . "\n" ;
144+ $ potfile .= '#: ' . $ location . "\n" ;
146145 }
147146 $ msgid = wordAwareStringSplit ($ string , 80 );
148- $ body .= 'msgid ' ;
147+ $ potfile .= 'msgid ' ;
149148 foreach ($ msgid as $ s ) {
150- $ body .= json_encode ($ s , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) . "\n" ;
149+ $ potfile .= json_encode ($ s , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) . "\n" ;
151150 }
152- $ body .= 'msgstr "" ' . "\n" ;
151+ $ potfile .= 'msgstr "" ' . "\n" ;
153152}
154153
155154if (!file_exists ('i18n ' )) {
156155 mkdir ('i18n ' );
157156}
158- file_put_contents ('i18n/ ' . $ domain . '.pot ' , $ head . "\n" . $ body );
157+ file_put_contents ('i18n/ ' . $ domain . '.pot ' , $ potfile );
You can’t perform that action at this time.
0 commit comments