Open kithawk opened 8 months ago
I have discovered some related insights that might shed light on the inconsistent behavior of the 'Translate' button. It appears that the issue may stem from specific parts of the code in the ChatLiveTranslateContext.swift file:
if !isHidden && translationState?.fromLang != translationState?.toLang {
return (translationState, appearance, peer?.isPremium == true)
} else {
return (nil, appearance, peer?.isPremium == true)
}
if let state = state, state.fromLang != to, state.fromLang != "" {
current.from = state.fromLang
current.to = to
current.canTranslate = true
} else {
current.canTranslate = false
}
Based on these code snippets, it seems that if the fromLang
is the same as the toLang
, the translate bar disappears. This behavior could explain the inconsistency in the appearance of the 'Translate' button.
Consider the following scenario:
In this scenario, the translation will only work for the person writing in Polish (and translating to Polish) because the language detected in the chat will be English for both users. For the person trying to translate to English, it won't work because the source and destination languages will be detected as the same, causing the translate bar to be disabled.
This behavior aligns with the steps to reproduce the issue, where setting the interface language to one of the languages used in the chat causes the translation bar to disappear.
In addition to the proposed enhancement of making the 'Translate' button permanently accessible within the chat's three-dot menu, it may be worth considering modifications to the code to handle cases where the source and destination languages are the same, but the user still desires to have the translation feature available. One possible approach could be to allow the user to manually select the source language if the automatic detection fails to distinguish between the languages used in the chat.
I hope this information helps in identifying the root cause of the issue and finding a suitable solution to improve the user experience of the live translate feature for Telegram Premium users.
Description
Telegram Premium's live translate feature is a key benefit for users who frequently engage in multilingual communication. However, the current implementation's inconsistency in displaying the 'Translate' button significantly hampers the user experience. The button to translate entire chats is not consistently visible, appearing in only a fraction of chats despite the presence of languages different from the user's 'Do Not Translate' setting. This issue has been observed across various languages, with English provided as an example. To enhance usability and ensure Premium users can fully leverage this feature, I propose a modification to make the translation option persistently accessible.
Expected Behavior
The 'Translate' button should be persistently accessible, regardless of the detected language in a chat. Ideally, this could be implemented via a permanent placement in the chat's three-dot menu. Such a change would ensure that users can always initiate a translation when needed, without relying on the automatic detection system's accuracy.
Actual Behavior
Currently, the 'Translate' button appears sporadically in chats, visible in only about 5 to 20% of them. This inconsistency occurs across both private and group chats and does not reliably correspond with the presence of a language different from the 'Do Not Translate' setting. The issue persists despite troubleshooting efforts, including clean reinstalls and configuration file deletions (e.g., 6N38VWS5BX.ru.keepcoder.Telegram).
Steps to Reproduce
Proposed Enhancement
To address this inconsistency and improve the feature's reliability, I suggest making the 'Translate' button permanently accessible within the chat's three-dot menu. This adjustment would guarantee that users have the option to translate messages at any time, enhancing the value of the Telegram Premium subscription.