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

Add configuration option for search placeholder text #59

Closed
uncenter opened this issue Nov 17, 2024 · 5 comments · Fixed by #65
Closed

Add configuration option for search placeholder text #59

uncenter opened this issue Nov 17, 2024 · 5 comments · Fixed by #65

Comments

@uncenter
Copy link

CleanShot 2024-11-17 at 15 16 24

I'd like to able to configure/override this "Search by title, content and #tags" text easily in the configuration file.

@rothsandro
Copy link
Owner

What text would you use? Just to understand your use case.

I think we don't allow any text configuration at the moment (except for user generated content, like groups in the nav). Adding this to the configuration doesn't feel right. I would rather add support for translations in the whole app (but that's a bit more work).

@uncenter
Copy link
Author

This is for https://learn-eleventy.pages.dev/, I'd like to make it say "Search for lessons by title or content." which is how I have it on the deployed site. Updating at the minute and trying to avoid customizing .app as much this time.

@rothsandro
Copy link
Owner

Thanks for explanation, makes sense. I will see if adding translations is viable option.

@rothsandro rothsandro linked a pull request Nov 23, 2024 that will close this issue
@rothsandro
Copy link
Owner

I created a first prototype that adds translation to the search ui. With @ts-check enabled you'll get auto-complete for translation keys and the default translation value.

// @ts-check
import { defineTranslations } from "./.app/app-translations.js";

export const translations = defineTranslations({
  lang: "de",
  translations: {
    "search.input.placeholder": "Suchen...",
    "search.popover.placeholder": "Suche nach Titel, Inhalt und #tag",
    // ...
  },
});

@rothsandro
Copy link
Owner

Eleventy Notes v0.26.0 is released 🎉 It now supports translations for all UI elements. Read more about in the docs: https://eleventy-notes.sandroroth.com/n/features/language/

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 a pull request may close this issue.

2 participants