Learning with Texts - Fork  2.10.0-fork
Learn foreign languages with texts
Namespaces | Functions
edit_languages.php File Reference

Manage languages. More...

Namespaces

 Lwt
 

Functions

 edit_languages_alert_duplicate ()
 
 edit_languages_refresh ($lid)
 
 edit_languages_delete ($lid)
 
 edit_languages_op_save ()
 
 edit_languages_op_change ($lid)
 
 load_language ($lgid)
 
 edit_languages_displayThirdPartyVoiceAPI ()
 
 edit_language_form ($language)
 
 get_wizard_selectoptions ($currentnativelanguage)
 
 edit_languages_new ()
 
 edit_languages_change ($lid)
 
 edit_languages_display ($message)
 
 edit_languages_do_page ()
 

Detailed Description

Manage languages.

Call: edit_languages.php?.... ... refresh=[langid] ... reparse all texts in lang ... del=[langid] ... do delete ... op=Save ... do insert new ... op=Change ... do update ... new=1 ... display new lang. screen ... chg=[langid] ... display edit screen

PHP version 8.1

Function Documentation

◆ edit_language_form()

edit_language_form (   $language)

Create the form for a language.

Parameters
Language$languageLanguage object

Check for specific language option based on language name

Handles any change on multi-words translate mode.

Check status of the requested translation API.

Check LibreTranslate translator status.

Change the size of demo text.

Handle changes to the words split method.

Build a dictionary/translator URL with the pop-up option

Change the Pop-Up URL of dictionary.

Change Pop-Up checkboxes based on input box value.

Modify the value of the translator select box if not coherent with the URL.

Check the word splitting method.

Check for specific language option based on language name.

Deprecated:
Since 2.10.0, use edit_languages_js.checkLanguageChanged.

Handles any change on multi-words translate mode.

Deprecated:
Since 2.10.0, use edit_languages_js.multiWordsTranslateChange.

Check status of the requested translation API.

Deprecated:
Since 2.10.0, use edit_languages_js.checkTranslatorStatus

Check LibreTranslate translator status.

Deprecated:
Since 2.10.0, use edit_languages_js.checkLibreTranslateStatus

Change the size of demo text.

Deprecated:
Since 2.10.0, use edit_languages_js.changeLanguageTextSize

Handle changes to the words split method.

Deprecated:
Since 2.10.0, use edit_languages_js.wordCharChange

Build a dictionary/translator URL with the pop-up option

Deprecated:
Since 2.10.0, use edit_languages_js.addPopUpOption

Change the Pop-Up URL of dictionary.

Deprecated:
Since 2.10.0, use edit_languages_js.changePopUpState

Change Pop-Up checkboxes based on input box value.

Deprecated:
Since 2.10.0, use edit_languages_js.checkDictionaryChanged

Modify the value of the translator select box if not coherent with the URL.

Deprecated:
Since 2.10.0, use edit_languages_js.checkTranslatorType

Check if all fields are coherent with translator URL.

Check the word splitting method.

Deprecated:
Since 2.10.0, use edit_languages_js.checkWordChar

Check if the help field are coherent with the input fields.

param {element} l_form Language form.

◆ edit_languages_alert_duplicate()

edit_languages_alert_duplicate ( )

Prepare a JavaScript code that checks for duplicate names in languages.

Returns
void

Check if langname exists and its lang# != curr

◆ edit_languages_change()

edit_languages_change (   $lid)

Display a form to edit an existing language.

Parameters
int$lidLanguage ID
Returns
void

@global string $tbpref

◆ edit_languages_delete()

edit_languages_delete (   $lid)

Delete a language.

Parameters
int$lidLanguage ID
Returns
string Info on the number of languages deleted

@global string $tbpref Database table prefix

◆ edit_languages_display()

edit_languages_display (   $message)

Display the standard page of saved languages.

Parameters
string$messageAn information message to display.

@global string $tbpref @global int $debug

Returns
void

◆ edit_languages_do_page()

edit_languages_do_page ( )

Display a variation of the edit_language page.

Returns
void

◆ edit_languages_new()

edit_languages_new ( )

Display a form to create a new language.

Returns
void

Main variable for the language selection wizard.

Fetches langauge data and launches wizard.

Apply wizard based on entered data.

Changed the "current native language".

◆ edit_languages_op_change()

edit_languages_op_change (   $lid)

Edit an existing text in the database.

Parameters
int$lidLanguage ID
Returns
string Number of texts updated and items reparsed.

@global string $tbpref Database table prefix

◆ edit_languages_op_save()

edit_languages_op_save ( )

Save a new language to the database.

Returns
string Success or error message

@global string $tbpref Database table prefix

◆ edit_languages_refresh()

edit_languages_refresh (   $lid)

Refresh sentence and text items from a specific language.

Parameters
int$lidLanguage ID
Returns
string Number of sentences and textitems refreshed

@global string $tbpref Database table prefix

◆ get_wizard_selectoptions()

get_wizard_selectoptions (   $currentnativelanguage)

Returns a dropdown menu of the different languages.

Parameters
string$currentnativelanguageDefault language

◆ load_language()

load_language (   $lgid)

Load a language object based in language ID.

Parameters
int$lgidLanguage ID, if 0 load empty data.
Returns
Language Created object

@global string $tbpref