Add newline at the end of converted json files
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Tue, 1 Apr 2014 08:03:05 +0000 (08:03 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 1 Apr 2014 10:45:39 +0000 (10:45 +0000)
1) Some text editors add missing newline at the end of the file
automatically.
2) It's generally a nice thing to do to avoid messing up display
for example when cat'ing a file

Change-Id: Icf636721c4edcf4ae706c9a346fe36233928cae8

maintenance/generateJsonI18n.php

index 27a9ff1..8dc89ed 100644 (file)
@@ -83,7 +83,7 @@ class GenerateJsonI18n extends Maintenance {
                        $jsonfile = "$jsondir/$langcode.json";
                        $success = file_put_contents(
                                $jsonfile,
-                               FormatJson::encode( $langmsgs, true, FormatJson::ALL_OK )
+                               FormatJson::encode( $langmsgs, true, FormatJson::ALL_OK ) . "\n"
                        );
                        if ( $success === false ) {
                                $this->error( "FAILED to write $jsonfile", 1 );