Skip to content

Commit

Permalink
As per the spec, add verbatim line breaks to the header (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk authored and sirreal committed Dec 7, 2018
1 parent 0bc461b commit 4fff461
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
18 changes: 9 additions & 9 deletions packages/i18n-calypso/cli/formatters/pot.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ module.exports = function( matches, options ) {
output += options.potHeader || [
'msgid ""',
'msgstr ""',
'"Project-Id-Version: _s ' + ( options.projectName || '' ) + '"',
'"Report-Msgid-Bugs-To: ' + ( options.projectBugsUrl || '' ) + '"',
'"POT-Creation-Date: ' + new Date().toISOString() + '"',
'"MIME-Version: 1.0"',
'"Content-Type: text/plain; charset=UTF-8"',
'"Content-Transfer-Encoding: 8bit"',
'"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE"',
'"Last-Translator: FULL NAME <EMAIL@ADDRESS>"',
'"Language-Team: LANGUAGE <[email protected]>"',
'"Project-Id-Version: _s ' + ( options.projectName || '' ) + '\\n"',
'"Report-Msgid-Bugs-To: ' + ( options.projectBugsUrl || '' ) + '\\n"',
'"POT-Creation-Date: ' + new Date().toISOString() + '\\n"',
'"MIME-Version: 1.0\\n"',
'"Content-Type: text/plain; charset=UTF-8\\n"',
'"Content-Transfer-Encoding: 8bit\\n"',
'"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\\n"',
'"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"',
'"Language-Team: LANGUAGE <[email protected]>\\n"',
''
].join( '\n' );

Expand Down
12 changes: 6 additions & 6 deletions packages/i18n-calypso/test/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ describe( 'index', function() {
} );

it( 'should have all the default headers', function() {
expect( output ).to.have.string( '"Project-Id-Version: _s i18nTest"\n' );
expect( output ).to.have.string( '"Project-Id-Version: _s i18nTest\\n"\n' );
expect( output ).to.have.string( '"Report-Msgid-Bugs-To:' );
expect( output ).to.have.string( '"POT-Creation-Date:' );
expect( output ).to.have.string( '"MIME-Version: 1.0"\n' );
expect( output ).to.have.string( '"Content-Type: text/plain; charset=UTF-8"\n' );
expect( output ).to.have.string( '"Content-Transfer-Encoding: 8bit"\n' );
expect( output ).to.have.string( '"MIME-Version: 1.0\\n"\n' );
expect( output ).to.have.string( '"Content-Type: text/plain; charset=UTF-8\\n"\n' );
expect( output ).to.have.string( '"Content-Transfer-Encoding: 8bit\\n"\n' );
expect( output ).to.have.string( '"PO-Revision-Date:' );
expect( output ).to.have.string( '"Last-Translator: FULL NAME <EMAIL@ADDRESS>"\n' );
expect( output ).to.have.string( '"Language-Team: LANGUAGE <[email protected]>"\n' );
expect( output ).to.have.string( '"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"\n' );
expect( output ).to.have.string( '"Language-Team: LANGUAGE <[email protected]>\\n"\n' );
} );

it( 'should create a simple translation', function() {
Expand Down
20 changes: 10 additions & 10 deletions packages/i18n-calypso/test/cli/pot.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

msgid ""
msgstr ""
Project-Id-Version: _s i18nTest
Report-Msgid-Bugs-To:
POT-Creation-Date: 2016-04-25T01:50:44.330Z
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PO-Revision-Date: 2014-MO-DA HO:MI+ZONE
Last-Translator: FULL NAME <EMAIL@ADDRESS>
Language-Team: LANGUAGE <[email protected]>
"Project-Id-Version: _s i18nTest\n"
"Report-Msgid-Bugs-To:\n"
"POT-Creation-Date: 2016-04-25T01:50:44.330Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"

msgid "My hat has three corners."
msgstr ""
Expand Down Expand Up @@ -143,4 +143,4 @@ msgstr ""

msgctxt "momentjs setting"
msgid "num_day_of_year"
msgstr ""
msgstr ""

0 comments on commit 4fff461

Please sign in to comment.