You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Cannot load translation for ..." error messages #2954
I am providing a service with only some languages. When my translations lie in the regular directory /usr/share/locale/ every time starting the service 217 error messages are logged:
…
Cannot load translation for 'ps': [Errno 2] No such file or directory: '/usr/share/locale/ps/LC_MESSAGES/foo.mo'
Cannot load translation for 'is': [Errno 2] No such file or directory: '/usr/share/locale/is/LC_MESSAGES/foo.mo'
Cannot load translation for 'az': [Errno 2] No such file or directory: '/usr/share/locale/az/LC_MESSAGES/foo.mo'
Cannot load translation for 'an': [Errno 2] No such file or directory: '/usr/share/locale/an/LC_MESSAGES/foo.mo'
Cannot load translation for 'fa': [Errno 2] No such file or directory: '/usr/share/locale/fa/LC_MESSAGES/foo.mo'
Cannot load translation for 'ta': [Errno 2] No such file or directory: '/usr/share/locale/ta/LC_MESSAGES/foo.mo'
Cannot load translation for 'en_GB': [Errno 2] No such file or directory: '/usr/share/locale/en_GB/LC_MESSAGES/foo.mo'
There is no way to suppress them or specify a list of languages to load.
Yeah, that makes sense. The gettext support was implemented with the assumption that you'd use an application-specific directory with only your languages, but it should be able to work in shared directories by skipping ones where the expected file is missing.
Activity
spaceone commentedon Nov 13, 2020
Maybe consider this patch, which only finds existing files?:
bdarnell commentedon Nov 19, 2020
Yeah, that makes sense. The gettext support was implemented with the assumption that you'd use an application-specific directory with only your languages, but it should be able to work in shared directories by skipping ones where the expected file is missing.
spaceone commentedon Nov 19, 2020
OK. I can create a PR with that patch then.
Issue tornadoweb#2954: prevent logging error messages for not existin…
spaceone commentedon Nov 19, 2020
PR #2956
Issue tornadoweb#2954: prevent logging error messages for not existin…
Issue tornadoweb#2954: prevent logging error messages for not existin…
PR (#1)
Issue tornadoweb#2954: prevent logging error messages for not existin…