securedrop
securedrop copied to clipboard
`UnknownLocalError` on for Occitan (`oc`)
Description
Despite the apparent resolution of python-babel/babel#553 in Babel 2.6.0, Occitan (oc) raises babel.core.UnknownLocaleError: unknown locale 'oc'.
Steps to Reproduce
make dev on securedrop-i18n@i18n.
Expected Behavior
The development environment starts without error.
Actual Behavior
Traceback (most recent call last):
File "./manage.py", line 452, in <module>
_run_from_commandline()
File "./manage.py", line 442, in _run_from_commandline
rc = args.func(args)
File "./manage.py", line 99, in reset
with context or app_context():
File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
return next(self.gen)
File "/home/user/securedrop/securedrop/management/__init__.py", line 11, in app_context
with journalist_app.create_app(config).app_context():
File "/home/user/securedrop/securedrop/journalist_app/__init__.py", line 92, in create_app
i18n.configure(config, app)
File "/home/user/securedrop/securedrop/i18n.py", line 200, in configure
usable_locales = validate_locale_configuration(config, babel)
File "/home/user/securedrop/securedrop/i18n.py", line 138, in validate_locale_configuration
available = set(babel.list_translations())
File "/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/flask_babel/__init__.py", line 155, in list_translations
result.append(Locale.parse(folder))
File "/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/babel/core.py", line 331, in parse
raise UnknownLocaleError(input_id)
babel.core.UnknownLocaleError: unknown locale 'oc'
make: *** [Makefile:239: dev] Error 1
Comments
Since oc is currently only 21% translated, this is not a blocker for #6798; just a consequence of #6557 that will need to be addressed by freedomofpress/securedrop-engineering#30.
freedomofpress/securedrop-dev-docs#85 teaches us that we'll get support for oc when we update to babel>=2.10 for CLDR ≥ 41.