From 614bdf9dec640fa6d5fec1a8122c791fa9553fbf Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 24 Jan 2021 07:49:49 +0100 Subject: [PATCH] bundles/basic: support creating additional locales --- bundles/basic/files/locale | 2 +- bundles/basic/files/locale.gen | 6 +++++- bundles/basic/items.py | 3 +-- bundles/basic/metadata.py | 3 --- nodes/htz/ex42-1048908.py | 4 ++++ 5 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 bundles/basic/metadata.py diff --git a/bundles/basic/files/locale b/bundles/basic/files/locale index 6ad3e9f..01ec548 100644 --- a/bundles/basic/files/locale +++ b/bundles/basic/files/locale @@ -1 +1 @@ -LANG=${node.metadata['locale']} +LANG=en_US.UTF-8 diff --git a/bundles/basic/files/locale.gen b/bundles/basic/files/locale.gen index cad3ed1..518904d 100644 --- a/bundles/basic/files/locale.gen +++ b/bundles/basic/files/locale.gen @@ -1 +1,5 @@ -${node.metadata['locale']} ${node.metadata['locale'].split('.')[-1]} +en_US.UTF-8 UTF-8 + +% for locale in sorted(node.metadata.get('locales', set())): +${locale} ${locale.split('.')[-1]} +% endfor diff --git a/bundles/basic/items.py b/bundles/basic/items.py index fdb803e..84f4d6f 100644 --- a/bundles/basic/items.py +++ b/bundles/basic/items.py @@ -2,8 +2,7 @@ files = { '/etc/default/locale': { - 'content_type': 'mako', - 'triggers': { + 'needs': { 'action:locale-gen', }, }, diff --git a/bundles/basic/metadata.py b/bundles/basic/metadata.py deleted file mode 100644 index 63a756e..0000000 --- a/bundles/basic/metadata.py +++ /dev/null @@ -1,3 +0,0 @@ -defaults = { - 'locale': 'en_US.UTF-8', -} diff --git a/nodes/htz/ex42-1048908.py b/nodes/htz/ex42-1048908.py index 3399b3d..390d08d 100644 --- a/nodes/htz/ex42-1048908.py +++ b/nodes/htz/ex42-1048908.py @@ -108,6 +108,10 @@ nodes['htz.ex42-1048908'] = { 'part.of.the.trans-agenda.eu': set(), }, }, + 'locales': { + # because scripts need to generate german date outputs + 'de_DE.UTF-8', + }, 'matrix-synapse': { 'server_name': 'franzi.business', 'baseurl': 'matrix.franzi.business',