Skip to content

DEV: Move providers into their own module #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 22, 2025
Merged

DEV: Move providers into their own module #279

merged 4 commits into from
Apr 22, 2025

Conversation

nattsw
Copy link
Contributor

@nattsw nattsw commented Apr 22, 2025

Note: The diff numbers are wildly incorrect since this is just file moves.

Historically, we've had this structure

- discourse-translator
  - base.rb
  - google.rb
  - discourse-ai.rb
  - ...other providers

Any translation needed is invoked on the base class. And the base class' .translate method needs to account for both topics and posts.

As we're moving to translate more types, we need to move away from this. This PR is encapsulates the providers listed above into their own module so we can have a separate translation class altogether instead of calling Base.

Copy link
Contributor

@Drenmi Drenmi left a comment

Choose a reason for hiding this comment

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

Thanks for separating the refactoring and the feature work. 👌👨‍🍳

@nattsw nattsw merged commit f4724ab into main Apr 22, 2025
6 checks passed
@nattsw nattsw deleted the provider-mod branch April 22, 2025 05:10
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.

2 participants