If we're talking about an HTML text input field, you can use `dir=auto`. Other tools should have similar features. This approach is also very common on paper, which naturally flows in the correct direction.
Edit: oh use case? Imagine a PDF form you'd like someone to fill out, or a page that may get printed. You could create two forms and let the person filling out the form pick their language, but the person processing the form may prefer to read the form in the other language.