Skip to content

Commit c6777cc

Browse files
ocombedond2clouds
authored andcommitted
fix(@ngtools/webpack): set output locale for ng xi18n
Fixes angular#8680
1 parent 5b2df93 commit c6777cc

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

packages/@ngtools/webpack/src/angular_compiler_plugin.ts

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export class AngularCompilerPlugin implements Tapable {
227227
}
228228
if (options.locale !== undefined) {
229229
this._compilerOptions.i18nInLocale = options.locale;
230+
this._compilerOptions.i18nOutLocale = options.locale;
230231
this._normalizedLocale = this._validateLocale(options.locale);
231232
}
232233
if (options.missingTranslation !== undefined) {
+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { join } from 'path';
22
import { ng } from '../../utils/process';
3-
import {
4-
expectFileToExist, writeFile,
5-
expectFileToMatch
6-
} from '../../utils/fs';
3+
import { writeFile, expectFileToMatch } from '../../utils/fs';
74

85

96
export default function() {
@@ -14,8 +11,7 @@ export default function() {
1411
.then(() => ng('xi18n', '--locale', 'fr'))
1512
.then((output) => {
1613
if (!output.stdout.match(/starting from Angular v4/)) {
17-
expectFileToExist(join('src', 'messages.xlf'));
18-
expectFileToMatch(join('src', 'messages.xlf'), /source-language="fr"/);
14+
return expectFileToMatch(join('src', 'messages.xlf'), 'source-language="fr"');
1915
}
2016
});
2117
}
+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import {join} from 'path';
22
import {ng} from '../../utils/process';
3-
import {
4-
expectFileToExist, writeFile,
5-
expectFileToMatch
6-
} from '../../utils/fs';
3+
import { writeFile, expectFileToMatch } from '../../utils/fs';
74

85

96
export default function() {
@@ -14,8 +11,7 @@ export default function() {
1411
.then(() => ng('xi18n', '--out-file', 'messages.fr.xlf'))
1512
.then((output) => {
1613
if (!output.stdout.match(/starting from Angular v4/)) {
17-
expectFileToExist(join('src', 'messages.fr.xlf'));
18-
expectFileToMatch(join('src', 'messages.fr.xlf'), /Hello world/);
14+
return expectFileToMatch(join('src', 'messages.fr.xlf'), 'Hello world');
1915
}
2016
});
2117
}

0 commit comments

Comments
 (0)