Added Sorted Core Strings (#16081)

* added sorted sql xlf and sorting function for i18n

* compiled i18n.js

* fixed space

* simplified i18n.json
This commit is contained in:
Alex Ma
2021-07-12 15:58:38 -07:00
committed by GitHub
parent affe3a838b
commit e3dc417df4
4 changed files with 4493 additions and 4482 deletions

View File

@@ -527,7 +527,11 @@ function createXlfFilesForCoreBundle() {
if (file.isBuffer()) {
const xlfs = Object.create(null);
const json = JSON.parse(file.contents.toString('utf8'));
for (let coreModule in json.keys) {
// {{SQL CARBON EDIT}} - Must sort the keys for easier translation.
let sortedKeys = Object.keys(json.keys).sort();
for (let i = 0; i < sortedKeys.length; i++) {
let coreModule = sortedKeys[i];
// {{SQL CARBON EDIT}} - End
const projectResource = getResource(coreModule);
const resource = projectResource.name;
const project = projectResource.project;

View File

@@ -652,7 +652,11 @@ export function createXlfFilesForCoreBundle(): ThroughStream {
if (file.isBuffer()) {
const xlfs: Map<XLF> = Object.create(null);
const json: BundledFormat = JSON.parse((file.contents as Buffer).toString('utf8'));
for (let coreModule in json.keys) {
// {{SQL CARBON EDIT}} - Must sort the keys for easier translation.
let sortedKeys = Object.keys(json.keys).sort();
for (let i = 0; i < sortedKeys.length; i++) {
let coreModule = sortedKeys[i];
// {{SQL CARBON EDIT}} - End
const projectResource = getResource(coreModule);
const resource = projectResource.name;
const project = projectResource.project;