Summary: | Add configuration for excluding articles from jQuery table sorter | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | I18N/L10N | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | gmcharlt, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | |||
Bug Blocks: | 7019, 10716 | ||
Attachments: |
Bug 5766 - Add configuration for excluding articles from DataTables sorting
Bug 5766 - Add configuration for excluding articles from DataTables sorting [PASSED QA] Bug 5766 - Add configuration for excluding articles from DataTables sorting |
Description
Owen Leonard
2011-02-16 15:04:54 UTC
Owen, could we do something similar with databales? Created attachment 19380 [details] [review] Bug 5766 - Add configuration for excluding articles from DataTables sorting Client-side table sorting should exclude articles like "a," "an," and "the" when sorting by title. This patch adds a custom sorting plugin for use by DataTables and a configuration line to the DataTables string configuration file which can be translated for any language. As an example, this patch modifies the patron checkout history template to use the new sort on the title column. To test, apply the patch and clear your browser cache to ensure the revised JavaScript file is loaded. Sort the table by title. Titles should be sorted regardless of the presences of "a," "an", or "the" at the beginning of the title. Created attachment 19438 [details] [review] Bug 5766 - Add configuration for excluding articles from DataTables sorting Client-side table sorting should exclude articles like "a," "an," and "the" when sorting by title. This patch adds a custom sorting plugin for use by DataTables and a configuration line to the DataTables string configuration file which can be translated for any language. As an example, this patch modifies the patron checkout history template to use the new sort on the title column. To test, apply the patch and clear your browser cache to ensure the revised JavaScript file is loaded. Sort the table by title. Titles should be sorted regardless of the presences of "a," "an", or "the" at the beginning of the title. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 19463 [details] [review] [PASSED QA] Bug 5766 - Add configuration for excluding articles from DataTables sorting Client-side table sorting should exclude articles like "a," "an," and "the" when sorting by title. This patch adds a custom sorting plugin for use by DataTables and a configuration line to the DataTables string configuration file which can be translated for any language. As an example, this patch modifies the patron checkout history template to use the new sort on the title column. To test, apply the patch and clear your browser cache to ensure the revised JavaScript file is loaded. Sort the table by title. Titles should be sorted regardless of the presences of "a," "an", or "the" at the beginning of the title. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and is a good improvement. I have added German articles to the list for testing purposes and it worked nicely. After giving this some more thought it would be nice if this could be in the configuration. Being able to translate the string and influence sorting this way is a good start, but maybe not flexible enough. For libraries with records in multiple languages they will want to have a longer list they can adjust and not only a translation for one language. Pushed to master. Thanks, Owen! However, I agree with Katrin that the translation subsystem isn't necessarily the best place to configure this, for a couple reasons. First, the language of the catalog interface does not necessarily reflect all of the languages that may be present in the bib data, and I can see a translator not getting the point of translating a list of articles in Pootle. I would lean towards either a system preference or even a separate table that contains a list of articles (which would be useful in other contexts, e.g., a bib editor plugin that sets the non-filing indicator automatically). However, since such configuration hooks can readily be put in later, I've decided to push the patch as is. This patch has been pushed to 3.12.x, will be in 3.12.4. Thanks Owen! |