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

per-column filter input placeholder does not respect lang attribute of its b:datatable #434

Closed
susanne69 opened this issue Jun 22, 2016 · 9 comments
Assignees
Milestone

Comments

@susanne69
Copy link

Hi,

I am using Bundle-Version: 0.8.6, Bundle-Date: 20160522-21:44:31.
My b:datatable has the attribute lang set to "de",the per-column filter input fields show as placeholder the English translation though.

Kind regards,
susanne69

@zhedar zhedar added the bug label Jun 22, 2016
@zhedar
Copy link
Collaborator

zhedar commented Jun 22, 2016

You're right, the search fields placeholders seem to be Search [FIELDNAME] and therefore aren't localized:
bildschirmfoto 2016-06-22 um 21 13 36

Maybe we forgot to include them in the localization files or it even is a bug of the datatables component itself. After having a quick look at https://datatables.net/manual/i18n it rather seems that those fields may not be included in the component though.

@susanne69
Copy link
Author

That might be the reasonable solution not to show the placeholder if not specified or not attempted to be altered.

Thank you for having a look at it.

@stephanrauh
Copy link
Collaborator

Yes, the word "search" is "hard coded" in the DataTableRenderer. So we should find a nice, flexible and future-proof solution. Among other things, the correct translation in German is "nach [FELDNAME] suchen". So we need some extra flexibility with regard to the word order. Plus, we need i18n files specific to BootsFaces. But I don't see how we can support more than half a dozen languages.

@stephanrauh stephanrauh self-assigned this Jun 22, 2016
@stephanrauh stephanrauh added this to the v0.9.1 milestone Jun 22, 2016
@zhedar
Copy link
Collaborator

zhedar commented Jun 22, 2016

Actually it would be "[FELDNAME] durchsuchen", wouldn't it? Probably we could also recycle the search field translation and append the field's name to it. We may check if this introduces any problems with some languages, but may still be viable.

@stephanrauh
Copy link
Collaborator

@susanne69 Yes, that may be a solution that suits the needs of most developers:

  • add an option to suppress the placeholder completely
  • add an option to replace the word "Search" by something user-specific.
    That still means the application doesn't react properly to the browsers locale, but I suppose hardly anybody will notice.

@zhedar
Copy link
Collaborator

zhedar commented Jun 22, 2016

Another solution would be to drop to literal part completely and use a symbolic term for search. However, I'm not sure, how that works out. See http://stackoverflow.com/questions/12036038/is-there-unicode-glyph-symbol-to-represent-search

@stephanrauh
Copy link
Collaborator

@zhedar Dunno. If the column was a city, the placeholder would be "Stadt durchsuchen". Which sounds like leaving the house and looking everywhere in the city :).

Be that as it may, the i18n file could look like so:

bootsfaces.datatable.search="nach %1 filtern"

The %1 being a placeholder that may be moved around freely.

@stephanrauh stephanrauh modified the milestones: v1.0.0, v0.9.1 Jul 10, 2016
@TheCoder4eu TheCoder4eu modified the milestones: v1.1.0, v1.0.0 Oct 29, 2016
@stephanrauh
Copy link
Collaborator

@zhedar The symbolic search approach sounds promising. We could simply use fa-search.

stephanrauh added a commit that referenced this issue Jan 27, 2017
@stephanrauh
Copy link
Collaborator

I've implemented the solution using symbols instead of texts.

@stephanrauh stephanrauh moved this from TO DO to DONE in BootsFaces v1.1.0 Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants