@@ -83,8 +83,7 @@ const PLUGIN_NAME: string = 'localization';
8383
8484const PLACEHOLDER_PREFIX : string = Constants . STRING_PLACEHOLDER_PREFIX ;
8585const PLACEHOLDER_REGEX : RegExp = new RegExp (
86- // The maximum length of quotemark escaping we can support is the length of the placeholder prefix
87- `${ PLACEHOLDER_PREFIX } _((?:[^_]){1,${ PLACEHOLDER_PREFIX . length } })_(\\d+)` ,
86+ `${ PLACEHOLDER_PREFIX } (\\+(?:[^+]){2,})?\\+_(\\d+)` ,
8887 'g'
8988) ;
9089
@@ -227,8 +226,6 @@ export class LocalizationPlugin implements Webpack.Plugin {
227226 } else {
228227 return assetPath ;
229228 }
230-
231- // return source.replace(Constants.LOCALE_FILENAME_PLACEHOLDER_REGEX, this._localeNamePlaceholder.value);
232229 }
233230 ) ;
234231
@@ -304,6 +301,7 @@ export class LocalizationPlugin implements Webpack.Plugin {
304301 const localizedChunkAssets : ILocaleElementMap = { } ;
305302 let alreadyProcessedAFileInThisChunk : boolean = false ;
306303 for ( const chunkFileName of chunk . files ) {
304+ debugger ;
307305 if (
308306 chunkFileName . indexOf ( this . _localeNamePlaceholder . value ) !== - 1 && // Ensure this is expected to be localized
309307 chunkFileName . endsWith ( '.js' ) && // Ensure this is a JS file
@@ -563,7 +561,7 @@ export class LocalizationPlugin implements Webpack.Plugin {
563561 } ;
564562 reconstructionSeries . push ( staticElement ) ;
565563
566- const [ placeholder , quotemark , placeholderSerialNumber ] = regexResult ;
564+ const [ placeholder , capturedQuotemark , placeholderSerialNumber ] = regexResult ;
567565
568566 let localizedReconstructionElement : IReconstructionElement ;
569567 if ( placeholderSerialNumber === this . _localeNamePlaceholder . suffix ) {
@@ -590,6 +588,7 @@ export class LocalizationPlugin implements Webpack.Plugin {
590588 } ;
591589 localizedReconstructionElement = brokenLocalizedElement ;
592590 } else {
591+ const quotemark : string = capturedQuotemark . substr ( 1 , ( capturedQuotemark . length - 1 ) / 2 ) ;
593592 const localizedElement : ILocalizedReconstructionElement = {
594593 kind : 'localized' ,
595594 values : values ,
@@ -855,7 +854,7 @@ export class LocalizationPlugin implements Webpack.Plugin {
855854 private _getPlaceholderString ( ) : IStringPlaceholder {
856855 const suffix : string = ( this . _stringPlaceholderCounter ++ ) . toString ( ) ;
857856 return {
858- value : `${ Constants . STRING_PLACEHOLDER_PREFIX } _" _${ suffix } ` ,
857+ value : `${ Constants . STRING_PLACEHOLDER_PREFIX } +""+ _${ suffix } ` ,
859858 suffix : suffix
860859 } ;
861860 }
0 commit comments