Add 15 new apps and localize 15 existing apps (i18n) - #57
Open
avandeputte wants to merge 3 commits into
Open
Conversation
…ers) Adds an opt-in internationalization foundation that apps can adopt without breaking the existing app contract: - server/i18n.py + server/i18n_data.json: logic/data split. Translations are grouped by semantic topic domain (gettext msgctxt model) so homographs stay distinct (weather HIGH vs tides HIGH). ~34 languages, incl. regional variants that inherit their base language. Each key carries a translator 'context' note. - server/location.py + server/weather.py: one shared geocoder, babel-backed currency/country (no hardcoded tables), 10-minute TTL-cached weather. - Runtime injection: get_plugin_pages inspects fetch()'s signature and passes i18n / get_weather / get_location only when the app declares them. Classic 4-arg apps are completely untouched. - Settings: an 'Enable internationalization' master toggle (DEFAULT OFF) gates the Language selector and the app badge. With it off the UI and behaviour are identical to today -- the toggle carries a disclaimer that it needs modules on Universal Firmware with configurable character maps. - babel is a soft dependency; i18n.py falls back to English without it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gateway receive path decoded/re-encoded frames as UTF-8 with
errors=ignore, which silently dropped lone high bytes (0x80-0xFF). That
corrupted a module's A-command character-map sync for any reel set with
extended (international) glyphs. Decode and re-encode with latin-1 instead
-- a transparent byte<->code-point codec -- so the raw cp1252 bytes survive
to the downstream .decode('cp1252'). Adds a regression test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New apps: advice, aurora, cat-facts, earthquakes, exchange-rates, formula1, holidays, metals, quote, rocket-launch, sarcastic-fortune-cookies, sun-times, tides, useless-fact, wiki-today. Localized/enhanced in place: bitcoin-fear-greed, countdown, crypto, dashboard, date, iss, moon-phase, sports, stocks, time, time-since, weather, word-clock, word-of-the-day, world_clock. Every app keeps the classic contract and degrades gracefully: i18n, get_weather and get_location are optional parameters defaulting to None, so each app still runs in English. Currency-bearing apps (crypto, metals, stocks) show the local currency when i18n is on and fall back to ASCII currency codes when it is off, since the basic charset cannot render the EUR/GBP/JPY symbols. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Adds 15 new apps and localizes 15 existing ones, building on the i18n foundation in #56.
Important
Depends on #56 — please merge that first. These apps receive
i18n/get_weather/get_locationthrough the runtime injection added there. This branch is stacked on #56, so GitHub will show its commits in the diff until #56 merges; this PR's own changes are confined toapps/.New apps (15)
advice·aurora·cat-facts·earthquakes·exchange-rates·formula1·holidays·metals·quote·rocket-launch·sarcastic-fortune-cookies·sun-times·tides·useless-fact·wiki-todayLocalized / enhanced in place (15)
bitcoin-fear-greed·countdown·crypto·dashboard·date·iss·moon-phase·sports·stocks·time·time-since·weather·word-clock·word-of-the-day·world_clockThese are replaced in place because they're genuine feature upgrades rather than pure translation — e.g.
weathergains AQI/UV/pollen,word-clockis a multilingual rewrite,dashboardnow pulls the sharedget_weatherhelper.Notes
i18n,get_weatherandget_locationare optional parameters defaulting toNone, so every app still runs (in English) on a server without the foundation.crypto,metalsandstocksshow the local currency when i18n is on, and fall back to ASCII currency codes when it's off — the basic charset can't render€ £ ¥, so emitting them would just produce garbage flaps.stocksresolves per-ticker currency from yfinance, including London's GBp/pence quoting.Testing
Full suite green (52 tests). Deterministic apps verified in both EN and FR, and run end-to-end on real hardware.
🤖 Generated with Claude Code