Skip to content
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

feat: keep translation text when switching languages #398

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

VVill-ga
Copy link
Contributor

When a user presses the 'swap languages' button, the translated text should be brought over to the input field, as it is relevant to that language.

Before using the TranslateYou app, I had utilized this feature in Google Translate as a quick first check for translation accuracy. For example, if I translated a sentence into one language, hit the swap button and the English sentence was completely different, I knew I probably shouldn't use that translation.

I only added one line of code for this to work on my device, in the onClick function on the translate button, however I don't know the codebase very well, so let me know if there are any issues with directly assigning the input text like this.

Thanks for the great app!

@Bnyro Bnyro changed the title Keep translation text when switching languages feat: keep translation text when switching languages Jan 31, 2024
@Bnyro
Copy link
Member

Bnyro commented Jan 31, 2024

Thanks for your PR!

I think we should additionally clear the translated text after it is being copied to the input field?

Otherwise we will have the same text as input and translation while we didn't yet get a translation result response from the used translation engine.

@Bnyro Bnyro merged commit df7691d into you-apps:master Jan 31, 2024
12 of 13 checks passed
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.

2 participants