Skip to content

Implement Translation Feature for Article Details#95

Open
google-labs-jules[bot] wants to merge 1 commit intomainfrom
feature/translation
Open

Implement Translation Feature for Article Details#95
google-labs-jules[bot] wants to merge 1 commit intomainfrom
feature/translation

Conversation

@google-labs-jules
Copy link
Contributor

This change adds a translation feature to the application. When a user views an article, the content is now translated from its original language to the user's selected learning language. This is achieved by integrating the MyMemory translation API.

The implementation includes:

  • A TranslatorService to communicate with the translation API.
  • Updates to the ArticleRepository to handle the translation logic, using the user's settings to determine the target language.
  • Modifications to the DetailViewModel to trigger the translation when the detail screen is loaded.
  • Refactoring to remove hardcoded API URLs and the source language, improving maintainability.
  • Updated unit tests to verify the new translation functionality.

PR created automatically by Jules for task 15609352001783307911

This commit introduces a translation feature that translates the article content in the detail view from its original language to the user's selected learning language.

- Integrates the MyMemory translation API using Retrofit.
- Updates `ArticleRepository` to fetch translations, using the user's native and learning languages from `SettingsStateProvider`.
- Modifies `DetailViewModel` to call the translation service upon initialization and display the translated content.
- Centralizes API URLs in a new `Urls.kt` constants file.
- Updates `ArticleRepositoryTest` to include tests for the new translation logic, with mock implementations for external services.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@samoylenkodmitry samoylenkodmitry marked this pull request as ready for review September 28, 2025 08:36
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines 33 to +37
class ArticleRepository @Inject constructor(
private val wiki: WikipediaService,
private val dao: ArticleDao,
private val settings: SettingsStateProvider,
private val translator: TranslatorService,

Choose a reason for hiding this comment

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

[P0] Provide SettingsStateProvider binding for Hilt

ArticleRepository now injects a SettingsStateProvider, but the project only declares SettingsRepository with an @Inject constructor and no @Binds or @Provides to expose it under that interface. Hilt will fail to compile the graph for provideArticleRepo with “SettingsStateProvider cannot be provided” because it only knows how to construct SettingsRepository. Either inject the concrete type or add a binding from SettingsRepository to SettingsStateProvider.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit e791628.

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.

0 participants