Skip to content

Use two-letter language codes in RSS feeds, where available#265

Merged
notartom merged 2 commits into
LibriVox:masterfrom
redrun45:rss-two-letter-lang
Aug 11, 2025
Merged

Use two-letter language codes in RSS feeds, where available#265
notartom merged 2 commits into
LibriVox:masterfrom
redrun45:rss-two-letter-lang

Conversation

@redrun45

Copy link
Copy Markdown
Collaborator

Evidently, RSS feeds are supposed to use the two-letter language codes, instead of three. Switch to using two-letter codes where feasible:
https://forum.librivox.org/viewtopic.php?p=2479460#p2479460

A couple notes on tests. Evidently, we had a stub RSS controller file sitting around, and our test harness preferred to send requests to that, instead of to the real one. Also, our test harness includes little debug messages both before and after the response itself, so I had to do a little cleanup in order to validate the XML. That validation might be a standard part of any new tests I write going forward...

$this->assertStringContainsString($str, $response);
}

// Ugly: our test harness inserts messages like "got an instance" and "called the actual controller", before and after the actual RSS/XML response document. Trim them off.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we know where these come form? A quick grep of our own code base doesn't turn up anything, and searching on GitHub the contents of phpunit and ci-phpunit-test doesn't find anything here. I'd much rather we get rid of these at the source if at all possible than working around them with hacks.

(But thanks for the code comment, I would have been left wondering otherwise).

@redrun45 redrun45 Aug 10, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Long story short: that ugly hack is not necessary, and is now gone.

Looks like I made more assumptions about the environment resetting itself after my experiments. I can now, somewhat vaguely, recall my first-ever attempt at adding unit tests failing, so I added those debug messages into my vendor-ed ci-phpunit code, and found a bug in phpunit... which had already been found and fixed in another version. So I worked around it, and assumed the next git restore or ansible-playbook run would remove the messages. And then I forgot all about it. 🤣

Also removed a redundant RSS controller, which "swallowed up" the testing calls.
@redrun45 redrun45 force-pushed the rss-two-letter-lang branch from 4222f8e to 375a8c1 Compare August 10, 2025 22:04
@notartom notartom merged commit 9a358f2 into LibriVox:master Aug 11, 2025
1 check passed
@redrun45 redrun45 deleted the rss-two-letter-lang branch August 11, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants