Commit 1f549ffc authored by segfault's avatar segfault
Browse files

Don't add languages from /usr/share/i18n/SUPPORTED to the Greeter (refs: #16095)

We only want to support a curated list of languages in the Greeter.
parent 54ba104b
#! /bin/sh
set -e
set -u
echo "Set up greeter language codes"
# Extract language codes from the supported locales
perl -n -E 'next unless m{_}xms; \
next if m{\@}xms; \
say $1 if m{(.*?) [. ]}xms' \
/usr/share/i18n/SUPPORTED \
| uniq \
> /usr/share/tails-greeter/language_codes
......@@ -26,13 +26,9 @@ LUSER = 'amnesia'
# data path
data_path = '/usr/share/tails-greeter/'
# File where supported language codes (such as en_US) are stored
# while building the tails-greeter binary package
# File containing the language codes that are supported by the greeter
language_codes_path = os.path.join(data_path, 'language_codes')
# File where default language code for languages are stored
default_langcodes_path = os.path.join(data_path, 'default_langcodes')
# Locales path
locales_path = '/usr/share/locale/'
......
......@@ -799,12 +799,8 @@ class LocalisationSettings(object):
self.__actusermanager.disconnect(self.__actusermanager_loadedid)
def __get_langcodes(self):
with open(tailsgreeter.config.default_langcodes_path, 'r') as f:
defcodes = [line.rstrip('\n') for line in f.readlines()]
with open(tailsgreeter.config.language_codes_path, 'r') as f:
langcodes = [line.rstrip('\n') for line in f.readlines()]
logging.debug('%s languages found', len(langcodes))
return defcodes + langcodes
return [line.rstrip('\n') for line in f.readlines()]
def __on_usermanager_loaded(self, manager, pspec, data=None):
logging.debug("Received AccountsManager signal is-loaded")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment