Give the interpreter real Celtic Cross meanings and --format/--lang support
- guidance.c now prints last, after the full spread; both it and main.c's new Celtic Cross readout pull real Waite card meanings via tarot_data.c instead of just naming cards. - interpreter-cli gains --format text|html|json and --lang en|de, matching deck-engine - required linking engine/src/tarot_data.c and i18n.c into the interpreter binary (a narrow, documented exception to its earlier "no engine .c files" policy) and writing German translations for narrative.c's/guidance.c's own text.
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
# "today": same OS-clock seed/transit-moment and user.properties birth
|
||||
# data as run-engine.sh, but reports how significant today's transits are
|
||||
# instead of printing the full reading. Usage: ./run-interpreter.sh
|
||||
# [text|html|json] [lang]
|
||||
#
|
||||
# [lang] overrides user.properties' lang= for this run only, same as
|
||||
# run-engine.sh - but note it only affects interpreter-cli's own output;
|
||||
# deck-engine is always run without --lang here, since --format json is
|
||||
# deliberately language-independent (see docs/input-output-format.md).
|
||||
#
|
||||
# Requires both dist/deck-engine (built by engine/'s Makefile) and
|
||||
# dist/interpreter-cli (built by interpreter/'s own Makefile) to already
|
||||
@@ -35,6 +41,7 @@ birth_time=""
|
||||
birth_utc_offset=""
|
||||
birth_lat=""
|
||||
birth_lon=""
|
||||
lang="en"
|
||||
|
||||
while IFS='=' read -r key value || [ -n "$key" ]; do
|
||||
key="$(printf '%s' "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
|
||||
@@ -48,6 +55,7 @@ while IFS='=' read -r key value || [ -n "$key" ]; do
|
||||
birth_utc_offset) birth_utc_offset="$value" ;;
|
||||
birth_lat) birth_lat="$value" ;;
|
||||
birth_lon) birth_lon="$value" ;;
|
||||
lang) [ -n "$value" ] && lang="$value" ;;
|
||||
esac
|
||||
done <"$PROPERTIES_FILE"
|
||||
|
||||
@@ -67,10 +75,13 @@ check_set birth_lon "$birth_lon"
|
||||
|
||||
# OS-provided inputs: today's date is the tarot seed (stable all day, a
|
||||
# new spread each day), current UTC time drives today's transits. The
|
||||
# tarot seed doesn't matter for --format json (only "transits" is read
|
||||
# downstream) but it's kept identical to run-engine.sh's for consistency.
|
||||
# tarot seed still matters for --format json now that "spread" is read
|
||||
# downstream too (guidance.c's Attitude/Outcome framing) - kept identical
|
||||
# to run-engine.sh's for consistency either way.
|
||||
seed="$(date +%Y-%m-%d)"
|
||||
transit_date="$(date -u +%Y-%m-%dT%H:%M)"
|
||||
format="${1:-text}"
|
||||
lang="${2:-$lang}"
|
||||
|
||||
"$ENGINE_BINARY" \
|
||||
--seed "$seed" \
|
||||
@@ -81,4 +92,4 @@ transit_date="$(date -u +%Y-%m-%dT%H:%M)"
|
||||
--birth-lon "$birth_lon" \
|
||||
--date "$transit_date" \
|
||||
--format json \
|
||||
| exec "$INTERPRETER_BINARY"
|
||||
| exec "$INTERPRETER_BINARY" --format "$format" --lang "$lang" --i18n-dir "$SCRIPT_DIR/i18n"
|
||||
|
||||
Reference in New Issue
Block a user