From 74c373f0bcac9f09259dee08922bb8e4b0c6112d Mon Sep 17 00:00:00 2001 From: Sebastiano Bellinzis Date: Sat, 10 Feb 2024 00:18:36 +0100 Subject: [PATCH] revert change in ctx key check --- translator.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/translator.go b/translator.go index 3e681c5..793f8f1 100644 --- a/translator.go +++ b/translator.go @@ -293,15 +293,13 @@ func (t *Translator) addToPotFileIfNotExists(key translationKey) error { return t.addToPotFile(key.ctx, uniqueKey{singular: key.value}) } - for potKey, _ := range ctr[key.ctx] { - if key.value == potKey { + for _, potKey := range ctr[key.ctx] { + if key.value == potKey.ID { return nil } - - return t.addToPotFile(key.ctx, uniqueKey{singular: key.value}) } - return nil + return t.addToPotFile(key.ctx, uniqueKey{singular: key.value}) } func (t *Translator) FuncMap() template.FuncMap {