@@ -132,7 +132,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
132132 if (outputSrcLang ) {
133133 if (bdlLangs .contains (srcLang )) {
134134 exportLanguageResource (client , bf , srcLang , outDir ,
135- outContentOpt , bundleLayout , langIdStyle , langMap );
135+ outContentOpt , bundleLayout , langIdStyle , langMap , srcLang );
136136 } else {
137137 getLog ().warn ("The specified source language (" + srcLang
138138 + ") does not exist in the bundle:" + bundleId );
@@ -142,7 +142,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
142142 for (String tgtLang : tgtLangs ) {
143143 if (bdlLangs .contains (tgtLang )) {
144144 exportLanguageResource (client , bf , tgtLang , outDir ,
145- outContentOpt , bundleLayout , langIdStyle , langMap );
145+ outContentOpt , bundleLayout , langIdStyle , langMap , srcLang );
146146 } else {
147147 getLog ().warn ("The specified target language (" + tgtLang
148148 + ") does not exist in the bundle:" + bundleId );
@@ -154,16 +154,23 @@ public void execute() throws MojoExecutionException, MojoFailureException {
154154
155155 private void exportLanguageResource (ServiceClient client , SourceBundleFile bf , String language ,
156156 File outBaseDir , OutputContentOption outContntOpt , BundleLayout bundleLayout ,
157- LanguageIdStyle langIdStyle , Map <String , String > langMap )
157+ LanguageIdStyle langIdStyle , Map <String , String > langMap , String srcLang )
158158 throws MojoFailureException {
159159 String srcFileName = bf .getFile ().getName ();
160160 String relPath = bf .getRelativePath ();
161-
162161 File outputFile = null ;
163162
164163 switch (bundleLayout ) {
165164 case LANGUAGE_SUFFIX : {
166165 File dir = (new File (outBaseDir , relPath )).getParentFile ();
166+
167+ // truncate source suffix from sourceFile name - BEGIN
168+ int extensionIndex = srcFileName .lastIndexOf ('.' );
169+ String extension = (extensionIndex > 0 ) ? srcFileName .substring (extensionIndex ) : "" ;
170+ int srcSuffixIndex = srcFileName .lastIndexOf ("_" + getLanguageId (srcLang , langIdStyle , langMap ));
171+ srcFileName = (srcSuffixIndex > 0 ) ? srcFileName .substring (0 ,srcSuffixIndex ) + extension : srcFileName ;
172+ // truncate source suffix from sourceFile name - END
173+
167174 int idx = srcFileName .lastIndexOf ('.' );
168175 String tgtName = null ;
169176 if (idx < 0 ) {
0 commit comments