Repository navigation
feat(library): name and filter by the languages of a deck's cards - #286
Merged
Merged
Conversation
The library showed a deck's title, description and keywords in the learner's language, but not the languages its cards are in, so a German or Korean learner found out only after adding a deck that its cards are in English and Swedish. The index already states them as dcterms:language; the app never read them. LibraryDeck now carries its current release's languages, read from the index and from a release added from a link. Each EU language IRI is mapped to a language tag in the domain (a test covers every entry of EU_LANGUAGES) and named in the app's language; one not on the list is left out. The library row, the deck's page and its preview name them, and a "Card languages" group of checkboxes keeps the decks whose cards are in every checked language, remembered like the topics. A new journey filters the library by Japanese. Closes: #282
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The library shows a deck's title, description and keywords in the learner's language, but not the languages its cards are in. A German or Korean learner who adds a deck finds out only afterward that its cards are in English and Swedish. The index already says which languages each release is in (
dcterms:language, IRIs from the EU's language table), but the app never read them.LibraryDeck.languagesholds the current release's EU language IRIs, in the order the release gives them. The list is empty when a release states none, since the shape does not require them.languageTagOf(domain/euLanguages.ts) maps each IRI to a language tag ("KOR" to "ko"), and a test covers every entry ofEU_LANGUAGES. An IRI that is not on the list is left out.toLibraryDecksandtoStandaloneLibraryDeckreaddcterms:language, so a deck added from a link has its languages too. The Studio's listing preview takes them from the draft.Intl.DisplayNames. The names appear on each library row next to the card count, on the deck's page ("Card languages") and in the preview ("Cards in English, Swedish."). A long list wraps on narrow screens.filterLibraryDeckstakeslanguagesnext totopicsandquery.library-languages.journey.ts, checks Japanese as a guest, finds only Basic Japanese, opens its page and finds the filter still set when it comes back.Nothing the app writes to a pod changes, and
ns/is untouched.Closes: #282
Checklist
Refs:, notCloses:. Leave this unchecked otherwise.npm run checkpasses (lint, Markdown and spelling included),npm run lint:reusetoo if a file was added, andnpm run crosschecktoo ifns/ordecks/changed. (crosscheck n/a: neitherns/nordecks/changed)docs/is listed in docs/docs.ttl. (no new page)packages/ui/src/i18n/).ns/was agreed in an issue first; no publishedns/shapes/*/vN.ttlordecks/*/vN.ttlwas edited; generated files were regenerated, not edited. (n/a:ns/and generated files unchanged)!and aBREAKING CHANGE:footer).npm run check:breakingsees a line ofapi/that goes, but not a feature removed, nor a reader that reads less than before.npm run lint:reuse), or a new deck its line inREUSE.toml; third-party content is credited.npm run dev) and tried the change, and considered the user journeys.type(scope): subject,!and aBREAKING CHANGE:footer if it breaks something), with an imperative subject and a body that explains why (CONTRIBUTING.md).