HUGO

I18n string wihout pluralization? Can I get rid of "other"

Looks like if I do string translation with my i18n/ folder I have to add the other key in front of every translations, even if there is no pluralization necessary for said key. Example:

teaser: 
  other: "This amazing offer"

Is it possible to set this up, so the other key, is optional. Currently if I put the translation directly, hugo complains:

teaser: "This amazing offer"
# leads to error: failed to load translations: 
# failed to unmarshal de.yaml: yaml: unmarshal errors:
# line 1: cannot unmarshal !!str `Ihre Li...` into map[string]interface {}

Is there a way to get rid of this? As I would find it much more readable without the other:

I know about the alternative style, which does not make things more readable.

- id: "teaser"
  translation: "This amazing offer"

No. These are the only two data structure allowed for language files.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.