Repository navigation
Move hardcoded text into JSON resources - #22
Merged
Merged
Conversation
Contributor
|
Alright, good PR in general. A few things to check:
|
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.
Summary
Moves UniDesk's user-facing text out of Python and into JSON files under
src/unidesk/resources/text_data/, loaded through a smalltext_data.pymodule via
importlib.resources. This is a pure data move: identicalbehavior and rendering before and after, verified mechanically (see below).
Closes #19
What moved
navigation.jsonpages.jsonfaq.json{question, answer}entrieslinks.jsoncredits.jsonui_strings.jsonpages.py,credits.py, andlinks.pyare deleted.setup.pygained apackage_dataentry so the JSON actually ships in the built wheel/.deb;previously nothing did, since
package_datawas never declared at all.The FAQ is the one place the shape of the data changed: it's now structured
objects instead of one flattened string. The loader flattens it back to the
exact original string at load time, so the widget code that renders it was
never touched. The round-trip was verified programmatically, not just by eye.
What did not move
UNIVERSITIESinacademic_institutions.py: stays in Python. Its filecomment states it must stay in sync with UniBackpack's hardcoded C++ values.
resources/. Moving it into thepackage would break PKGBUILD's install step and
main.py's existingfallback path.