Skip to content

Conversation

@nattsw
Copy link
Contributor

@nattsw nattsw commented Mar 4, 2025

In #206, we introduced a regression here when mapping supported locales.

This PR also adds a test for the LibreTranslate /translate API.

Also adds test coverage for /translate endpoint
Excon
.expects(:get)
.with(SiteSetting.translator_libretranslate_endpoint + "/languages")
.returns(mock_response.new(200, [{ code: "de" }, { code: "en" }].to_json))
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could, but this is not an issue at the moment so I'll just leave it for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's worth a future refactor for consistency, looks like this plugin uses this method heaps instead of just using stub_request, maybe it predates stub_request

Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

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

Approving, just wondering about request mocks

@nattsw nattsw merged commit 142902a into main Mar 4, 2025
6 checks passed
@nattsw nattsw deleted the libretalia branch March 4, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants