Open sheeerio opened 1 year ago
hey @sheeerio Implementing this feature using the current output as the new query would indeed enhance the user experience.
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?
@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.
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
tohttps://beta.apertium.org/#?dir=eng-spa&q=Buenos%20Muchacho
,https://beta.apertium.org/#?dir=spa-eng&q=Buenos%20Muchacho
tohttps://beta.apertium.org/#?dir=eng-spa&q=Good%20Boy
?