-
Notifications
You must be signed in to change notification settings - Fork 8
Labels
Description
Some languages are written only, some are spoken only, some a sign languages, some are a mix. People using LangNav may want to filter based on this.
See this annotated screenshot for more:

Instructions
Generally, this will behave very similarly to the feature that filters by Language Scope, you can use that as a template.
First take a look at the LanguageModality enum is here
1: Make a setting
Add a page parameter modalityFilter to store the setting
- Adding it to
PageParamsKey,PageParams, andPageParamsOptionalin https://github.com/Translation-Commons/lang-nav/blob/master/src/features/params/PageParamTypes.tsx#L63-L88 - Add a global default of empty (meaning to match any modality) in https://github.com/Translation-Commons/lang-nav/blob/master/src/features/params/Profiles.tsx
- Add to the URL params parsing logic in https://github.com/Translation-Commons/lang-nav/blob/master/src/features/params/getParamsFromURL.ts#L78 -- it's easy to miss this and you will have no idea it's not working!
2: Enable changing the setting
You will create a selector
- Follow LanguageScopeSelector as a template -- but you can probably ignore
getLanguageScopePluraland just return the text. - One exception here is that you will only want to show the first 6 options (from written to spoken to sign) for most objectTypes, only for Censuses will you wa
- Add it to the
SidePanel - Add it to the
FilterPath-- in this case you'll make a mini-selector, see what we do for LanguageScope -- however here you don't need to involvedefaultParams-- rather only show it when its non-empty.
If you would like, you can stop here and post the first of 2 PRs since you can verify the setting usage. Next we will implement it.
3: Filter languages with the setting
- In
filter.tsxyou will add a new functiongetFilterByModality-- it will function very similarly togetFilterByLanguageScope - Just like
getFilterByLanguageScope-- you will only every actively filter languages or locales (based on their languages) - Then you will add it to
getScopeFilter-- now all major filter usages will use this modality filter!
0: Add it to the filter breakdown
We'll make this a separate task