jinja icon indicating copy to clipboard operation
jinja copied to clipboard

Configurable behavior when translated string interpolation fails.

Open ewdurbin opened this issue 3 years ago • 0 comments

Similar to #421 when translation strings are not kept perfectly up to date, changes to the names of variables in strings can break behavior on a site. I'd like to see some way to manage this behavior via a policy similar to the ext.i18n.trimmed that would fallback to the untranslated string in scenarios where KeyError is raised.

PyPI.org's codebase (pypi/warehouse) is translated by volunteers, so occasionally when we change our templates to use new or different variable names translations fall out of sync and raise errors when trying to render them.

Our work around is pretty fragile: https://github.com/pypi/warehouse/commit/94d9503551002fd7806bb27a675c80e747513841#diff-8125a22a065160a5ac02ff19f3dc404a6d92ecfdf31b496dc9446120f59eb6ff

ewdurbin avatar Nov 17 '22 18:11 ewdurbin