Allow users to search for works and bookmarks by language short name

Description

This issue applies to the following search fields:

  • "Work Search" in the header

  • "Search within results" in the work filters

  • "Any Field" on the work search page

  • "Any field on work" on the bookmark search page

  • "Search within results" in the bookmark filters

Currently, if you'd like to search by language using any of the above fields, you need to use the syntax language_id: 1, where the number corresponds to the id of the Language in the database.

To make this more user-friendly, we'd like to make it so you can enter either language_id: en (where en is the Language short name) or language_id: 1 to get all English works. (The latter is necessary to avoid breaking bookmarked searches.)

We’ll need to reindex all works so the language_id field uses the short name. This is necessary to avoid and allow users to search for works in multiple languages, e.g. language_id: en OR language_id: zh to get works in either English or Chinese.

Note that if you use the old numerical id (language_id: 1) in your search, you should see the new short name (language_id: en) in the search field after performing your search.

How to test:

  1. Check that the language dropdown still works as expected in the work search page and on the work filters.

  2. Check that the language dropdown still works as expected in the bookmark search page and on the bookmark filters.

  3. Check that the field "Search within results" in work filters work by using the language_id hidden search operator.

    1. You can filter for 1 language with language_id: X.

    2. You can filter for multiple languages with language_id: X OR language_id: Y

  4. Repeat 3 for "Any Field" on the work search page.

  5. Repeat 3 for "Any field on work" on the bookmark search page.

  6. Repeat 3 for "Search within results" in the bookmark filters.

The hidden search operator should handle both new arguments (language short names) and old arguments (language database IDs). Here are some you can use:

en 1
ru 30
es 9
fr 8
it 13
de 7
zh 40
pl 19
pt 20
id 38
cs 5
ko 35
tr 24
hu 16
ja 36
he 33
fi 23

Activity

Show:
GoldenFalls
September 19, 2019, 12:44 PM

Hmm currently it appears like series can only have one language even if they contain works with more than one language. :/

Rebecca Sentance
September 19, 2019, 11:17 PM

Tested on Windows 10, Chrome browser:

  • Language filtering using the Search Within Results field on works filters works with both short codes and numbers, including a mixture of both. Works with NOT and OR searches as well (and with or without the space before the colon, in case anyone wanted to know xD)

  • Same with work search => Any Field, no issues

  • Same with bookmark search => Any Field

  • Same with bookmark filtering. Everything checks out!

Rebecca Sentance
September 19, 2019, 11:28 PM

I’ve also tested the work filtering with Search Within Results field and work search => Any Field filtering on Android, DuckDuckGo browser. Language filtering with short codes using both NOT and OR searches, with one language or multiple, seems fine! I’ll come back later and do bookmarks on mobile.

Sarken
September 25, 2019, 12:30 PM

Just leaving two quick notes regarding the above comments:

  • series can only have one language, so that checks out (it’ll be the language of the first work by id)

  • it’s okay if this doesn’t get tested in multiple browsers

Sarken
September 26, 2019, 12:14 PM
Edited

redsummernight 4 minutes ago
we need a second tester for these 2 things:

Check that the language dropdown still works as expected in the work search page and on the work filters.

Check that the language dropdown still works as expected in the bookmark search page and on the bookmark filters.

  • Searched for G-rated crossovers in Spanish and that’s what I got. Spanish was still selected when I clicked Edit Your Search.

  • Filtered Explicit works to only those in French; got the expected results. Was also able to filter works further (e.g. by excluding certain warnings) and the language filter remained in place, with the language selected the whole time.

  • Searched forbookmarked series in Italian and got expected results. Editing my search showed Italian still selected. Searching for recced Italian works also worked.

  • Filtered the Humor bookmarks to only those in Russian and got expected results, including bookmarks of both works and series, with Russian remaining selected in the filters. Filtered further to only include bookmarks with notes and that worked fine, too.

Looks good!

DeployedToBeta

Assignee

redsummernight

Reporter

Sarken

Roadmap

Bookmarks
Internationalization
Search
Works

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9