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

Allow user to configure result messages #337

Open
glepretre opened this issue Jan 16, 2023 · 1 comment
Open

Allow user to configure result messages #337

glepretre opened this issue Jan 16, 2023 · 1 comment
Labels
fixed-in-upcoming-release This ticket is fixed, and will be closed when an upcoming version of Stork is released. improvement-request Request for new or enhanced behavior.

Comments

@glepretre
Copy link

User can currently configure the result noun, singular and plural:

resultNoun: { singular: "file", plural: "files" },

But this noun is used in hardcoded sentences:

stork/js/entity.ts

Lines 47 to 58 in de70fb0

return "Error! Check the browser console.";
} else if (this.state != "ready") {
return "Loading...";
} else if (query?.length < this.config.minimumQueryLength) {
return "Filtering...";
} else if (this.results) {
if (this.totalResultCount === 0) {
return `No ${this.config.resultNoun.plural} found.`;
} else if (this.totalResultCount === 1) {
return `1 ${this.config.resultNoun.singular} found.`;
} else {
return `${this.totalResultCount} ${this.config.resultNoun.plural} found.`;

image

Would it be possible to configure these messages too?

Our use case is to simply translate them, for a French only website.

@jameslittle230
Copy link
Owner

Thanks for the request! I'm almost entirely focused on Stork 2.0.0 now, and I'm excited to say that this feature will be available in the 2.0.0 release.

@jameslittle230 jameslittle230 added improvement-request Request for new or enhanced behavior. fixed-in-upcoming-release This ticket is fixed, and will be closed when an upcoming version of Stork is released. labels Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-upcoming-release This ticket is fixed, and will be closed when an upcoming version of Stork is released. improvement-request Request for new or enhanced behavior.
Projects
None yet
Development

No branches or pull requests

2 participants