Skip to content

feat(locale): bootstrap Slovenian (sl) locale with i18n + news sources#3888

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

feat(locale): bootstrap Slovenian (sl) locale with i18n + news sources#3888
zionappp-ui wants to merge 2 commits into
koala73:mainfrom
zionappp-ui:feat/sl-locale

Conversation

@zionappp-ui
Copy link
Copy Markdown
Contributor

Summary

Bootstraps the Slovenian (sl) locale end-to-end.

Feeds added (3 verified, all return ≥20 items)

Outlet Domain Type Tier Items
RTV SLO img.rtvslo.si Public broadcaster 1 20
N1 Slovenia n1info.si Independent TV (CNN affiliate) 2 50
24ur www.24ur.com Commercial TV news (Pro Plus) 2 20

Note on RSS availability: Slovenian media has limited public RSS infrastructure (~2M population). Delo (2 items — paywall restriction), Dnevnik (404), STA (403), Finance.si (0), Večer (0), Mladina (0) all probed — none returned ≥5 items. This PR covers every working native Slovenian RSS source found.

Files changed

  • src/services/i18n.ts — add sl to SUPPORTED_LANGUAGES + LANGUAGES
  • src/utils/map-locale.ts — add sl: 'name:sl'
  • public/offline.html — Slovenian offline strings
  • scripts/translate-locales.mjs — add sl to LOCALES + LANG_NAMES
  • scripts/sync-offline-translations.mjs — add sl to LOCALES
  • src/config/feeds.ts — SOURCE_TYPES + 3 feeds in europe array
  • server/worldmonitor/news/v1/_feeds.ts — server mirror for all 3 feeds
  • shared/rss-allowed-domains.json + scripts/shared/ (byte-identical) — 3 new domains
  • api/_rss-allowed-domains.js + vite.config.ts — all 4 mirrors updated
  • shared/source-tiers.json + scripts/shared/ (byte-identical)
  • src/locales/sl.json — seeded from en.json with Slovenian overlay for countryBrief, header, offline strings; English fallback elsewhere (no cross-language contamination)

Test plan

  • Feed probe: curl -s https://img.rtvslo.si/feeds/00.xml | grep -c '<item>' → ≥20
  • Feed probe: curl -s https://n1info.si/feed/ | grep -c '<item>' → ≥20
  • Feed probe: curl -s https://www.24ur.com/rss | grep -c '<item>' → ≥20
  • Switch UI to Slovenian — no Czech/foreign strings visible
  • All 4 allowlist mirrors contain img.rtvslo.si, n1info.si, www.24ur.com
  • source-tiers parity: shared/ == scripts/shared/ byte-identical

🤖 Generated with Claude Code

- Register sl in SUPPORTED_LANGUAGES, LANGUAGES, map-locale.ts, offline.html
- Register sl in scripts/translate-locales.mjs and sync-offline-translations.mjs
- Add 3 verified Slovenian feeds: RTV SLO (public broadcaster, tier 1),
  N1 Slovenia (CNN affiliate, tier 2), 24ur (commercial TV news, tier 2)
- Wire feeds in src/config/feeds.ts + server/worldmonitor/news/v1/_feeds.ts
- Add 3 new domains to all 4 allowlist mirrors (shared/, scripts/shared/,
  api/_rss-allowed-domains.js, vite.config.ts)
- Add source-tiers entries for all 3 new outlets (both copies)
- Seed sl.json locale file from en.json base with Slovenian overlay for
  countryBrief, header, and offline strings; remaining strings fall back
  to English (no cross-language contamination)

Note: Slovenian RSS landscape is limited (~2M population); Delo/Dnevnik/STA/
Finance.si do not expose public RSS feeds. This PR covers the 3 verified
working native Slovenian RSS sources.
@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 Slovenian (sl) locale end-to-end: three verified RSS news sources (RTV SLO, N1 Slovenia, 24ur), a full sl.json locale file seeded from English with partial Slovenian overlay, and all four allowlist mirrors updated consistently. Two syntax errors introduced in the process need fixing before merge.

  • api/_rss-allowed-domains.js: Missing comma after the previous last array entry ("idp.nature.com") creates a SyntaxError that crashes the Edge Function at parse time, breaking RSS proxy domain checks for every locale.
  • scripts/translate-locales.mjs: A double comma (sl: 'Slovenian',,) in the LANG_NAMES object is also a SyntaxError, breaking locale regeneration for all languages.
  • All JSON mirrors (shared/, scripts/shared/) are byte-identical and correctly updated; feed registrations in both client and server config are consistent.

Confidence Score: 2/5

Not safe to merge: the Edge Function allowlist file has a syntax error that will crash RSS proxying for all locales on deploy.

The missing comma in api/_rss-allowed-domains.js turns the entire exported array into a parse-time SyntaxError. Because Edge Functions are validated at bundle time, this will fail the esbuild pre-push check — and if it somehow reached production, every RSS domain lookup would throw, breaking feeds globally. The double-comma in scripts/translate-locales.mjs is a secondary script-time crash. Both need one-character fixes before this is ready to ship.

api/_rss-allowed-domains.js (missing comma — will break the RSS Edge Function) and scripts/translate-locales.mjs (double comma — will crash locale regeneration).

Important Files Changed

Filename Overview
api/_rss-allowed-domains.js Missing comma after the previous last entry creates a JavaScript SyntaxError that will crash the Edge Function at parse time.
scripts/translate-locales.mjs Double comma after sl: 'Slovenian' is a SyntaxError that breaks the locale translation script for all languages.
src/services/i18n.ts Correctly adds sl to SUPPORTED_LANGUAGES and LANGUAGES; minor indentation inconsistency on the LANGUAGES entry.
src/locales/sl.json New 3,269-line locale file seeded from en.json with partial Slovenian overlay; missing newline at end of file.
shared/rss-allowed-domains.json Correctly adds comma to prior last entry and appends three new Slovenian domains.
src/config/feeds.ts Adds SOURCE_TYPES entries and three feed definitions for Slovenian sources in the europe array.
server/worldmonitor/news/v1/_feeds.ts Server-side mirror of the three Slovenian feeds correctly added to the europe section with lang: 'sl'.
vite.config.ts Dev-server RSS proxy allowlist correctly extended with the three Slovenian domains.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Browser requests RSS feed] --> B{api/_rss-allowed-domains.js allowlist check}
    B -- domain allowed --> C[Proxy fetch to feed URL]
    B -- domain not allowed --> D[403 Blocked]
    C --> E[RTV SLO]
    C --> F[N1 Slovenia]
    C --> G[24ur]
    H[User selects sl locale] --> I[i18n.ts loads sl.json]
    I --> J[map-locale.ts maps sl to name:sl tiles]
    I --> K[offline.html shows Slovenian strings]
    L[scripts/translate-locales.mjs] -- regenerate sl --> I
    style B fill:#ff4444,color:#fff
    style L fill:#ff8844,color:#fff
Loading

Reviews (1): Last reviewed commit: "feat(locale): bootstrap Slovenian (sl) l..." | Re-trigger Greptile

Comment thread api/_rss-allowed-domains.js Outdated
Comment on lines +326 to +327
"idp.nature.com"
"img.rtvslo.si",
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.

P0 Missing comma after "idp.nature.com" before the new entries. JavaScript arrays require commas between elements — adjacent string literals without a separator is a SyntaxError. This will crash the Edge Function entirely at parse time, making all RSS proxy lookups fail for every locale.

Suggested change
"idp.nature.com"
"img.rtvslo.si",
"idp.nature.com",
"img.rtvslo.si",

Comment thread scripts/translate-locales.mjs Outdated
es: 'Spanish', fr: 'French', hu: 'Hungarian', it: 'Italian', ja: 'Japanese',
ko: 'Korean', nl: 'Dutch', pl: 'Polish', pt: 'Portuguese (Brazil)',
ro: 'Romanian', ru: 'Russian', sv: 'Swedish', th: 'Thai', tr: 'Turkish',
ro: 'Romanian', ru: 'Russian', sl: 'Slovenian',, sv: 'Swedish', th: 'Thai', tr: 'Turkish',
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.

P1 Double comma ,, after sl: 'Slovenian' is a SyntaxError in JavaScript. Running scripts/translate-locales.mjs will throw immediately, preventing locale regeneration for any language — including the new sl locale.

Suggested change
ro: 'Romanian', ru: 'Russian', sl: 'Slovenian',, sv: 'Swedish', th: 'Thai', tr: 'Turkish',
ro: 'Romanian', ru: 'Russian', sl: 'Slovenian', sv: 'Swedish', th: 'Thai', tr: 'Turkish',

Comment thread src/services/i18n.ts
Comment on lines 184 to 186
{ code: 'nl', label: 'Nederlands', flag: '🇳🇱' },
{ code: 'sl', label: 'Slovenščina', flag: '🇸🇮' },
{ code: 'sv', label: 'Svenska', flag: '🇸🇪' },
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 The sl entry has 4-space indentation while all surrounding entries use 2 spaces. This breaks visual alignment of the LANGUAGES array.

Suggested change
{ code: 'nl', label: 'Nederlands', flag: '🇳🇱' },
{ code: 'sl', label: 'Slovenščina', flag: '🇸🇮' },
{ code: 'sv', label: 'Svenska', flag: '🇸🇪' },
{ code: 'nl', label: 'Nederlands', flag: '🇳🇱' },
{ code: 'sl', label: 'Slovenščina', flag: '🇸🇮' },
{ code: 'sv', label: 'Svenska', flag: '🇸🇪' },

… indentation

- api/_rss-allowed-domains.js: add missing comma after "idp.nature.com"
  (SyntaxError was crashing the Edge Function RSS allowlist)
- scripts/translate-locales.mjs: remove duplicate comma after sl entry
- src/services/i18n.ts: fix 4-space indent on sl LANGUAGES entry → 2 spaces
@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