Files
splinter/tools/embed_catalogs.sh
T
lotherkandClaude Sonnet 5.5 2e7a88c462 usable: opencode-go session header, embedded catalogs, locale fixes, calmer UI, --doctor
- openai transport sends x-opencode-session (opencode-go refused every request
  without it) and a splinter user agent
- the message catalogues are compiled in: an installed binary no longer shows
  raw keys (ui.ready ...); LANG=de_DE now selects German (lang was emptied by an
  overlapping snprintf), pt_BR is matched
- sidebar rewritten (agent, provider/model, usage, goal/plan, last turn);
  idle widgets say nothing; status line shows only what matters
- tool calls shown readable instead of JSON with \u escapes
- providers without their key variable are skipped by pools and refused by -m
  with a clear message; --doctor checks every provider

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 03:22:49 +00:00

23 lines
760 B
Bash
Executable File

#!/bin/sh
# Writes a C file holding the message catalogues, so a splinter that was copied
# somewhere (make install, a tarball) never shows raw keys like "ui.ready".
# usage: embed_catalogs.sh share/locale/*.msg > src/catalogs.c
echo '/* generated by tools/embed_catalogs.sh from share/locale -- do not edit */'
echo '#include "splinter.h"'; echo '#include "i18n.h"'
echo
for f in "$@"; do
n=$(basename "$f" .msg | tr -c 'A-Za-z0-9\n' '_')
echo "static const char cat_$n[] ="
sed 's/\\/\\\\/g; s/"/\\"/g; s/^/\t"/; s/$/\\n"/' "$f"
echo " ;"
done
echo
echo 'const struct sp_embedded sp_embedded_catalogs[] = {'
for f in "$@"; do
l=$(basename "$f" .msg)
n=$(echo "$l" | tr -c 'A-Za-z0-9\n' '_')
echo " { \"$l\", cat_$n },"
done
echo ' { 0, 0 }'
echo '};'