more locales
This commit is contained in:
parent
f6ac34dfd0
commit
5b7c67815b
2 changed files with 23 additions and 5 deletions
bundles/locale
|
@ -1,8 +1,15 @@
|
||||||
locale = node.metadata.get('locale')
|
default_locale = node.metadata.get('locale/default')[0]
|
||||||
|
|
||||||
|
installed_locales = sorted([
|
||||||
|
node.metadata.get('locale/default'),
|
||||||
|
*node.metadata.get('locale/installed'),
|
||||||
|
])
|
||||||
|
|
||||||
files = {
|
files = {
|
||||||
'/etc/locale.gen': {
|
'/etc/locale.gen': {
|
||||||
'content': f"{locale} {locale.split('.')[1]}\n",
|
'content': '\n'.join(
|
||||||
|
f'{locale} {type}' for locale, type in installed_locales
|
||||||
|
),
|
||||||
'triggers': {
|
'triggers': {
|
||||||
'action:locale-gen',
|
'action:locale-gen',
|
||||||
},
|
},
|
||||||
|
@ -15,8 +22,8 @@ actions = {
|
||||||
'triggered': True,
|
'triggered': True,
|
||||||
},
|
},
|
||||||
'systemd-locale': {
|
'systemd-locale': {
|
||||||
'command': f'localectl set-locale LANG="{locale}"',
|
'command': f'localectl set-locale LANG="{default_locale}"',
|
||||||
'unless': f'localectl | grep -Fi "system locale" | grep -Fi "{locale}"',
|
'unless': f'localectl | grep -Fi "system locale" | grep -Fi "{default_locale}"',
|
||||||
'preceded_by': {
|
'preceded_by': {
|
||||||
'action:locale-gen',
|
'action:locale-gen',
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,5 +4,16 @@ defaults = {
|
||||||
'locales': {},
|
'locales': {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'locale': 'en_US.UTF-8',
|
'locale': {
|
||||||
|
'default': ('en_US.UTF-8', 'UTF-8'),
|
||||||
|
'installed': {
|
||||||
|
('de_AT.UTF-8', 'UTF-8'),
|
||||||
|
('de_CH.UTF-8', 'UTF-8'),
|
||||||
|
('de_DE.UTF-8', 'UTF-8'),
|
||||||
|
('de_LU.UTF-8', 'UTF-8'),
|
||||||
|
('en_CA.UTF-8', 'UTF-8'),
|
||||||
|
('en_GB.UTF-8', 'UTF-8'),
|
||||||
|
('en_US.UTF-8', 'UTF-8'),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue