-
Notifications
You must be signed in to change notification settings - Fork 3
Improve global search bar and search results page (CFM-220) #59
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,11 +87,20 @@ msgstr "Search limit reached" | |
msgid "search.none" | ||
msgstr "No results found" | ||
|
||
msgid "search.result.found" | ||
msgstr "Found: " | ||
|
||
msgid "search.result.found.people" | ||
msgstr "{0,plural,=1{1 person} other{{1} people}}" | ||
|
||
msgid "search.result.found.groups" | ||
msgstr "{0,plural,=1{1 group} other{{1} groups}}" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These localizations violate RTL ("Found: "), don't scale (are we going to have one key per model?) and create duplicate translations (vs Found
You'll then have two localizations:
For the latter, you'd build each entry via something like
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That approach for scaling the models is a great idea. Will do. The output is in list mode already (CSS is used to output the list inline, comma included) - and we could do the same for the colon on the "Found:" (i.e. use CSS to add it - allowing it to be easily overridden) - or just remove the colon ... which is probably better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in push 2d4c964 |
||
msgid "search.result.id" | ||
msgstr "({0})" | ||
msgstr "ID {0}" | ||
|
||
msgid "search.result.related" | ||
msgstr "({0}, {1}: {2})" | ||
msgstr "{0}: {1}, ID {2}" | ||
|
||
msgid "search.results" | ||
msgstr "Search Results" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,6 @@ | |
?> | ||
|
||
<?php if(!empty($message)): ?> | ||
<?= $this->Alert->alert(h($message), 'warning', true, __d('information','flash.default')) ?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to replace this with something else? ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Edited) I don't think so: the latest PHP filters documentation suggests using htmlspecialchars() over a number of filters that are now being deprecated and references it on some we've used that are not being deprecated. The implication seemed to be to favor htmlspecialchars() generally. Since Cake seems to favor this approach as well, it's reasonable to use this for most cases of output escaping. htmlspecialchars is a near equivalent to FILTER_SANITIZE_FULL_SPECIAL_CHARS - which is somewhat more aggressive than the FILTER_SANITIZE_SPECIAL_CHARS we've been using previously. I'm somewhat on the fence on this - because I do like the verbosity and standardization on filter_var - but I think the h() approach is probably simpler and easier to read. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note also that the messages are being output escaped prior to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to leave this unchanged for now, but I'm happy to discuss and/or be persuaded. As noted, I'm a little on the fence with this, but h() (or even htmlspecialchars()) seems a better way to go except in special cases (such as FILTER_SANITIZE_URL). |
||
<?= $this->Alert->alert($message, 'warning', true, __d('information','flash.default')) ?> | ||
<?php endif; ?> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in
result.po
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'll move it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in push 2d4c964