Optional Settings

Optional Parameters for Swalekh Integration

Swalekh offers optional functionalities that enhance user interaction by allowing dynamic adjustments to language and input mode during text entry. The two primary optional parameters are:

  • Language Change (langToggle)
  • Mode Change (modeToggle)

Language Change (langToggle)

The Language Change feature in Swalekh enables users to seamlessly switch between different languages during their typing session. This functionality is crucial for applications that cater to multilingual users, as it allows them to input text in their preferred language without interruption.

Functionality

  • Users can change the language using the langToggle function, which dynamically updates the input language.
  • For instance, if a user begins typing in Hindi and wishes to switch to Bengali, they can easily do so with this option.

User Experience

  • This feature enhances user experience by providing flexibility, especially in diverse linguistic environments where users may need to switch between languages frequently.
  • By allowing users to adjust the language without disrupting their typing flow, Swalekh accommodates the needs of users who are multilingual or who work in environments where multiple languages are commonly used.

Example Usage

In your Swalekh configuration, enable language toggling as follows:

await window.loadSwalekh({
  querySel: '#swalekh-textarea',
  lang: 'hi', // Default language
  mode: 'phonetic',
  langToggle: true, // Enable language toggle
  modeToggle: true, // Enable mode toggle
});

Mode Change (modeToggle)

The Mode Change functionality allows users to select their preferred input method between Phonetic and Keyboard modes. This flexibility caters to different user preferences and typing styles.

Phonetic Mode

  • In this mode, users can type words using Roman characters, and the input is automatically transliterated into the target language.
  • For example, typing "namaste" will convert to "नमस्ते" in Hindi.

Keyboard Mode

  • This mode provides a virtual keyboard that allows users to type directly in the script of the chosen language.
  • Users who are familiar with the native script can type without needing to transliterate, enhancing accuracy and speed.

Example Usage

To enable mode switching in your Swalekh configuration, include the modeToggle parameter:

await window.loadSwalekh({
  querySel: '#swalekh-textarea',
  lang: 'hi', // Set default language
  mode: 'phonetic', // Default mode
  langToggle: true, // Enable language toggle
  modeToggle: true, // Enable mode toggle
});

User Experience

  • The Mode Change feature allows users to select their preferred input style based on their comfort and familiarity with the language.
  • By providing both phonetic and keyboard modes, Swalekh caters to a broader audience, accommodating both novice and experienced users.

Conclusion

The optional parameters langToggle and modeToggle in Swalekh provide enhanced flexibility and user experience, making it easier for multilingual users to interact with applications. By allowing users to switch languages and input methods seamlessly, Swalekh creates a more inclusive and efficient typing environment.

For further customization options and advanced usage, please refer to the Swalekh API Documentation or contact our support team.