Investigate multi-language support for the Belga feed #124

Open
opened 2026-08-02 11:42:43 +02:00 by myrmidex · 0 comments
Owner

Summary

The Belga feed is English-only. config/feed.php defines just an en entry under belga.languages, and BelgaHomepageParserAdapter is pinned to English — it accepts a $language constructor argument (because HomepageParserFactory:29 passes one positionally to every homepage parser) but deliberately ignores it when building the API url.

Whether other languages are actually available is unverified. This ticket is the investigation.

Why it looks plausible

The capi.belga.press endpoint takes a language= query parameter, and its response content object is keyed by language code:

"content": { "en": { "title": "...", "lead": "...", "categories": [...] } }

That shape suggests other codes may be populated, but nothing has been tested beyond EN.

To investigate

  • Which language codes the API serves for newsroomId=70 — try NL, FR, DE
  • Whether non-English content is actually populated or returns empty/duplicated English
  • Whether _meta.total differs per language (a different corpus vs. the same one relabelled)
  • Whether article pages at https://www.belganewsagency.eu/press-releases/{id}/ render in the requested language, and whether BelgaArticlePageParser reads the right og:title / og:description for them
  • Whether article ids are shared across languages or language-specific — this matters, because Article rows are deduplicated on url, and a shared id would collide

If viable

  • Add the language entries under feed.providers.belga.languages in config/feed.php
  • Make BelgaHomepageParserAdapter::getHomepageUrl() honour $language instead of pinning to en
  • Restore per-language coverage in BelgaHomepageParserTest (a test_adapter_uppercases_language_in_api_url case existed and was removed when the url moved into config, precisely because it asserted a capability that was never verified)

If not viable

Record the finding here and close — the current English-only pin is then correct as-is.

Notes

  • Discovered while fixing #115 "Belga News feed produces no articles", when the adapter's hardcoded url was replaced by a config lookup.
  • Related: #51 "Language Settings" (general app language handling, not Belga-specific).
  • No milestone — backlog.
## Summary The Belga feed is English-only. `config/feed.php` defines just an `en` entry under `belga.languages`, and `BelgaHomepageParserAdapter` is pinned to English — it accepts a `$language` constructor argument (because `HomepageParserFactory:29` passes one positionally to every homepage parser) but deliberately ignores it when building the API url. Whether other languages are actually available is **unverified**. This ticket is the investigation. ## Why it looks plausible The `capi.belga.press` endpoint takes a `language=` query parameter, and its response `content` object is keyed by language code: ```json "content": { "en": { "title": "...", "lead": "...", "categories": [...] } } ``` That shape suggests other codes may be populated, but nothing has been tested beyond `EN`. ## To investigate - Which language codes the API serves for `newsroomId=70` — try `NL`, `FR`, `DE` - Whether non-English `content` is actually populated or returns empty/duplicated English - Whether `_meta.total` differs per language (a different corpus vs. the same one relabelled) - Whether article pages at `https://www.belganewsagency.eu/press-releases/{id}/` render in the requested language, and whether `BelgaArticlePageParser` reads the right `og:title` / `og:description` for them - Whether article ids are shared across languages or language-specific — this matters, because `Article` rows are deduplicated on `url`, and a shared id would collide ## If viable - Add the language entries under `feed.providers.belga.languages` in `config/feed.php` - Make `BelgaHomepageParserAdapter::getHomepageUrl()` honour `$language` instead of pinning to `en` - Restore per-language coverage in `BelgaHomepageParserTest` (a `test_adapter_uppercases_language_in_api_url` case existed and was removed when the url moved into config, precisely because it asserted a capability that was never verified) ## If not viable Record the finding here and close — the current English-only pin is then correct as-is. ## Notes - Discovered while fixing #115 "Belga News feed produces no articles", when the adapter's hardcoded url was replaced by a config lookup. - Related: #51 "Language Settings" (general app language handling, not Belga-specific). - No milestone — backlog.
myrmidex added the
enhancement
label 2026-08-02 11:42:43 +02:00
myrmidex added this to the v2.0.0 milestone 2026-08-15 12:18:01 +02:00
myrmidex removed this from the v2.0.0 milestone 2026-08-15 12:55:08 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/fedi-feed-router#124
No description provided.