From 7e4c07a3d5a8a1a342302ebb3a44febe2084dbf4 Mon Sep 17 00:00:00 2001 From: moki Date: Mon, 27 Nov 2023 23:35:13 +0300 Subject: [PATCH] fix(xlf/translations): using appropriate indexing --- src/xlf/parser/parser.test.ts | 2 +- src/xlf/translations/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xlf/parser/parser.test.ts b/src/xlf/parser/parser.test.ts index 07f7ab10..06e5bf31 100644 --- a/src/xlf/parser/parser.test.ts +++ b/src/xlf/parser/parser.test.ts @@ -29,7 +29,7 @@ describe('validates parameters', () => { it('works with valid parameters', () => { const units = [ {target: 'Предложение о чем-то', id: 1}, - {target: 'Фрагмент Текста', id: 1}, + {target: 'Фрагмент Текста', id: 2}, ]; const xlf = generateXLF(units); parseTranslations({xlf}); diff --git a/src/xlf/translations/index.ts b/src/xlf/translations/index.ts index 5498e1a1..c3448e47 100644 --- a/src/xlf/translations/index.ts +++ b/src/xlf/translations/index.ts @@ -20,7 +20,7 @@ function getTranslations(parameters: TranslationsParameters) { rendered += renderer.render(tokens); - translations.set(String(i), rendered); + translations.set(String(i + 1), rendered); rendered = ''; }