From 342f3934b86eed1ac7a134106be3b3fe5bea85a0 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Thu, 30 Sep 2021 22:14:10 +0200 Subject: [PATCH] Fixed translations adding and improved a comment --- src/PKPass.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/PKPass.ts b/src/PKPass.ts index f4eb720..9ce1ee3 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -315,6 +315,17 @@ export default class PKPass extends Bundle { * If an empty buffer is passed, it won't be added to * the bundle. * + * `manifest.json` and `signature` files will be ignored. + * + * If a `pass.json` is passed to this method (and it has + * not been added previously), it will be read, validated + * and merged in the current instance. Its properties + * will overwrite the ones setted through methods. + * + * If a `pass.strings` file is passed, it will be read, parsed + * and merged with the translations added previously. + * Comments will be ignored. + * * @param pathName * @param buffer */ @@ -389,7 +400,7 @@ export default class PKPass extends Bundle { Object.assign( (this[localizationSymbol][lang] ??= {}), - parseStringsFile(buffer), + Object.fromEntries(parseStringsFile(buffer).translations), ); return;