Skip to content

Local llm translator#334

Merged
zjs81 merged 5 commits into
mainfrom
Local-LLM-Translator
Apr 3, 2026
Merged

Local llm translator#334
zjs81 merged 5 commits into
mainfrom
Local-LLM-Translator

Conversation

@zjs81

@zjs81 zjs81 commented Apr 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

zjs81 added 2 commits April 2, 2026 19:09
- Introduced translation functionality in chat screen, allowing users to translate messages before sending.
- Added MessageTranslationButton to the input bar for enabling/disabling translation.
- Implemented translation service to handle incoming and outgoing text translations using llama models.
- Enhanced message storage to include original and translated text, language codes, and translation status.
- Created UI components for displaying translated messages and managing translation options.
- Added translation model management, including downloading and storing models locally.
- Updated app settings to manage translation preferences and model selections.

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

Copy link
Copy Markdown

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.

Reviewed commit: 2b826757cb

ℹ️ 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 "@codex address that feedback".

Comment thread lib/screens/chat_screen.dart Outdated
Comment thread lib/screens/channel_chat_screen.dart Outdated
Comment thread lib/services/translation_service.dart Outdated
@zjs81

zjs81 commented Apr 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

Copy link
Copy Markdown

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.

Reviewed commit: 01ad8471cc

ℹ️ 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 "@codex address that feedback".

Comment on lines +652 to +654
final targetLanguageCode = translationService.resolvedTargetLanguageCode(
settings.languageOverride,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use app locale when resolving composer target language

When users leave the target language unset (the UI advertises “use app/system language”), this code passes settings.languageOverride as the fallback, so resolvedTargetLanguageCode becomes null whenever no override is configured and shouldTranslateOutgoing skips translation entirely. This breaks pre-send translation in the default configuration; the same pattern is also present in lib/screens/channel_chat_screen.dart.

Useful? React with 👍 / 👎.

Comment thread lib/services/translation_service.dart Outdated
}
final trackedStream = _trackDownloadProgress(response.stream);
await _fileStore.writeModelBytes(
fileName: chunkPath.split('/').last,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve chunk filename correctly on Windows paths

Parallel model downloads derive the chunk filename with chunkPath.split('/').last, which only works on POSIX separators. On Windows, chunkPath uses backslashes, so this expression returns the full path string and writeModelBytes attempts to create an invalid path, causing large downloads (the parallel path) to fail.

Useful? React with 👍 / 👎.

@zjs81

zjs81 commented Apr 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

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

Copy link
Copy Markdown

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.

Reviewed commit: 96d222a580

ℹ️ 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 "@codex address that feedback".

Comment thread lib/services/translation_service.dart Outdated
Comment on lines +79 to +80
String? resolvedIncomingLanguageCode(String? fallbackLanguageCode) {
return _settings.languageOverride ?? fallbackLanguageCode ?? 'en';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use configured target language for incoming translations

resolvedIncomingLanguageCode ignores translationTargetLanguageCode and only returns languageOverride (or hardcoded 'en'). In the current call path, MeshCoreConnector passes languageOverride as the fallback too, so when override is unset, incoming messages are always translated to English even if the user selected another target language or uses a non-English app locale. This makes incoming translation behavior inconsistent with the settings UI and user expectation.

Useful? React with 👍 / 👎.

Comment on lines +1450 to +1453
for (final option in _filtered)
RadioListTile<String>(
value: option.code,
title: Text(option.label),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a system-language option to the translation picker

The translation language dialog only lists explicit language codes and never offers a null/"Use app language" choice, even though the settings model and labels support that fallback. After a user picks a language once, there is no UI path to return to app-language mode, so translation can remain pinned to the wrong locale unless settings are reset outside the dialog.

Useful? React with 👍 / 👎.

@zjs81 zjs81 merged commit 10b63e0 into main Apr 3, 2026
6 checks passed
@zjs81 zjs81 deleted the Local-LLM-Translator branch April 3, 2026 05:57
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.

1 participant