A Custom Gradio component to type any language's text via on-screen buttons and physical keyboard's key-mapping.
pip install gradio-multilingual-keyboard
Note
to install the compoent directly from the repository in an app, first run gradio cc build
to generate index.js and style.css files.
import gradio as gr
from gradio_multilingual_keyboard import multilingual_keyboard
with gr.Blocks() as gradio_app:
gr.Markdown(f"# Multilingual Keyboard 🌐 ⌨")
multilingual_keyboard(languages=["english", "urdu"])
if __name__ == "__main__":
gradio_app.launch()
- English
- Urdu
- Hindi
edit frontend/index.svelte
:
- while a button is active or a corresponding key is down, turn it primary
- add guideline in readme to extend for new languages.
- move transliteration below keyboard toggle button.
- Bug: submit button does not work after text is written via virtual keyboard
- allow user to link their textArea component or their languageDropDown with this keyboard
- pass the value of text box and dropdown as inputs to the submit button (update examples accordingly)
- map physical keys to unicode
- update transliteration for keystrokes, backspace, cut, paste, etc.
- prepend a transliteration label
- When shift is pressed on virtual keyboard, keep it active until another key is pressed
- if shift or Caps is pressed on virtual keyboard, physical keyboard should also write accordingly
- add a switch for standard and phonetic keyboards for each language
- add support for top 50 languages, you may use a library.
git clone https://github.com/mdsrqbl/gradio-multilingual-keyboard.git
cd gradio-multilingual-keyboard
pip install -e .
cd frontend
npm install
cd ..
gradio cc dev
♻ Launching demo/app.py in reload mode
Backend Server: http://127.0.0.1:7860
Frontend Server (Go here): http://localhost:7861/