Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnknownLocalError on for Occitan (oc) #6869

Open
cfm opened this issue Jun 22, 2023 · 1 comment
Open

UnknownLocalError on for Occitan (oc) #6869

cfm opened this issue Jun 22, 2023 · 1 comment
Labels
blocked on upstream i18n Anything related to translation or internationalization of SecureDrop

Comments

@cfm
Copy link
Member

cfm commented Jun 22, 2023

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.

@cfm cfm added bug i18n Anything related to translation or internationalization of SecureDrop labels Jun 22, 2023
@cfm cfm changed the title UnknownLocalError on for Occitan oc UnknownLocalError on for Occitan (oc) Jun 22, 2023
@cfm
Copy link
Member Author

cfm commented Aug 16, 2023

freedomofpress/securedrop-dev-docs#85 teaches us that we'll get support for oc when we update to babel>=2.10 for CLDR ≥ 41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked on upstream i18n Anything related to translation or internationalization of SecureDrop
Projects
None yet
Development

No branches or pull requests

1 participant