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

strings in the query-suggestions and recent-searches plugins cannot be translated without replacing entire template #1282

Closed
justinedelson opened this issue Oct 31, 2024 · 3 comments · Fixed by #1283

Comments

@justinedelson
Copy link
Contributor

Description

While autocomplete-js allows for the submit/clear button strings to be localized externally, there are strings in the query-suggestions and recent-searches plugins that cannot be localized.

recent-searches

  • Remove this search
  • Fill query with "${item.label}"

query-suggestions

  • Fill query with "${item.query}"

Reproduction

There's not really a way to reproduce this cleanly since it is a gap in the API of these plugins.

Expected behavior

Plugins should allow for localized strings to be provided.

Environment

  • OS: any
  • Browser: any
  • Autocomplete version: latest
@justinedelson justinedelson changed the title strings in the query-suggestions and recent-searches plugins cannot be translated strings in the query-suggestions and recent-searches plugins cannot be translated without replacing entire template Nov 1, 2024
@Haroenv
Copy link
Contributor

Haroenv commented Nov 4, 2024

That's a good point. Would you be willing to add a translations option as is the case for core? It was originally introduced in #581 for reference

@justinedelson
Copy link
Contributor Author

Would you be willing to add a translations option as is the case for core?

Sure. Would you prefer one PR for both plugins or a separate PR per plugin?

@Haroenv
Copy link
Contributor

Haroenv commented Nov 4, 2024

One PR with tests for both plugins will be sufficient, thanks!

justinedelson added a commit to justinedelson/autocomplete that referenced this issue Nov 4, 2024

Verified

This commit was signed with the committer’s verified signature.
davidism David Lord
…hes plugins

Closes algolia#1282
@Haroenv Haroenv closed this as completed in 572cd3c Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants