From 6f25dc40cfb6cf966dad85c697e1e33822c227e4 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sat, 1 Jun 2019 00:40:34 +0200 Subject: [PATCH] Improved l10n bundle distribution --- src/factory.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/factory.ts b/src/factory.ts index b47d686..3b9c3ad 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -151,11 +151,15 @@ async function getModelFolderContents(model: string): Promise }) ); + const l10nBundle: PartitionedBundle["l10nBundle"] = Object.assign( + {}, + ...L10N_FilesListByFolder + .map((folder, index) => ({ [l10nFolders[index]]: folder })) + ); + return { bundle: bundleMap, - l10nBundle: Object.assign({}, ...L10N_FilesListByFolder - .map((folder, index) => ({ [l10nFolders[index]]: folder })) - ) as PartitionedBundle["l10nBundle"] + l10nBundle }; } @@ -190,11 +194,11 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle { ) ); - const unLocalizedBundle = Object.assign({}, + const unLocalizedBundle: BundleUnit = Object.assign({}, ...bundleKeys .filter(file => !file.includes(".lproj")) .map(file => ({ [file]: bundle[file] })) - ) as BundleUnit; + ); return { bundle: unLocalizedBundle,