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

There is no support for translating filter group names #2527

Open
LeXofLeviafan opened this issue Sep 26, 2024 · 0 comments
Open

There is no support for translating filter group names #2527

LeXofLeviafan opened this issue Sep 26, 2024 · 0 comments

Comments

@LeXofLeviafan
Copy link
Contributor

The filter operation names can be translated – there is code directly supporting that in the repo. The filter groups, however, are always handled as raw strings, preventing them from being translated.

There's no actual need to do so; in fact, the way they are used in the frontend allows to safely replace them with translated strings in HTML without affecting any backend handling (though doing so externally requires implementing some tricky JS code); they are inserted within raw JSON into the HTML which is then immediately used by the filters script (as keys in filter-groups-data, and the 2nd tuple field in active-filters-data), and for some reason are taken directly from the filters dropdown item caption on click.

I suggest modifying the generation code so that these changes are done at the time of code generation (or better yet, handle them as lazy strings when there's a need to do so).

P.S. I also suggest moving out the "extract lazy string key" logic into helpers (tools?), and possibly handling the strings with context as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants