WIP: migrate Ultimate Geography to Rust Brain Brew rewrite with federation#736
WIP: migrate Ultimate Geography to Rust Brain Brew rewrite with federation#736jeprecated wants to merge 6 commits into
Conversation
|
Example of a single translation PR in this new system, here's the outstanding PR #735 converted into this new system: jeprecated#16 If any strings were missed in the translation overlay it would throw an error 👌 When we make changes to the base English deck all those strings will throw errors for each language (which is the correct behaviour!). |
|
Wow! This looks like a huge amount of work! I wish my review below were more positive, but at the moment I'm not convinced that this is a net improvement. It enables things that are currently tricky (e.g. flexibly allowing different note types!) and AFAIU generally makes future extensibility easier. However, IMO it makes routine tasks that are currently straightforward more finicky and tedious. (OTOH it's possible that I'm misunderstanding how a new, improved workflow would work!) I greatly appreciate how you've continued working on this for so long and I'm generally very excited about improvements to our tooling! (Details/discussion below; I've been sitting on it for several weeks now, being hesitant to post the comment (sorry for the resultant delay!!), but I can't think of any particular improvements to the text.) YAMLI'm not sure that replacing everything with YAML is, on the whole, advantageous, and, if yes, I'm not convinced the proposed structure is most convenient. HTML/CSSFor the HTML/CSS files (deck descriptions and templates) it's IMO a minor but clear downgrade both for editing (one has to worry about proper indentation for the literal blocks) and discoverability (rather than being accessed via standard directory navigation one has to find the correct sub-key in the YAML). CSV vs. YAML(field data (old Both YAML and CSV have flaws as formats, so this comparison is much trickier. The new structure is far more verbose, but that's not necessarily a bad thing (being explicit is often valuable). (Though why do we need Both CSV and YAML have their annoying quoting idiosyncrasies, though at least with CSVs users can avoid them by opening in a spreadsheet editor. (With the old anki-dm, this regularly lead to issues due to quoting inconsistencies, but with the current BrainBrew it seems to work fine.) I'm not sure about grouping by (country, field) rather than (country, language) (i.e. having, say, all translations of country info together). There's no perfect solution since we're trying to flatten 3D data (country × field × language) into 2D or 1D, but I think that we had discussed this during the English field as keyI'm also not convinced about using the English version of the field as the key for translations. It's a frequent, though not universal convention in localisation software (GNU gettext does this, fluent doesn't), and it means that the source version is available side-by-side with the translation, as well as (like you note) enforcing the updating of translations when the source changes. However, here, it has several disadvantages:
Partial asideThe grouping and disambiguation of strings that repeat in English (say This does point to a major advantage of using the English field as the key, but I think that the cons discussed above outweigh the pros. Hardcore geographyIf I understand correctly, the way the "overlapping" notes (those that have some cards in UG and some in HG) have been made to work is that in HG the notes have the "missing" fields added (via "field-fills"), so that we only have a single copy of each note, with both the UG and (old) HG cards. (Also, HG now contains UG rather than being an addition (?).) This is pretty elegant (and clean), but I'm not sure if it's the most convenient behaviour. The problem is that now if someone imports UG, imports HG, and then updates UG (without updating HG) all of the HG cards of the overlapping notes will disappear. I believe that they won't be deleted unless one runs We could obviously warn people that if they import HG they should only update via HG, but I expect such warnings to frequently fail. The issue being (usually (?)) recoverable (if one doesn't empty cards in the meantime) makes me less convinced which behaviour is the "correct" one, since the alternative of having two notes (one for UG and one for HG) in the "overlapping" cases is aesthetically displeasing. (A similar (worse) problem would also occur if one were to use a deck that adds a completely new card (say a hypothetical currency UG adding country->currency cards). Import UG -> import currency UG -> update UG and you lose all your country->currency cards (immediately deleted, though with a warning).) Modifying "fully" UG cardsOne small, but potentially very useful thing that the new brain brew facilitates for decks like HG is modifying cards that are solely in UG (i.e. not the "overlapping" notes, but notes which are in UG and have no cards in HG). When we removed the small dependent territory capitals from UG (and moved them to HG) we also removed the capital hints from the notes which no longer had any collisions within UG (whose "conflictors" were moved to HG) — Basseterre (Saint Kitts and Nevis) which had conflicted with Guadeloupe and Georgetown (Guyana) which had conflicted with the Cayman Islands. (The capital hints on the other side — in Guadeloupe and the Cayman Islands — were kept.) The new field-fills mechanism allows easily modifying these notes in HG to re-add the capital hints. (Technically, we could achieve this with our current set-up by cloning the notes from UG to HG (keeping the same guid) and re-adding the capital hints to the clone, but it would be far more brittle and harder to maintain.) Nix as a requirement?I'm hesitant about having In any case, thanks very much for your continuing efforts to improve BrainBrew and the tooling around AUG! |
Hello all! Jordan here. I changed my github username from ohare93, if you're confused 😁 anyways, I finally got around to it! Deck Federation is now in Brain Brew!
This is a work-in-progress migration to the new Rust Brain Brew workflow, paired with jeprecated/brain-brew#60 things are looking very bright!
What changed
brainbrew.yamlmanifest.deck.yamlas the canonical English source.brainbrew verify --manifest brainbrew.yaml --all-targets --media-root mediapasses for 71targets.
Related issues / unlocked work
Area (Km²),LatitudeandLongitude#362: Makes area/latitude/longitude fields a good future extension package.Available for questions, more to come soon! 👀