@@ -70,6 +70,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
7070
7171 // Checks if the bundle already exists
7272 String bundleId = bf .getBundleId ();
73+ boolean createNew = false ;
7374 if (bundleIds .contains (bundleId )) {
7475 getLog ().info ("Found bundle:" + bundleId );
7576 // Checks if the source language matches.
@@ -82,12 +83,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
8283 }
8384 } else {
8485 getLog ().info ("bundle:" + bundleId + " does not exist, creating a new bundle." );
85- NewBundleData newBundleData = new NewBundleData (srcLang );
86- if (!tgtLangs .isEmpty ()) {
87- newBundleData .setTargetLanguages (new TreeSet <String >(tgtLangs ));
88- }
89- client .createBundle (bundleId , newBundleData );
90- getLog ().info ("Created bundle: " + bundleId );
86+ createNew = true ;
9187 }
9288
9389 // Parse the resource bundle file
@@ -96,13 +92,27 @@ public void execute() throws MojoExecutionException, MojoFailureException {
9692
9793 try (FileInputStream fis = new FileInputStream (bf .getFile ())) {
9894 Bundle resBundle = filter .parse (fis );
95+
96+ if (createNew ) {
97+ NewBundleData newBundleData = new NewBundleData (srcLang );
98+ // set target languages
99+ if (!tgtLangs .isEmpty ()) {
100+ newBundleData .setTargetLanguages (new TreeSet <String >(tgtLangs ));
101+ }
102+ // set bundle notes
103+ newBundleData .setNotes (resBundle .getNotes ());
104+ client .createBundle (bundleId , newBundleData );
105+ getLog ().info ("Created bundle: " + bundleId );
106+ }
99107 Collection <ResourceString > resStrings = resBundle .getResourceStrings ();
100108 for (ResourceString resString : resStrings ) {
101109 NewResourceEntryData resEntryData = new NewResourceEntryData (resString .getValue ());
102110 int seqNum = resString .getSequenceNumber ();
103111 if (seqNum >= 0 ) {
104112 resEntryData .setSequenceNumber (Integer .valueOf (seqNum ));
105113 }
114+ // set resource string notes
115+ resEntryData .setNotes (resString .getNotes ());
106116 resEntries .put (resString .getKey (), resEntryData );
107117 }
108118 } catch (IOException e ) {
0 commit comments