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

Fix missing translation in pagination gap tags #24262

Merged
merged 4 commits into from
Mar 29, 2023

Conversation

mgmn
Copy link
Contributor

@mgmn mgmn commented Mar 26, 2023

Fix for #24261, where i18n of paginator's gap is fallbacks or displayed as translation missing error "Truncate".

per_page: number of items to fetch per page
remote: data-remote
%span.page.gap
= sanitize t('pagination.truncate')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the sanitize call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pagination.truncate is already translated as … in many locales.
If omit it, the gap will shown as "…".

truncate: "…"

Copy link
Contributor Author

@mgmn mgmn Mar 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but sanitize allows some of HTML tags...
Would it be better to call sanitize t('pagination.truncate'), tags: [], attributes: [] to disallow them?

Copy link
Contributor Author

@mgmn mgmn Mar 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app/views/kaminari/_gap.html.haml Outdated Show resolved Hide resolved
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
@mgmn mgmn requested a review from Gargron March 29, 2023 09:09
@ClearlyClaire ClearlyClaire merged commit 9c84563 into mastodon:main Mar 29, 2023
@mgmn mgmn deleted the fix-kaminari-missing-translation branch March 29, 2023 13:28
arachnist pushed a commit to arachnist/mastodon that referenced this pull request Apr 4, 2023
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
skerit pushed a commit to 11ways/mastodon that referenced this pull request Jul 7, 2023
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants