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

Ability to change the keyboard language programmatically #99606

Open
KarrarMohamed opened this issue Mar 5, 2022 · 30 comments
Open

Ability to change the keyboard language programmatically #99606

KarrarMohamed opened this issue Mar 5, 2022 · 30 comments
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team

Comments

@KarrarMohamed
Copy link

I have a page with multiple textfields and some of the textfields require the user to change the current language from arabic to english and vice versa to insert the proper input

So I have searched and figured out this feature is not supported yet

@KarrarMohamed KarrarMohamed changed the title Nee to change the keyboard language programmatically Need to change the keyboard language programmatically Mar 5, 2022
@maheshj01 maheshj01 added the in triage Presently being triaged by the triage team label Mar 7, 2022
@maheshj01
Copy link
Member

Hi @KarrarMohamed, Thanks for filing the issue. This looks like a partial duplicate of #25841

@maheshj01 maheshj01 added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability and removed in triage Presently being triaged by the triage team labels Mar 7, 2022
@maheshj01 maheshj01 changed the title Need to change the keyboard language programmatically Ability to change the keyboard language programmatically Mar 7, 2022
@yqjroy
Copy link

yqjroy commented Mar 8, 2022

I have a page with multiple textfields and some of the textfields require the user to change the current language from arabic to english and vice versa to insert the proper input

So I have searched and figured out this feature is not supported yet

i also need this feature. but i have not found it yet.

@maheshj01
Copy link
Member

Everyone who would like to support this feature request please leave a 👍🏻 on the original post. The number of upvotes is one among many measures which help the team members to prioritize the work.

@yqjroy

This comment was marked as off-topic.

@goderbauer goderbauer added the P3 Issues that are less important to the Flutter project label Mar 16, 2022
@andim27

This comment was marked as off-topic.

@yqjroy

This comment was marked as off-topic.

@nero-angela
Copy link
Contributor

I run a vocabulary app, and I get a lot of emails requesting this feature. It would be nice if this feature not only supports English and Arabic cases, but also other languages.

For example, the features that users expect from a vocabulary app are:
If the word TextField is entered in English and the meaning TextField is entered in Korean, the English keyboard appears when the user focuses on the word TextField. Conversely, when the user focuses on the meaning TextField, the Korean keyboard appears.

Of course, this will only work if the user has a keyboard for that language. It would be great if that feature works even if the user is using an external keyboard.

There are native apps that support this feature, and it would be nice if it could be implemented with Flutter as well.

AOS TextView setImeHintLocales
iPhone: Change Keyboard language programmatically
Similar issues: #91752

@yqjroy

This comment was marked as off-topic.

@abasu0713
Copy link

Please bump this up kindly!. This would be great to have. We want to support multiple languages, and our application has a lot of form fields.. The keyboard language takes the default locale. And it would be awesome if we could override that without having to use something like virtual keyboards.

@yqjroy

This comment was marked as off-topic.

@flutter-triage-bot flutter-triage-bot bot added team-framework Owned by Framework team triaged-framework Triaged by Framework team labels Jul 8, 2023
@Etiene
Copy link

Etiene commented Aug 10, 2023

I make a language learning app and this is one of the most requested features. Both iOS and Android have a way to do this natively, but I don't wanna use views to create a custom input for every text field of my app as so many things could go wrong when doing that.

@yqjroy

This comment was marked as spam.

@alevlako
Copy link

This is a highly requested functionality for desktop office and mobile applications. Please pay attention to the possibility to implement it in the core flutter.

@felicedev
Copy link

I also need this feature, is that just implemented?

@yqjroy

This comment was marked as spam.

@PetrKubes97
Copy link

I'd also love to have this feature.

@MajidDgNXT
Copy link

Any update?

@yqjroy

This comment was marked as spam.

@kaomoneus
Copy link

@goderbauer this feature seems to be critical for some apps. Could we escalate priority? Thanks!

@yqjroy

This comment was marked as spam.

@justinmc
Copy link
Contributor

Let's look at the feasibility of bringing this feature to the framework

✔️ Do native APIs exist?

It looks like the answer to this is yes on both Android and iOS according to @nero-angela (#99606 (comment)) and @Etiene (#99606 (comment)) above, though I haven't tried it myself.

Is this something we should also support for hardware keyboard languages? For example, changing the system keyboard language from the app in a desktop Flutter app.

❓ Could this be done as a plugin with no framework change?

Maybe this would be better as a plugin that would be called, say, in onFocus, rather than as a TextField parameter. Especially if we don't have an equivalent way of applying this to desktop platforms. Would that still meet everyone's needs? Would it be technically sound, or would calling it on onFocus cause an ugly jump between languages or something?

Next steps

I think someone needs to try out the native API on Android/iOS and determine whether or not it would work as a plugin.

@alevlako
Copy link

We already have a plugin with requested functionality, but it does not use a standard keyboard.

@justinmc
Copy link
Contributor

That plugin appears to render the keyboard itself using Flutter. I think we'd need to see something that calls a native API to change the system software keyboard's language, if possible.

@alevlako
Copy link

I solved the problem for Windows using pure dart with ffi and have been following this issue for over a year with no changes yet. But I see that the native solution for mobiles exists, because, for example the Google Translate application has the discussed functionality for both Android and iPhone.

@opxdelwin
Copy link
Contributor

+1 for bump ; really need this feature as we're making an app which would need typing in multiple languages...

Solution by @justinmc sounds great

@yqjroy

This comment was marked as spam.

@selvam920
Copy link

+1

@yqjroy
Copy link

yqjroy commented Aug 29, 2024 via email

@yoyo930021
Copy link

yoyo930021 commented Oct 9, 2024

I study it.

✔️ Do native APIs exist?

Android EditorInfo API, only work above API 24
https://developer.android.com/reference/android/view/inputmethod/EditorInfo#hintLocales

iOS no any public API, there are some workround in stackoverflow post, but some report no effect. We need more test.

❌Could this be done as a plugin with no framework change?

I try to study flutter code.
I don't think it's possible to implement this with a plugin, but it could be that I'm not familiar enough with it.

Android: https://github.com/flutter/engine/blob/21d336139a9401d6c2d51494249c0ec70fed0224/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java#L348
iOS: https://github.com/flutter/engine/blob/21d336139a9401d6c2d51494249c0ec70fed0224/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm#L590

@yqjroy
Copy link

yqjroy commented Oct 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team triaged-framework Triaged by Framework team
Projects
None yet
Development

No branches or pull requests