bundles/basic: support setting a different default locale

This commit is contained in:
Franzi 2021-02-18 14:51:33 +01:00
parent 18572d56e6
commit f4a644795e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
5 changed files with 30 additions and 9 deletions

View file

@ -1 +1 @@
LANG=en_US.UTF-8
LANG=${node.metadata['locale']['default']}

View file

@ -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

View file

@ -2,6 +2,7 @@
files = {
'/etc/default/locale': {
'content_type': 'mako',
'needs': {
'action:locale-gen',
},

22
bundles/basic/metadata.py Normal file
View file

@ -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'),
},
},
}

View file

@ -137,12 +137,12 @@ nodes['htz.ex42-1048908'] = {
'part.of.the.trans-agenda.eu': set(),
},
},
'locales': {
# because scripts need to generate german date outputs
'de_DE.UTF-8',
'locale': {
'installed': {
# legacy
'en_DK.UTF-8',
},
},
'matrix-media-repo': {
'version': 'v1.2.2',
'homeservers': {