Skip to content

Commit d1cafe7

Browse files
Always generate lowercase locale names so 'LKG's produce identical results on case-sensitive file systems.
1 parent bc59582 commit d1cafe7

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

Gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const generatedLCGFile = "built/local/enu/diagnosticMessages.generated.json.lcg"
117117
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
118118
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
119119
*/
120-
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"]
120+
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]
121+
.map(f => f.toLowerCase())
121122
.map(f => `built/local/${f}/diagnosticMessages.generated.json`)
122123
.concat(generatedLCGFile);
123124

Jakefile.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ else if (process.env.PATH !== undefined) {
2424

2525
const host = process.env.TYPESCRIPT_HOST || process.env.host || "node";
2626

27-
const locales = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr", "zh-CN", "zh-TW"];
28-
2927
const defaultTestTimeout = 40000;
3028

3129
let useDebugMode = true;
@@ -709,19 +707,6 @@ const Travis = {
709707
}
710708
};
711709

712-
function buildLocalizedTargets() {
713-
/**
714-
* The localization target produces the two following transformations:
715-
* 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
716-
* convert localized resources into a .json file the compiler can understand
717-
* 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
718-
* generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
719-
*/
720-
const localizationTargets = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]
721-
.map(f => path.join(Paths.builtLocal,f))
722-
.concat(path.dirname(Paths.generatedLCGFile));
723-
}
724-
725710
function toNs(diff) {
726711
return diff[0] * 1e9 + diff[1];
727712
}

scripts/generateLocalizedDiagnosticMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function main(): void {
3636
console.error("Unexpected XML file structure. Expected to find result.LCX.$.TgtCul.");
3737
process.exit(1);
3838
}
39-
const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul);
39+
const outputDirectoryName = getPreferedLocaleName(result.LCX.$.TgtCul).toLowerCase();
4040
if (!outputDirectoryName) {
4141
console.error(`Invalid output locale name for '${result.LCX.$.TgtCul}'.`);
4242
process.exit(1);

0 commit comments

Comments
 (0)