Repository navigation
feat(decks): give 17 label decks Korean, German, Spanish and French card text from Wikidata - #294
Merged
Merged
Conversation
ixuz
enabled auto-merge
October 24, 2026 19:19
Most library cards are in English and Swedish only, though many are labels of well-known things that Wikidata names in every language the app speaks, under CC0 like the decks. scripts/wikidata_labels.py makes a deck's next version with its cards in Korean, German, Spanish and French as well, from those labels, keeping the English and Swedish text as it is. A checked-in mapping per deck (scripts/wikidata-labels/<deck>.json) says which items each card is about, once, so nothing is guessed again; text built from several parts is a frame written in each language. A card may refuse a label that is wrong for it, such as a species' former scientific name, until it is mended on Wikidata. Each card names its items as dcterms:subject. A version records the script's commit and checksum, the mapping's checksum, the command line and the revision of every item read, and --verify makes its cards again from those revisions, byte for byte. The requests are serial, batched, cached and sent with an honest User-Agent. They send no maxlag, which on Wikidata counts the query service's lag and refused every read for over an hour while this was written. A weekly workflow runs --verify; it never gates a pull request, and passes with a warning when Wikidata cannot be reached. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but every country and capital in English or Swedish. Version 4 of capitals-of-the-world adds those four languages to the cards from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of each card to its country and capital, with the capital taken from the country's own capital statement (P36). A three-capital answer is a frame written in each language. 237 of the 243 cards have Korean, 239 German, 236 Spanish and 240 French. The rest lack a label, or refuse one that is wrong for the card (a former or self-proclaimed name, a literal translation of a proper name, a district for its city), until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of world-currencies in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each country and its currency, the currency taken from the country's own currency statement (P38) by the ISO code on the card. Of the 193 cards, 191 have Korean, 190 German, 183 Spanish and 192 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of periodic-table in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each element's name on the back; the symbol on the front stays as it is. Of the 118 cards, 118 have Korean, 118 German, 118 Spanish and 118 French. Every card has all four. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of solar-system in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers the planets, moons, dwarf planets and belts the cards name, with the questions around them written once as frames in each language; the eight "Nth planet from the Sun" fronts and the other descriptive fronts stay as they are. Of the 52 cards, 51 have Korean, 44 German, 52 Spanish and 48 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of constellations in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each constellation's name on the back; the Latin name on the front stays as it is. Of the 88 cards, 88 have Korean, 85 German, 84 Spanish and 88 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of eu-member-states in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each country, inside its question written once as a frame in each language; the year on the back stays as it is. Of the 48 cards, 48 have Korean, 48 German, 48 Spanish and 48 French. Every card has all four. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of us-states-and-capitals in English or Swedish. Version 4 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each state and its capital, the capital taken from the state's own capital statement (P36). Of the 50 cards, 50 have Korean, 50 German, 50 Spanish and 50 French. Every card has all four. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of federal-states-and-capitals in English or Swedish. Version 4 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each state and its capital, the capital taken from the state's own capital statement (P36). Of the 46 cards, 46 have Korean, 44 German, 45 Spanish and 46 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
… languages Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of highest-points-of-europe in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each country, inside its question written once as a frame in each language, and its highest point, from the country's own statement (P610). Of the 40 cards, 25 have Korean, 39 German, 38 Spanish and 40 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of world-rivers in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each river and the water it flows into, from the river's own mouth statement (P403). Of the 50 cards, 45 have Korean, 50 German, 49 Spanish and 49 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of famous-buildings in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each building and its architects, from the building's own architect statement (P84). Of the 50 cards, 29 have Korean, 46 German, 47 Spanish and 46 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
…nguages Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of nordic-world-heritage-sites in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each site and its country or countries. Of the 44 cards, 23 have Korean, 39 German, 34 Spanish and 39 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of nordic-birds in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each species' common name on the front; the scientific name on the back stays as it is, and a label that is a scientific name, now or formerly, is not taken for a translation. Of the 86 cards, 74 have Korean, 66 German, 28 Spanish and 85 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of nordic-fish in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each species' common name on the front; the scientific name on the back stays as it is, and a label that is a scientific name, now or formerly, is not taken for a translation. Of the 55 cards, 18 have Korean, 55 German, 10 Spanish and 38 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of nordic-mammals in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each species' common name on the front; the scientific name on the back stays as it is, and a label that is a scientific name, now or formerly, is not taken for a translation. Of the 63 cards, 63 have Korean, 61 German, 11 Spanish and 29 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the cards of nordic-trees in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each species' common name on the front; the scientific name on the back stays as it is, and a label that is a scientific name, now or formerly, is not taken for a translation. Of the 46 cards, 24 have Korean, 46 German, 2 Spanish and 25 French. The rest lack a label in that language, or refuse one that is wrong for the card, until Wikidata mends it. English and Swedish text is unchanged, and every card names its items as dcterms:subject. Refs: #284
The releases test checked that deleting an instance keeps its release with a GET whose body it never read. Once the release document grew past 64 KiB (the brightest stars' next version describes every earlier version, and the deck's version 3 makes it about 70 KB), the unread body filled the fetch's buffer and paused its parser; the server then closed the connection, which the harness asks of every request, and Node 24's undici failed an internal assertion outside any test (nodejs/undici#5360, fixed in undici 8). Every test passed, yet the pod jobs of the Community Solid Servers failed on the unhandled error. A HEAD request asks what the check needs, as the same test does a few lines up, and reads no body. Refs: #284
Someone studying in Korean, German, Spanish or French saw the app in their language but the brightest stars in English or Swedish. Version 3 adds those four languages from Wikidata's labels, made by scripts/wikidata_labels.py from a mapping of the cards to the items they name, which covers each star's constellation, and the star's own name where no language's label is its Bayer designation, which would give the answer away. All 52 cards have all four on what the mapping makes. English and Swedish text is unchanged, and every card names its items as dcterms:subject. The library-upgrade journey updates a copy of release 1 to the newest release, which is now release 3: the offer changes every card as well as the name, description and keywords, and lists both releases' notes. The Studio's panel lists the changed cards too, so its page object reads the notes from the panel's first list. Closes: #284
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
Goal 7 ("In your language") stopped at the deck list for most of the library: the app and every deck's title and description come in six languages, but the cards of label decks such as the capitals, currencies or elements were in English and Swedish only. Wikidata already names these things in every language the app speaks, under CC0 like the decks.
The script.
scripts/wikidata_labels.pymakes a deck's next version with its cards in Korean, German, Spanish and French as well, from the labels of the Wikidata items each card names. It is built likescripts/taxonomy_deck.py: standard library only, with tests (scripts/test_wikidata_labels.py) and a new section, Languages from Wikidata.scripts/wikidata-labels/<deck>.json, says which items each card is about, so nothing is guessed again on a later run. Text built from several parts ("Afghan afghani (AFN)", "Highest point of Albania", "Pretoria, Cape Town, and Bloemfontein") is a template or a frame written in each language. The mapping also translates the card labels ("Capital") and gives the next description.dcterms:subject.--verifymakes the cards again from those revisions, byte for byte.maxlag: on Wikidata it counts the query service's lag, which edits cause, and it refused every read for over an hour while this was written.--verifyweekly and by hand. When Wikidata cannot be reached, it warns and passes.The decks. Each gets one new version, in a commit of its own:
capitals-of-the-worldv4, thenworld-currencies,periodic-table,solar-system,constellations,eu-member-states,us-states-and-capitals,federal-states-and-capitals,highest-points-of-europe,world-rivers,famous-buildings,nordic-world-heritage-sites,nordic-birds,nordic-fish,nordic-mammals,nordic-treesandbrightest-starsv3.Other changes.
packages/solid/src/libraryImport.test.tspinned capitals v3 as the newest release; it now names v4.library-upgradejourney updates brightest-stars release 1 to the newest, now release 3. The offer changes every card as well as the name, description and keywords, and lists both releases' notes. The Studio's panel lists the changed cards too, so its page object reads the notes from the panel's first list.e2e/pod/src/releases.integration.test.tschecked that a deleted instance keeps its published release with a GET, and read only the status. Drafting brightest-stars v1's next version copies the descriptions of the series' other versions, so v3 grew that release from 63,675 bytes to 69,657 bytes, past 64 KiB. The unread body filled the fetch's buffer and paused its parser, and the server then closed the connection, as the harness asks of every request. Node 24's undici then failed an internal assertion outside any test (nodejs/undici#5360, fixed in undici 8). Every test passed, but the Community Solid Server pod jobs failed on the unhandled error. The test now asks with HEAD, as it does a few lines above (committest(pod): ask for a published release's head, not a body left unread).For the reviewer.
dcterms:languagenow lists a language once any of its cards has it, which feat(library): name and filter by the languages of a deck's cards #286's card-language filter shows. For example, Nordic trees lists Korean, though 24 of its 46 cards have it.Closes: #284
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. (npm run checkpasses on every commit;lint:reuse,crosscheck(276 of 276 documents conform),lint:workflowsandlint:commitspass too. The pod suites against CSS 6, CSS 7 and CSS ACP pass under Node 24 with no unhandled error.)npm run test:crosscheck; no package code changed.)docs/is listed in docs/docs.ttl. (A new section in deck-library.md and notes in testing.md; no new page.)packages/ui/src/i18n/). (n/a: no message changed.)ns/was agreed in an issue first; no publishedns/shapes/*/vN.ttlordecks/*/vN.ttlwas edited; generated files were regenerated, not edited. (ns/is unchanged; each deck gets a new version, anddecks/index.ttlwas written bynpm run library.)!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. (Only new deck versions and a script; no API changes.)maxlagis sent.)npm run lint:reuse), or a new deck its line inREUSE.toml; third-party content is credited. (Wikidata's labels are CC0, as the decks are, and each version names Wikidata as a source; the mappings are JSON, covered by REUSE.toml.)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).