feat(locale): bootstrap Slovenian (sl) locale with i18n + news sources#3888
feat(locale): bootstrap Slovenian (sl) locale with i18n + news sources#3888zionappp-ui wants to merge 2 commits into
Conversation
- 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.
|
@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. |
Greptile SummaryThis PR bootstraps the Slovenian (
Confidence Score: 2/5Not 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
Important Files Changed
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
Reviews (1): Last reviewed commit: "feat(locale): bootstrap Slovenian (sl) l..." | Re-trigger Greptile |
| "idp.nature.com" | ||
| "img.rtvslo.si", |
There was a problem hiding this comment.
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.
| "idp.nature.com" | |
| "img.rtvslo.si", | |
| "idp.nature.com", | |
| "img.rtvslo.si", |
| 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', |
There was a problem hiding this comment.
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.
| ro: 'Romanian', ru: 'Russian', sl: 'Slovenian',, sv: 'Swedish', th: 'Thai', tr: 'Turkish', | |
| ro: 'Romanian', ru: 'Russian', sl: 'Slovenian', sv: 'Swedish', th: 'Thai', tr: 'Turkish', |
| { code: 'nl', label: 'Nederlands', flag: '🇳🇱' }, | ||
| { code: 'sl', label: 'Slovenščina', flag: '🇸🇮' }, | ||
| { code: 'sv', label: 'Svenska', flag: '🇸🇪' }, |
There was a problem hiding this comment.
The
sl entry has 4-space indentation while all surrounding entries use 2 spaces. This breaks visual alignment of the LANGUAGES array.
| { 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
Summary
Bootstraps the Slovenian (
sl) locale end-to-end.Feeds added (3 verified, all return ≥20 items)
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— addslto SUPPORTED_LANGUAGES + LANGUAGESsrc/utils/map-locale.ts— addsl: 'name:sl'public/offline.html— Slovenian offline stringsscripts/translate-locales.mjs— addslto LOCALES + LANG_NAMESscripts/sync-offline-translations.mjs— addslto LOCALESsrc/config/feeds.ts— SOURCE_TYPES + 3 feeds in europe arrayserver/worldmonitor/news/v1/_feeds.ts— server mirror for all 3 feedsshared/rss-allowed-domains.json+scripts/shared/(byte-identical) — 3 new domainsapi/_rss-allowed-domains.js+vite.config.ts— all 4 mirrors updatedshared/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
curl -s https://img.rtvslo.si/feeds/00.xml | grep -c '<item>'→ ≥20curl -s https://n1info.si/feed/ | grep -c '<item>'→ ≥20curl -s https://www.24ur.com/rss | grep -c '<item>'→ ≥20shared/ == scripts/shared/byte-identical🤖 Generated with Claude Code