Get text from file
get language of the text
The getLanguageText() function detects the language in which the text is written. The function takes a string of text as an input parameter and returns the language.
1 2 3 4 5 6 7 | |
get language of the text from file
The getLanguageFile() function detects the language of the text content in the file. The function takes a file id as an input parameter and returns the language. It only works on text files.
1 2 3 4 5 | |
Translate the text
The translateText() function translates a given text to a target language. This function accepts a text and a target language as input and returns the translated text.
1 2 3 4 5 6 7 8 | |
This function is useful for applications that require text translation capabilities, such as multilingual chatbots or internationalization of web content. The function logs the translation result in the database and returns the translated text to the caller. For example, translating “Hello, World!” to French would return “Bonjour, le monde!”.
Translate the file
The translateFile() function translates the text contents from a file to a target language. This function accepts a file id and a target language as input and returns the translated text. It only works on text files.
1 2 3 4 5 6 7 | |