Improved l10n bundle distribution

This commit is contained in:
Alexander Cerutti
2019-06-01 00:40:34 +02:00
parent b6005bd821
commit 6f25dc40cf

View File

@@ -151,11 +151,15 @@ async function getModelFolderContents(model: string): Promise<PartitionedBundle>
}) })
); );
const l10nBundle: PartitionedBundle["l10nBundle"] = Object.assign(
{},
...L10N_FilesListByFolder
.map((folder, index) => ({ [l10nFolders[index]]: folder }))
);
return { return {
bundle: bundleMap, bundle: bundleMap,
l10nBundle: Object.assign({}, ...L10N_FilesListByFolder l10nBundle
.map((folder, index) => ({ [l10nFolders[index]]: folder }))
) as PartitionedBundle["l10nBundle"]
}; };
} }
@@ -190,11 +194,11 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle {
) )
); );
const unLocalizedBundle = Object.assign({}, const unLocalizedBundle: BundleUnit = Object.assign({},
...bundleKeys ...bundleKeys
.filter(file => !file.includes(".lproj")) .filter(file => !file.includes(".lproj"))
.map(file => ({ [file]: bundle[file] })) .map(file => ({ [file]: bundle[file] }))
) as BundleUnit; );
return { return {
bundle: unLocalizedBundle, bundle: unLocalizedBundle,