Skip to content

mdsrqbl/gradio-multilingual-keyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradio_multilingual_keyboard

A Custom Gradio component to type any language's text via on-screen buttons and physical keyboard's key-mapping.

  1. gradio_multilingual_keyboard
    1. Example usage
    2. Supported Languages
    3. To Do
    4. Dev Setup

Example usage

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()

gradio_multilingual_keyboard_demo

Supported Languages

  • English
  • Urdu
  • Hindi

To Do

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.

Dev Setup

Documentation

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/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published