Skip to content

Commit 5646f28

Browse files
committed
RESX file reader.
1 parent 55c4199 commit 5646f28

7 files changed

Lines changed: 275 additions & 11 deletions

File tree

common/config/rush/nonbrowser-approved-packages.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
"name": "@microsoft/api-extractor-model",
1515
"allowedCategories": [ "libraries" ]
1616
},
17-
{
18-
"name": "@rushstack/debug-certificate-manager",
19-
"allowedCategories": [ "libraries" ]
20-
},
2117
{
2218
"name": "@microsoft/decorators",
2319
"allowedCategories": [ "libraries" ]
@@ -158,6 +154,10 @@
158154
"name": "@pnpm/logger",
159155
"allowedCategories": [ "libraries" ]
160156
},
157+
{
158+
"name": "@rushstack/debug-certificate-manager",
159+
"allowedCategories": [ "libraries" ]
160+
},
161161
{
162162
"name": "@rushstack/eslint-config",
163163
"allowedCategories": [ "libraries", "tests" ]
@@ -610,6 +610,10 @@
610610
"name": "xml",
611611
"allowedCategories": [ "libraries" ]
612612
},
613+
{
614+
"name": "xmldoc",
615+
"allowedCategories": [ "libraries" ]
616+
},
613617
{
614618
"name": "yargs",
615619
"allowedCategories": [ "libraries" ]

common/config/rush/pnpm-lock.yaml

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpack/localization-plugin/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"glob": "~7.0.5",
2626
"jju": "~1.4.0",
2727
"@microsoft/node-core-library": "3.19.3",
28-
"lodash": "~4.17.15"
28+
"lodash": "~4.17.15",
29+
"xmldoc": "~1.1.2"
2930
},
3031
"devDependencies": {
3132
"@types/webpack": "4.39.8",
@@ -36,6 +37,7 @@
3637
"@types/loader-utils": "1.1.3",
3738
"@types/jju": "1.4.1",
3839
"@types/lodash": "4.14.116",
40+
"@types/xmldoc": "1.1.4",
3941
"gulp": "~4.0.2"
4042
}
4143
}

webpack/localization-plugin/src/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
export interface ILocJsonFile {
4+
export interface ILocFile {
55
[stringName: string]: ILocalizedString;
66
}
77

webpack/localization-plugin/src/loaders/LocJsonLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as loaderUtils from 'loader-utils';
66
import * as jju from 'jju';
77

88
import { LocalizationPlugin } from '../LocalizationPlugin';
9-
import { ILocJsonFile } from '../interfaces';
9+
import { ILocFile } from '../interfaces';
1010

1111
export interface ILocJsonLoaderOptions {
1212
pluginInstance: LocalizationPlugin;
@@ -15,7 +15,7 @@ export interface ILocJsonLoaderOptions {
1515
export default function (this: loader.LoaderContext, content: string): string {
1616
const { pluginInstance } = loaderUtils.getOptions(this) as ILocJsonLoaderOptions;
1717
const locJsonFilePath: string = this.resourcePath;
18-
const locJsonFileData: ILocJsonFile = jju.parse(content);
18+
const locJsonFileData: ILocFile = jju.parse(content);
1919

2020
const resultObject: { [stringName: string]: string } = {};
2121
for (const stringName in locJsonFileData) { // eslint-disable-line guard-for-in

webpack/localization-plugin/src/loaders/SingleLocaleLoader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { loader } from 'webpack';
55
import * as loaderUtils from 'loader-utils';
66
import * as jju from 'jju';
77

8-
import { ILocJsonFile } from '../interfaces';
8+
import { ILocFile } from '../interfaces';
99

1010
export interface ILocJsonLoaderOptions {
1111
/**
@@ -34,7 +34,7 @@ export default function (this: loader.LoaderContext, content: string): string {
3434
`Strings for file ${locJsonFilePath} were not provided in the LocalizationPlugin configuration.`
3535
));
3636
} else {
37-
const locJsonFileData: ILocJsonFile = jju.parse(content);
37+
const locJsonFileData: ILocFile = jju.parse(content);
3838
for (const stringName in locJsonFileData) {
3939
if (!stringMap.has(stringName)) {
4040
this.emitError(new Error(

0 commit comments

Comments
 (0)