diff options
Diffstat (limited to 'v2/goi18n/merge_command.go')
-rw-r--r-- | v2/goi18n/merge_command.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/v2/goi18n/merge_command.go b/v2/goi18n/merge_command.go index 9765c6d..b736dfe 100644 --- a/v2/goi18n/merge_command.go +++ b/v2/goi18n/merge_command.go @@ -125,12 +125,16 @@ func merge(messageFiles map[string][]byte, sourceLanguageTag language.Tag, outdi } templates := map[string]*i18n.MessageTemplate{} for _, m := range mf.Messages { - templates[m.ID] = i18n.NewMessageTemplate(m) + template := i18n.NewMessageTemplate(m) + if template == nil { + continue + } + templates[m.ID] = template } if mf.Tag == sourceLanguageTag { for _, template := range templates { if sourceMessageTemplates[template.ID] != nil { - return nil, fmt.Errorf("multiple source translations for id %s", template.ID) + return nil, fmt.Errorf("multiple source translations for id %q", template.ID) } template.Hash = hash(template) sourceMessageTemplates[template.ID] = template |