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

Switching languages doesn't copy already provided input and output #469

Open
sheeerio opened this issue Mar 24, 2023 · 3 comments · May be fixed by #482
Open

Switching languages doesn't copy already provided input and output #469

sheeerio opened this issue Mar 24, 2023 · 3 comments · May be fixed by #482

Comments

@sheeerio
Copy link

sheeerio commented Mar 24, 2023

IMO, using the current output as the new query would greatly improve UX.

Instead of https://beta.apertium.org/#?dir=spa-eng&q=Buenos%20Muchacho
to https://beta.apertium.org/#?dir=eng-spa&q=Buenos%20Muchacho,

https://beta.apertium.org/#?dir=spa-eng&q=Buenos%20Muchacho to https://beta.apertium.org/#?dir=eng-spa&q=Good%20Boy?

@satti-hari-krishna-reddy
Copy link
Contributor

hey @sheeerio Implementing this feature using the current output as the new query would indeed enhance the user experience.

@satti-hari-krishna-reddy
Copy link
Contributor

hey @sushain97 When we click on the 'swap-langs' button, it only swaps srcLang and tgtLang, not the texts inside the forms of TextTranslationForm (i.e., srcText and tgtText). If the 'swap-langs' button also has access to setSrcText() and setTgtText(), we can update the text inputs accordingly. Before I start working on this, I'd like to discuss a possible approach. What if we pass setSrcText and setTgtText as props to both the component where the 'swap-lang' button relies and the TextTranslationForm component? This way, they'll have access to the state. We can define these states in the parent component and pass them as props for better interaction between the components. What are your thoughts on this?

@sushain97
Copy link
Member

@satti-hari-krishna-reddy rather than exposing all of that state to the children components, passing a single onLangSwap handler from the parent components that encapsulates both those functions might be cleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants