diff --git a/bundles/basic/files/locale b/bundles/basic/files/locale index 01ec548..c8227c5 100644 --- a/bundles/basic/files/locale +++ b/bundles/basic/files/locale @@ -1 +1 @@ -LANG=en_US.UTF-8 +LANG=${node.metadata['locale']['default']} diff --git a/bundles/basic/files/locale.gen b/bundles/basic/files/locale.gen index 518904d..f41230e 100644 --- a/bundles/basic/files/locale.gen +++ b/bundles/basic/files/locale.gen @@ -1,5 +1,3 @@ -en_US.UTF-8 UTF-8 - -% for locale in sorted(node.metadata.get('locales', set())): +% for locale in sorted(node.metadata['locale']['installed']): ${locale} ${locale.split('.')[-1]} % endfor diff --git a/bundles/basic/items.py b/bundles/basic/items.py index 84f4d6f..420d695 100644 --- a/bundles/basic/items.py +++ b/bundles/basic/items.py @@ -2,6 +2,7 @@ files = { '/etc/default/locale': { + 'content_type': 'mako', 'needs': { 'action:locale-gen', }, diff --git a/bundles/basic/metadata.py b/bundles/basic/metadata.py new file mode 100644 index 0000000..b28a554 --- /dev/null +++ b/bundles/basic/metadata.py @@ -0,0 +1,22 @@ +defaults = { + 'locale': { + 'default': 'en_US.UTF-8', + 'installed': { + 'de_DE.UTF-8', + 'en_US.UTF-8', + }, + }, +} + + +@metadata_reactor.provides( + 'locale/installed', +) +def ensure_default_is_installed(metadata): + return { + 'locale': { + 'installed': { + metadata.get('locale/default'), + }, + }, + } diff --git a/nodes/htz/ex42-1048908.py b/nodes/htz/ex42-1048908.py index d61285f..22d3db6 100644 --- a/nodes/htz/ex42-1048908.py +++ b/nodes/htz/ex42-1048908.py @@ -137,11 +137,11 @@ nodes['htz.ex42-1048908'] = { 'part.of.the.trans-agenda.eu': set(), }, }, - 'locales': { - # because scripts need to generate german date outputs - 'de_DE.UTF-8', - # legacy - 'en_DK.UTF-8', + 'locale': { + 'installed': { + # legacy + 'en_DK.UTF-8', + }, }, 'matrix-media-repo': { 'version': 'v1.2.2',