Skip to content

feat(locale): bootstrap Latvian (lv) locale with i18n + 6 news sources#3897

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

feat(locale): bootstrap Latvian (lv) locale with i18n + 6 news sources#3897
zionappp-ui wants to merge 2 commits into
koala73:mainfrom
zionappp-ui:feat/lv-locale

Conversation

@zionappp-ui
Copy link
Copy Markdown
Contributor

What this adds

Full Latvian (`lv`) locale bootstrap.

Locale changes

  • `src/services/i18n.ts` — `'lv'` in `SUPPORTED_LANGUAGES` + `LANGUAGES` (`Latviešu 🇱🇻`)
  • `src/utils/map-locale.ts` — `lv: 'name:lv'`
  • `public/offline.html` — Latvian offline strings
  • `scripts/translate-locales.mjs` + `sync-offline-translations.mjs` — `'lv'` added
  • `src/locales/lv.json` — locale bundle with Latvian overlay

Sources (6 feeds, all verified live)

Source Type RSS Items Tier
LSM (public broadcaster) mainstream direct 50 1
Delfi LV mainstream direct 25 2
Latvijas Avīze mainstream direct 25 2
Diena mainstream Google News lv 44 2
TVNet mainstream Google News lv 100 2
Neatkarīgā mainstream Google News lv 100 2

LSM (Latvijas Sabiedriskie Mediji) is Latvia's public broadcaster. 3 direct RSS feeds, 3 via locale-tuned Google News (`hl=lv&gl=LV&ceid=LV:lv`).

@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

Bootstraps the Latvian (lv) locale end-to-end: i18n registration, map-locale tile field, offline fallback strings, translation bundle, and 6 news feeds (3 direct RSS + 3 Google News). All domain allowlists (shared/rss-allowed-domains.json, scripts/shared/, api/_rss-allowed-domains.js, vite.config.ts) are updated consistently, source-tier registrations match feed names, and client/server feed routing is in parity.

  • 6 Latvian feeds added across both src/config/feeds.ts and server/worldmonitor/news/v1/_feeds.ts with consistent direct/Google-News routing per feed, satisfying the feeds-client-server-parity test.
  • lv.json locale bundle covers the same key count as en.json but several meta and widget strings appear untranslated (left in English), and three pre-existing source-tiers.json entries were re-encoded with \\uXXXX escapes as a serialiser side-effect.

Confidence Score: 4/5

Safe to merge — all domain allowlists are consistent, feed routing parity is maintained, and no data path is broken.

The wiring is solid: allowlists, source tiers, and client/server feed parity are all correct. The main rough edges are cosmetic — some Latvian locale strings were left in English (visible to users who select Latvian), and a serialiser artifact re-encoded three pre-existing source names in source-tiers.json with Unicode escapes.

src/locales/lv.json deserves a translation-completeness pass before or shortly after merge; scripts/shared/source-tiers.json and shared/source-tiers.json carry unintended Unicode-escape churn on three pre-existing entries.

Important Files Changed

Filename Overview
src/locales/lv.json New 3,269-line Latvian locale bundle; key offline/shell strings are translated but several meta and widget labels remain in English
server/worldmonitor/news/v1/_feeds.ts Adds 6 Latvian feeds (3 direct RSS, 3 via Google News gnLocale helper); routing matches the client-side FULL_FEEDS entry for each feed name, satisfying the parity test
src/config/feeds.ts Client-side FULL_FEEDS and SOURCE_TYPES updated for all 6 Latvian sources; routing (direct vs Google News) is consistent with the server _feeds.ts counterpart
api/_rss-allowed-domains.js Adds www.lsm.lv, www.delfi.lv, www.la.lv — correctly mirrors shared/rss-allowed-domains.json and vite.config.ts; Google News proxied feeds need no new entry
shared/source-tiers.json Adds correct tier entries for 6 Latvian sources; also re-encodes three pre-existing non-ASCII strings as \uXXXX escapes (harmless but noisy)
src/services/i18n.ts Adds lv to SUPPORTED_LANGUAGES (now sorted alphabetically) and LANGUAGES display list; consistent with sync-offline-translations.mjs LOCALES array
vite.config.ts Dev-proxy allowlist updated with 3 direct Latvian RSS domains, kept in sync with shared/rss-allowed-domains.json
public/offline.html Latvian offline strings inserted in alphabetical order (between ko and nl); values match lv.json shell.offline* keys exactly
src/utils/map-locale.ts Adds lv → name:lv tile field mapping, consistent with all other locale entries in the map

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User selects Latvian locale] --> B[i18n.ts SUPPORTED_LANGUAGES includes 'lv']
    B --> C[Load src/locales/lv.json]
    C --> D[map-locale.ts: lv → name:lv tile field]

    E[News panel requests feeds] --> F{Feed type?}
    F -->|Direct RSS| G[RSS Proxy]
    G --> H{Domain in allowlist?}
    H -->|www.lsm.lv| I[LSM feed]
    H -->|www.delfi.lv| J[Delfi LV feed]
    H -->|www.la.lv| K[Latvijas Avize feed]

    F -->|Google News| L[news.google.com - already allowed]
    L --> M[Diena / TVNet / Neatkariga]

    N[source-tiers.json] --> O[getSourceTier lookup]
    O --> I & J & K & M

    P[public/offline.html] --> Q[lv offline strings]
Loading

Reviews (1): Last reviewed commit: "feat(locale): bootstrap Latvian (lv) loc..." | Re-trigger Greptile

Comment thread src/locales/lv.json Outdated
Comment on lines +4 to +8
"description": "Global Situation with AI Insights"
},
"shell": {
"documentTitle": "World Monitor — Globālās izlūkošanas panelis reāllaikā",
"metaDescription": "Real-time global intelligence platform. Featured in WIRED. Used by 2M+ people across 190 countries. Conflicts, markets, military, OSINT in one view.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Untranslated meta strings in the Latvian locale bundle

app.description ("Global Situation with AI Insights") and shell.metaDescription ("Real-time global intelligence platform…") are left in English. Comparing with de.json, both fields are fully translated there (e.g. "Globale Lage mit KI-Erkenntnissen"). These strings are used in the document <title> and <meta name="description"> tag, so Latvian users will see raw English text in their browser tab and social previews. Additionally, several widget-level labels (e.g. "chatTitle": "Widget Builder", "phaseChecking": "Checking") are also in English throughout the file. The lv.json and en.json share the same line count (3,269), suggesting the AI translation pass may have skipped some segments.

Comment thread scripts/shared/source-tiers.json Outdated
"Yonhap News": 2,
"Chosun Ilbo": 2,
"El País": 2,
"El Pa\u00eds": 2,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unrelated Unicode-escape churn on pre-existing entries

Three existing entries were re-serialised with JSON Unicode escapes as a side-effect of this PR: "El País""El Pa\u00eds", "Híradó""H\u00edrad\u00f3", "La Silla Vacía""La Silla Vac\u00eda". The same change appears in shared/source-tiers.json. JSON \uXXXX escapes and literal Unicode characters are parsed identically, so there is no runtime impact; but the diff noise makes it harder to review the Latvian additions and could trigger downstream churn if a future contributor normalises the file in the opposite direction. The churn is likely a serialiser artifact — worth stripping before merge.

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!

… + strip Unicode escape noise from source-tiers
@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