Skip to content

feat(locale): bootstrap Lithuanian (lt) locale with i18n + 5 news sources#3896

Open
zionappp-ui wants to merge 2 commits into
koala73:mainfrom
zionappp-ui:feat/lt-locale
Open

feat(locale): bootstrap Lithuanian (lt) locale with i18n + 5 news sources#3896
zionappp-ui wants to merge 2 commits into
koala73:mainfrom
zionappp-ui:feat/lt-locale

Conversation

@zionappp-ui
Copy link
Copy Markdown
Contributor

What this adds

Full Lithuanian (`lt`) locale bootstrap — language was not previously registered in the app.

Locale changes

  • `src/services/i18n.ts` — `'lt'` added to `SUPPORTED_LANGUAGES` + `LANGUAGES` array (`Lietuvių 🇱🇹`)
  • `src/utils/map-locale.ts` — `lt: 'name:lt'` tile field
  • `public/offline.html` — Lithuanian offline strings
  • `scripts/translate-locales.mjs` — `'lt'` in `LOCALES` + `LANG_NAMES`
  • `scripts/sync-offline-translations.mjs` — `'lt'` in `LOCALES`
  • `src/locales/lt.json` — locale bundle (seeded from `en.json` with Lithuanian overlay for key visible strings)

Sources (5 feeds, all verified live)

Source Type RSS Items Tier
LRT (public broadcaster) mainstream Google News lt 100 1
Delfi LT mainstream direct 100 2
15min mainstream Google News lt 100 2
Lrytas mainstream Google News lt 100 2
Verslo Žinios market Google News lt 100 2

LRT is Lithuania's public broadcaster (equivalent of BBC). Direct RSS feeds for Lithuanian outlets largely block cloud IPs — Google News locale fallback (`hl=lt&gl=LT&ceid=LT:lt`) returns full results.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@zionappp-ui is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:caution Brin: contributor trust score caution label May 24, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 24, 2026

Greptile Summary

This PR bootstraps the Lithuanian (lt) locale end-to-end: i18n registration, map tile localisation, offline page strings, translation scripts, a new lt.json bundle seeded from English with a small Lithuanian overlay, and 5 verified RSS news sources.

  • All 14 touched files are kept in sync — www.delfi.lt is added to the RSS allowlists in api/_rss-allowed-domains.js, scripts/shared/rss-allowed-domains.json, shared/rss-allowed-domains.json, and vite.config.ts; tier entries are added to both source-tiers.json copies; feeds are registered in both the server (_feeds.ts) and client (feeds.ts) configs.
  • lt.json mirrors en.json's structure exactly and provides Lithuanian strings for the three most user-visible slots (shell.offline*, countryBrief.generatingBrief, countryBrief.timeline, countryBrief.infrastructure); everything else falls through to the English fallback bundle via i18next fallbackLng.
  • A cosmetic side-effect in both source-tiers.json files Unicode-escapes three pre-existing non-ASCII keys (El País, Híradó, La Silla Vacía) to \\u00XX sequences — semantically identical but adds noise to future diffs.

Confidence Score: 4/5

Safe to merge — all registration points are updated consistently and the Lithuanian feeds follow the established pattern for regional locale bootstraps.

The change is well-contained locale scaffolding with no runtime logic modifications. The only finding is the unnecessary Unicode-escaping of three pre-existing keys in the source-tiers files, which is cosmetic and has no effect on runtime behaviour. Everything else — allowlist sync, feed registry, i18n service, offline page, and locale bundle — is internally consistent.

Both copies of source-tiers.json (scripts/shared/source-tiers.json and shared/source-tiers.json) have the Unicode-escape side-effect worth cleaning up before merge if diff hygiene matters to the team.

Important Files Changed

Filename Overview
src/locales/lt.json New Lithuanian locale bundle: structure mirrors en.json exactly; Lithuanian strings are applied for the shell offline UI, countryBrief.generatingBrief, countryBrief.timeline, and countryBrief.infrastructure — all other strings intentionally fall back to English via i18next fallbackLng.
src/services/i18n.ts Adds 'lt' to SUPPORTED_LANGUAGES and LANGUAGES with label 'Lietuvių 🇱🇹'; lazy-load glob picks up lt.json automatically.
server/worldmonitor/news/v1/_feeds.ts Adds 5 Lithuanian feeds (LRT, Delfi LT, 15min, Lrytas, Verslo Žinios) to VARIANT_FEEDS under the europe section, using gnLocale() helper for 4 and a direct RSS URL for Delfi LT.
src/config/feeds.ts Adds Lithuanian SOURCE_TYPES entries and FULL_FEEDS entries consistent with the server-side feed registry; Delfi LT uses a direct RSS URL while the rest use Google News locale fallback.
scripts/shared/source-tiers.json Adds 5 new Lithuanian source tier entries; side-effect also Unicode-escapes three pre-existing non-ASCII keys (El País, Híradó, La Silla Vacía) unnecessarily.
shared/source-tiers.json Same Unicode-escape side-effect as scripts/shared/source-tiers.json; new Lithuanian entries are correct.
api/_rss-allowed-domains.js Adds www.delfi.lt to the RSS allowed-domains list, in sync with scripts/shared/ and shared/ JSON counterparts.
src/utils/map-locale.ts Adds lt → 'name:lt' tile field mapping; Lithuanian place names are available in Protomaps/OSM tiles.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User browser reports navigator.language = lt] --> B[i18n.ts: normalizeLanguage → 'lt']
    B --> C{lt in SUPPORTED_LANGUAGES?}
    C -- yes --> D[localeModules loader: src/locales/lt.json]
    D --> E[i18next.addResourceBundle]
    E --> F[UI renders with Lithuanian strings + English fallback for untranslated keys]

    G[User selects lt region feeds] --> H[src/config/feeds.ts: FULL_FEEDS lt entries]
    H --> I[RSS proxy checks rss-allowed-domains]
    I -- www.delfi.lt direct --> J[Delfi LT RSS feed]
    I -- Google News gnLocale --> K[LRT / 15min / Lrytas / Verslo Žinios]

    L[Map rendered] --> M[map-locale.ts: getLocalizedNameField lt]
    M --> N[Protomaps tile field: name:lt]

    O[Service worker offline] --> P[offline.html inline T.lt - Esate neprisijunge]
Loading

Comments Outside Diff (1)

  1. scripts/shared/source-tiers.json, line 47-79 (link)

    P2 Unicode-escape churn on pre-existing entries

    Three keys that were previously valid UTF-8 ("El País", "Híradó", "La Silla Vacía") are being rewritten as \u00XX escape sequences. The JSON is semantically identical, but it creates noise in every future diff and makes the file harder to read in editors that don't auto-decode escapes. The identical change appears in both scripts/shared/source-tiers.json and shared/source-tiers.json. This was likely a side-effect of a JSON serialisation tool rather than an intentional edit — consider reverting those lines to literal Unicode and keeping the new Lithuanian entries as-is.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Reviews (1): Last reviewed commit: "feat(locale): bootstrap Lithuanian (lt) ..." | Re-trigger Greptile

@koala73 koala73 added the area: i18n Internationalization, translations label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: i18n Internationalization, translations trust:caution Brin: contributor trust score caution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants