Skip to content

feat(feeds): add Ukrainian (uk) locale with mainstream + investigative sources#3880

Open
zionappp-ui wants to merge 1 commit into
koala73:mainfrom
zionappp-ui:feat/uk-locale
Open

feat(feeds): add Ukrainian (uk) locale with mainstream + investigative sources#3880
zionappp-ui wants to merge 1 commit into
koala73:mainfrom
zionappp-ui:feat/uk-locale

Conversation

@zionappp-ui
Copy link
Copy Markdown
Contributor

Summary

Adds Ukrainian (uk) as a supported locale following the pattern established in #3857 (Hungarian). All 14 steps from the locale-addition recipe are complete.

Sources added

Mainstream (6):

Name Domain Method
Ukrinform ukrinform.ua Direct RSS — 30 items verified
Ukrainska Pravda pravda.com.ua Google News fallback (UA:uk)
Hromadske hromadske.ua Google News fallback (UA:uk)
Suspilne Media suspilne.media Google News fallback (UA:uk)
ZN.UA zn.ua Google News fallback (UA:uk)
RBC-Ukraine rbc.ua Google News fallback (UA:uk) — typed market

Investigative (4) — typed intel (no investigative type in codebase; intel is the established pattern for Bellingcat, RAND, etc.):

Name Domain Method
Bihus.Info bihus.info Direct RSS — 10 items verified
Slidstvo.Info slidstvo.info Direct RSS — 12 items verified
Skhemy (Schemes) schemes.media Google News fallback (UA:uk)
VoxUkraine voxukraine.org Google News fallback (UA:uk)

Investigative sources (Bihus, Slidstvo, Skhemy, VoxUkraine) are Ukraine's leading anti-corruption and investigative outlets — see discussion in #3879.

Redirect trap caught

slidstvo.info/feed/ redirects to www.slidstvo.info/feed/ — both hostnames added to all 4 allowlist mirrors.

Files changed

  • 4 allowlist mirrors: shared/rss-allowed-domains.json, scripts/shared/rss-allowed-domains.json, api/_rss-allowed-domains.js, vite.config.ts
  • Feeds: src/config/feeds.ts (client), server/worldmonitor/news/v1/_feeds.ts (server digest) — gnLocale() helper added to server file
  • Tiers: shared/source-tiers.json + scripts/shared/source-tiers.json (byte-identical, all at tier 2)
  • i18n: src/services/i18n.ts (uk in SUPPORTED_LANGUAGES + LANGUAGES array), src/utils/map-locale.ts (name:uk)
  • Locale file: src/locales/uk.json — native Ukrainian for all critical UI sections; remaining keys bootstrapped from Russian as placeholder; full run via translate-locales.mjs with ANTHROPIC_API_KEY recommended post-merge
  • Scripts: scripts/translate-locales.mjs (uk in LOCALES + LANG_NAMES), scripts/sync-offline-translations.mjs (uk added)
  • Offline page: public/offline.html updated (22 locales, clean run)
  • App.ts: backport feat(feeds): add Hungarian and Central European RSS sources #3857 explicit-locale locale-boost fix + free-tier cap protectedNames guard
  • source-cap.ts: optional protectedNames param (defaults new Set() — all existing call sites unaffected)
  • Test: tests/feeds-client-server-parity.test.mjs — extend isGoogleNews classifier to recognise gnLocale() calls

Test results

feeds-client-server-parity   all pass
source-cap.test.mts          28/28
importance-score-parity      18/18
tsc --noEmit                 0 errors

Notes

  • gnLocale() uses hl=uk&gl=UA&ceid=UA:uk — materially more Ukrainian-language results than en-US defaults
  • Both source-tiers.json mirrors are byte-identical (diff confirmed)
  • App.ts / source-cap.ts fixes mirror feat(feeds): add Hungarian and Central European RSS sources #3857 — if that PR merges first these can be dropped on rebase

@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 adds Ukrainian (uk) as a fully supported locale following the pattern established by the Hungarian locale in #3857. All 14 steps of the locale-addition recipe appear complete: feeds, allowlists, source tiers, i18n, offline page, translate scripts, map-locale, and a gnLocale() helper for locale-tuned Google News URLs.

  • 10 Ukrainian sources added (6 mainstream + 4 investigative/intel) to both src/config/feeds.ts and server/worldmonitor/news/v1/_feeds.ts; client↔server names are fully consistent and the parity test is extended to recognise gnLocale() calls.
  • protectedNames / locale-boost fix backported from feat(feeds): add Hungarian and Central European RSS sources #3857: selectSourcesUnderCap now accepts an optional protectedNames set, and App.ts pre-seeds it with locale-boosted Ukrainian sources so the free-tier round-robin cap cannot evict them immediately after they are enabled.
  • Allowlist inconsistency: all four RSS allowlist mirrors include zaborona.com and texty.org.ua, but neither domain is referenced in any feed configuration — these appear to be leftover entries from an earlier draft.

Confidence Score: 3/5

Safe to merge after resolving the two orphaned allowlist entries; all other locale wiring is correct and consistent.

The core locale addition — feeds, i18n, tiers, offline page, map labels — is well-executed and the parity test extension is correct. The one concrete defect is that zaborona.com and texty.org.ua are pre-authorized in all four copies of the RSS allowlist but have no corresponding feed in either the client or server config, leaving the proxy able to forward requests to domains that serve no current purpose. The PR description enumerates exactly 10 sources and neither domain appears among them, pointing to leftover draft content rather than intentional future-proofing.

All four allowlist mirrors (shared/rss-allowed-domains.json, scripts/shared/rss-allowed-domains.json, api/_rss-allowed-domains.js, vite.config.ts) need the zaborona.com and texty.org.ua entries either removed or backed by actual feed entries.

Important Files Changed

Filename Overview
shared/rss-allowed-domains.json Adds 13 domain entries for Ukrainian locale sources, but 2 (zaborona.com, texty.org.ua) have no corresponding feed entry in feeds.ts or _feeds.ts — dead allowlist entries.
scripts/shared/rss-allowed-domains.json Mirror of shared/rss-allowed-domains.json; carries the same two extra dead entries (zaborona.com, texty.org.ua).
api/_rss-allowed-domains.js Server-side RSS proxy allowlist mirror; also contains zaborona.com and texty.org.ua without matching feed entries.
vite.config.ts Fourth allowlist mirror; adds the same 13 Ukrainian domains including the two unused ones.
src/config/feeds.ts Adds 10 Ukrainian locale feeds (6 mainstream + 4 investigative/intel) to FULL_FEEDS.europe with correct lang: 'uk' tags and SOURCE_TYPES entries; getLocaleBoostedSources will correctly surface them for uk users.
server/worldmonitor/news/v1/_feeds.ts Adds gnLocale() helper and mirrors all 10 Ukrainian feeds in the server-side europe bucket; all names match client side so the parity test passes.
src/App.ts Backports the protectedNames locale-boost fix from #3857: locale-boosted sources are now pre-seeded into the keep set before the round-robin cap runs, preventing them from being immediately re-disabled.
src/services/source-cap.ts Adds optional protectedNames parameter (defaulting to empty set) to selectSourcesUnderCap; all existing call sites are unaffected.
src/services/i18n.ts Adds uk to both SUPPORTED_LANGUAGES and the LANGUAGES display array; no issues.
tests/feeds-client-server-parity.test.mjs Extends isGN classifier to recognise gnLocale(...) calls in addition to bare gn(...) and hardcoded news.google.com URLs, so the server-side Ukrainian feeds are correctly classified as Google News routes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User browser locale = uk] --> B{Free-tier cap active?}
    B -- No --> C[All feeds enabled normally]
    B -- Yes --> D[getLocaleBoostedSources returns 10 UK sources]
    D --> E[protectedNames pre-seeded into keep set]
    E --> F[selectSourcesUnderCap round-robin fills remaining slots]
    F --> G[Ukrainian sources never evicted by cap]
    H[feeds.ts 10 UK feeds with lang:uk] --> D
    subgraph AllowlistMismatch[Allowlist mismatch in this PR]
        N[zaborona.com in allowlist]
        O[texty.org.ua in allowlist]
        P[No feed entry in feeds.ts or server feeds]
        N --> P
        O --> P
    end
Loading

Reviews (1): Last reviewed commit: "feat(feeds): add Ukrainian (uk) locale w..." | Re-trigger Greptile

Comment thread shared/rss-allowed-domains.json Outdated
Comment on lines +314 to +315
"zaborona.com",
"texty.org.ua"
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 Dead allowlist entries — no corresponding feed config

zaborona.com and texty.org.ua are added to all four allowlist mirrors (shared/rss-allowed-domains.json, scripts/shared/rss-allowed-domains.json, api/_rss-allowed-domains.js, and vite.config.ts) but appear in neither src/config/feeds.ts nor server/worldmonitor/news/v1/_feeds.ts. The PR description explicitly enumerates 10 sources (6 mainstream + 4 investigative), and none of them is Zaborona or Texty.org.ua. The RSS proxy will accept requests to these domains even though no feed will ever reference them under the current config. Either the feeds for these two sources should be added to complete the intended inclusion, or these allowlist entries should be removed.

…e sources

Adds Ukrainian as a supported locale following the pattern established
in koala73#3857 (Hungarian).

Sources added:
- Mainstream: Ukrinform, Ukrainska Pravda, Hromadske, Suspilne Media,
  ZN.UA, RBC-Ukraine
- Investigative: Bihus.Info, Slidstvo.Info, Skhemy (Schemes), VoxUkraine

Direct RSS (verified working):
  ukrinform.ua, bihus.info, slidstvo.info (redirects to www.slidstvo.info)

Google News fallback (blocked from probe IP — UA:uk locale params):
  pravda.com.ua, hromadske.ua, suspilne.media, schemes.media,
  zn.ua, rbc.ua, voxukraine.org

All 4 allowlist mirrors updated (shared/, scripts/shared/, api/, vite.config.ts).
Redirect trap: slidstvo.info/feed/ → www.slidstvo.info/feed/ — both
hostnames added to allowlist.

Server _feeds.ts mirrors client feeds.ts routing decisions (direct vs
Google News) — feeds-client-server-parity test coverage maintained.
@zionappp-ui
Copy link
Copy Markdown
Contributor Author

Updated: registered uk in scripts/translate-locales.mjs (LOCALES + LANG_NAMES) and scripts/sync-offline-translations.mjs — missed in the original commit.

@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