LWT JavaScript API
    Preparing search index...
    languageForm: {
        allLanguages: Record<string, number>;
        langDefs: Record<
            string,
            [string, string, boolean, string, string, boolean, boolean, boolean],
        >;
        languageId: number;
        languageName: string;
        changeLanguageTextSize(value: string | number): void;
        changePopUpState(): void;
        checkDictionaryChanged(): void;
        checkLanguageChanged(value: string): void;
        checkLibreTranslateStatus(url: URL, key?: string): void;
        checkTranslatorStatus(url: string): void;
        checkTranslatorType(url: string, typeSelect: HTMLSelectElement): void;
        checkVoiceAPI(apiValue: string): boolean;
        checkWordChar(method: string): void;
        displayLibreTranslateError(error: string): void;
        fullFormCheck(): void;
        init(config: LanguageFormConfig): void;
        multiWordsTranslateChange(value: string): void;
        reloadDictURLs(sourceLg?: string, targetLg?: string): void;
        testVoiceAPI(): void;
        wordCharChange(value: string): void;
    } = ...

    Language form object. Handles the language configuration form functionality.

    Type Declaration

    • allLanguages: Record<string, number>

      All existing languages (name -> id map)

    • langDefs: Record<
          string,
          [string, string, boolean, string, string, boolean, boolean, boolean],
      >

      Language definitions loaded from config

    • languageId: number

      Current language ID

    • languageName: string

      Current language name

    • changeLanguageTextSize: function
      • Update the text size example when the slider changes.

        Parameters

        • value: string | number

          The text size percentage

        Returns void

    • changePopUpState: function
      • Handle popup checkbox state change. Popup setting is now stored in the database, not in the URL.

        Returns void

        3.1.0 No longer modifies URLs, popup is stored in database column

    • checkDictionaryChanged: function
      • Handle dictionary URL input change. Validates the URL and triggers related checks.

        Returns void

        3.1.0 No longer detects popup from URL (asterisk or lwt_popup param)

    • checkLanguageChanged: function
      • Check if language name has changed and update UI accordingly. Shows/hides the MeCab option for Japanese.

        Parameters

        • value: string

          The language name

        Returns void

    • checkLibreTranslateStatus: function
      • Check the status of a LibreTranslate server.

        Parameters

        • url: URL

          The LibreTranslate URL

        • key: string = ''

          Optional API key

        Returns void

    • checkTranslatorStatus: function
    • checkTranslatorType: function
      • Check the translator type and update the select box.

        Parameters

        • url: string

          The translator URL

        • typeSelect: HTMLSelectElement

          The select element to update

        Returns void

    • checkVoiceAPI: function
      • Validate the Voice API JSON configuration.

        Parameters

        • apiValue: string

          The API configuration JSON string

        Returns boolean

        true if valid, false otherwise

    • checkWordChar: function
    • displayLibreTranslateError: function
      • Display an error message for LibreTranslate connection issues.

        Parameters

        • error: string

          The error message

        Returns void

    • fullFormCheck: function
    • init: function
    • multiWordsTranslateChange: function
    • reloadDictURLs: function
      • Reload dictionary URLs with the given language codes.

        Parameters

        • sourceLg: string = 'auto'

          Source language code (default: 'auto')

        • targetLg: string = 'en'

          Target language code (default: 'en')

        Returns void

    • testVoiceAPI: function
    • wordCharChange: function