[Bug 39118] New: Make facet labels translatable
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Bug ID: 39118 Summary: Make facet labels translatable Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: caroline.cyr-la-rose@inlibro.com QA Contact: testopia@bugs.koha-community.org Bug 35138 made adding or modifying facets much easier. However, and it was pointed out at the start of the bug report, user-created facets (or user-modified facets) aren't translatable. It would be great if we could have a way of translating them (without using the JS hack). To recreate: 1. Make sure your installation is using ElasticSearch (if using ktd, do `ktd --es7 up` or `ktd --es8 up`) 2. Make sure your installation has at least two languages 2.1. Install new language ktd --shell --root koha-translate --install fr-CA --dev kohadev 2.2. Go to Administration > System preferences 2.3. Search for languages 2.4. Check the new language in OPACLanguages and StaffInterfaceLanguages 2.5. Click 'Save all I18N/L10N preferences' 3. Add a facet (for example, Genre/Form on 655$a in MARC21) 3.1. Go to Administration > Search engine configuration (Elasticsearch) 3.2. In the 'Search fields' tab, find index-term-genre 3.3. Change the label to 'Genre/Form' 3.4. Click 'Save' 3.5. Go to the 'Bibliographic records' tab 3.6. In the last row of the 'Facet order' table, choose 'index-term-genre' 3.7. Click 'Add' 3.8. Click 'Save' 3.9. Go to the 'Bibliographic records' tab again 3.10. Find index-term-genre and change 'Facetable' to 'Yes' 3.11. Click 'Save' 4. Reindex ktd --shell ./misc/search_tools/rebuild_elasticsearch.pl -b -v -d (DO NOT USE -r or all your work in step 3 will be lost :((( ) 5. Search for "comedy" in the staff interface catalog --> The new facet is there with its label "Genre/Form" 6. Switch the interface to the other language 7. Redo step 5 --> The new facet's label is not translated 8. Search for "comedy" in the staff OPAC catalog --> The new facet is there with its label "Genre/Form" 9. Switch the OPAC to the other language 10. Redo step 8 --> The new facet's label is not translated Note: "Hardcoded" facets, such as Authors, Topics, etc. are currently translatable. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |35138 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35138 [Bug 35138] Enable configuration of facets with Elasticsearch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com Depends on| |38136 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- We need bug 38136 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38136 [Bug 38136] Refactor database translations (alternative) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Koha collecto <koha@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@collecto.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Anneli Österman <anneli.osterman@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anneli.osterman@koha-suomi. | |fi --- Comment #2 from Anneli Österman <anneli.osterman@koha-suomi.fi> --- We could really need this one because we have added many facets of our own. :) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |roman.dolny@jezuici.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 42187 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clemens.tubach@kit.edu, | |lukasz.koszyk@kit.edu, | |michaela.sieber@kit.edu --- Comment #4 from Michaela Sieber <michaela.sieber@kit.edu> --- The dependent enhancement Bug 38136 - Refactor database translations was pushed to main -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38460 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
Item types > Edit > Translate into other languages).
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39118 --- Comment #5 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207980&action=edit Bug 39118: Make facet labels translatable The labels of the Elasticsearch facets come from search_field.label. Only the labels of the default facets are translatable, because they are hardcoded in the facets templates. The label of a facet added or modified by the user is always displayed as it is. This patch uses the database translations of bug 38136 for the search field labels: - The search fields are deleted and recreated each time the Elasticsearch mappings are saved, so their id changes. The translations are attached to the search field name instead. The localization component now stores the column passed to localization_add_relationships and uses it instead of the primary key. - The localization cache of an entity was built with the translations of all entities. It is now built with the translations of this entity only. - The translation page and service required manage_itemtypes for any entity. Each localizable result class now declares the permission needed with localization_permission: manage_search_engine_config for the search fields. An unknown source gives a 404 (page) or an error (service). - The facet order table of the Elasticsearch configuration page has a "Translate into other languages" link for the facets with a custom label. - The facets of the staff interface and of the OPAC show the translated label for these facets. The "Return to item type" button of the translation page was never displayed (it tested an undefined variable): it is fixed, and a "Return to search engine configuration" button is added for the search fields. Test plan: 1. Start KTD with Elasticsearch (ktd --es8 up) and install a second language: ktd --shell --root koha-translate --install fr-CA --dev kohadev Enable it in OPACLanguages and StaffInterfaceLanguages. 2. Go to Administration > Search engine configuration (Elasticsearch): - Search fields tab: change the label of index-term-genre to 'Genre/Form' - Bibliographic records tab: add index-term-genre to the facet order table, set it facetable, and save. 3. Reindex: misc/search_tools/rebuild_elasticsearch.pl -b -v -d 4. Search for "comedy" in the staff interface and the OPAC, in English and in French: the facet is labeled 'Genre/Form' in both languages. 5. Apply the patch, restart_all. 6. On the Bibliographic records tab, click "Translate into other languages" under 'Genre/Form' in the facet order table. Add the fr-CA translation 'Genre/Forme'. 7. Repeat 4: the facet is labeled 'Genre/Forme' in French, and still 'Genre/Form' in English. 8. Save the Elasticsearch mappings again, and repeat 7: the translation is kept. 9. Check that the translations of item types still work (Administration 10. With a staff user having manage_search_engine_config but not manage_itemtypes, check that the search field labels can be translated, but not the item type descriptions. 11. prove t/db_dependent/Koha/SearchField.t \ t/db_dependent/Koha/ItemTypes.t \ t/db_dependent/Koha/SearchEngine/Elasticsearch/Search.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org