Skip to content

Preserve text_link URLs during translation and move Telegram provider to SpaceGram settings#10

Merged
Rocket-Space merged 1 commit intomasterfrom
codex/translate-text_link-and-retain-functionality
Feb 24, 2026
Merged

Preserve text_link URLs during translation and move Telegram provider to SpaceGram settings#10
Rocket-Space merged 1 commit intomasterfrom
codex/translate-text_link-and-retain-functionality

Conversation

@Rocket-Space
Copy link
Owner

Motivation

  • Fix loss of clickable links when translating messages: translated text replaced linked spans with plain text, so links lost their URL/entities and stopped working.
  • Keep the in-chat provider picker focused on external translation providers and expose the Telegram option only in SpaceGram settings for clarity.

Description

  • Added link masking before translation and placeholder restoration after translation in TranslationHelper.translateInline, preserving text_url/url entities and rebuilding TL_textWithEntities with clickable entities (new helper classes LinkPlaceholder and LinkMaskedText, plus maskLinks/restorePlaceholders).
  • Updated SpaceGramTranslator to treat provider id 0 as Telegram and added getAllProviderNamesWithTelegram/getAllProviderIdsWithTelegram to expose provider lists that include Telegram only for settings.
  • Adjusted SpaceGramGeneralSettingsActivity to use the provider lists that include Telegram so it remains selectable in SpaceGram settings.
  • Removed the Telegram option from the in-chat translate provider picker in TranslateButton and simplified the provider subtext logic to use SpaceGramTranslator.getProviderName.

Testing

  • Attempted to compile the Android module with ./gradlew :TMessagesProj:compileDebugJavaWithJavac -x lint, but the build failed in this environment with Unsupported class file major version 69 before module compilation completed, so a full compile/test could not be run here.
  • Verified via static inspection that modified areas reference the new helpers and that provider lists are routed correctly; changes were committed locally.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Rocket-Space Rocket-Space merged commit da3f6ea into master Feb 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant