diff --git a/do_text_text.php b/do_text_text.php index bdcf8ec5..4059afbc 100644 --- a/do_text_text.php +++ b/do_text_text.php @@ -68,7 +68,8 @@ function getTextData($textid) * * @return array{LgName: string, LgDict1URI: string, * LgDict2URI: string, LgGoogleTranslateURI: string, LgTextSize: int, - * LgRemoveSpaces: int, LgRightToLeft: int}|false|null Record corresponding to this language. + * LgRegexpWordCharacters: string, LgRemoveSpaces: int, + * LgRightToLeft: int, Lg}|false|null Record corresponding to this language. * * @global string $tbpref Table name prefix * @@ -79,7 +80,7 @@ function get_language_settings($langid) global $tbpref; $sql = 'SELECT LgName, LgDict1URI, LgDict2URI, LgGoogleTranslateURI, - LgTextSize, LgRemoveSpaces, LgRightToLeft + LgTextSize, LgRegexpWordCharacters, LgRemoveSpaces, LgRightToLeft FROM ' . $tbpref . 'languages WHERE LgID = ' . $langid; $res = do_mysqli_query($sql); @@ -759,24 +760,28 @@ function do_text_text_content($textid, $only_body=true): void $var_array = array( // Change globals from jQuery hover 'LWT_DATA' => array( + 'language' => array( 'dict_link1' => $wb1, 'dict_link2' => $wb2, 'translator_link' => $wb3, 'delimiter' => tohtml( - str_replace( - array('\\',']','-','^'), - array('\\\\','\\]','\\-','\\^'), - getSettingWithDefault('set-term-translation-delimiters') - ) - ), + str_replace( + array('\\',']','-','^'), + array('\\\\','\\]','\\-','\\^'), + getSettingWithDefault('set-term-translation-delimiters') + ) + ), + 'word_parsing' => $record['LgRegexpWordCharacters'], 'rtl' => $rtlScript ), + 'text' => array( 'id' => $textid, 'reading_position' => $pos, 'annotations' => json_decode(annotation_to_json($ann)) ), + 'settings' => array( 'jQuery_tooltip' => ( getSettingWithDefault('set-tooltip-mode') == 2 ? 1 : 0 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index aa62bbad..b0067553 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,15 +14,20 @@ ones are marked like "v1.0.0-fork". * On `inc/kernel_utility.php`: `LWT_APP_VERSION` and `LWT_RELEASE_DATE`. * On `api.php`: `LWT_API_VERSION` and `LWT_API_RELEASE_DATE`. * `src/js/jq_pgm.js`: `LWT_DATA`. -* Word reading can be allowed on hover or on click. -Pull request [#147](https://github.com/HugoFara/lwt/pull/147) by -[@ProgramComputer](https://github.com/ProgramComputer). -* You can add a custom text reader with the new voice API feature! -A courtesy of [@ProgramComputer](https://github.com/ProgramComputer) on pull request -[#153](https://github.com/HugoFara/lwt/pull/153). -A feature first requested on [#143](https://github.com/HugoFara/lwt/issues/143). -Discussion in open on [#174](https://github.com/HugoFara/lwt/discussions/174). -* Starts a cleaner database management. Database schema is defined in `db/schema/baseline.sql` and no longer in PHP code. +* Imprtant additions to Text-To-Speech (TTS): + * Word can be read on hover or on click. + Pull request [#147](https://github.com/HugoFara/lwt/pull/147) by + [@ProgramComputer](https://github.com/ProgramComputer). + * You can add a custom text reader with the new voice API feature! + A courtesy of [@ProgramComputer](https://github.com/ProgramComputer) on pull request + [#153](https://github.com/HugoFara/lwt/pull/153). + A feature first requested on [#143](https://github.com/HugoFara/lwt/issues/143). + Discussion in open on [#174](https://github.com/HugoFara/lwt/discussions/174). + * New JS functions: `readTextWithExternal` to read a text with an external + application and `speechDispatcher` that can choose a text reader + (browser or third party). +* Starts a cleaner database management. Database schema is defined in +`db/schema/baseline.sql` and no longer in PHP code. ### Changed @@ -41,6 +46,8 @@ Discussion in open on [#174](https://github.com/HugoFara/lwt/discussions/174). Solves [#129](https://github.com/HugoFara/lwt/issues/129), thanks to the help of PR [#168](https://github.com/HugoFara/lwt/pull/168). * Text reading position was not working consistently when adding several known words. +* Japanese was always requiring MeCab for TTS, even if it was not used +([#155](https://github.com/HugoFara/lwt/pull/155)). ### Deprecated diff --git a/docs/info.html b/docs/info.html index 45141907..f05fe5d9 100644 --- a/docs/info.html +++ b/docs/info.html @@ -2195,7 +2195,9 @@

Added

src/js/jq_pgm.js: LWT_DATA. -
  • Word reading can be allowed on hover or on click. +
  • Imprtant additions to Text-To-Speech (TTS): + +
  • +
  • Starts a cleaner database management. Database schema is defined in +db/schema/baseline.sql and no longer in PHP code.
  • Changed

    Deprecated