HTTP Server for Tux Droid
|
Public Member Functions | |
def | toUtf8 (text, detectConsole=False) |
def | isUtf8 (text) |
def | translate (text, fromLang, toLang, inConsole=False) |
def | autoTranslate (text, toLang, inConsole=False) |
def | getLanguage (text, default="en_US") |
def | getClipboardText (inConsole=False) |
def | getTranslatedClipboardText (toLang, inConsole=False) |
Static Public Attributes | |
toUtf8 | |
isUtf8 | |
translate | |
autoTranslate | |
getLanguage | |
getClipboardText | |
getTranslatedClipboardText | |
Static Private Attributes | |
__languageFinder | |
__textFilter | |
Utilities for string data.
def util.string.String.String.autoTranslate | ( | text, | |
toLang, | |||
inConsole = False |
|||
) |
Translate a text with auto-detection of the input text language. @param text: Text to translate. @param toLang: Language of the translated text. @param inConsole: If the text will be showed in the console. @return: The translated text in or empty string if fail. - If the text must be showed in the console, the output string is reencoded in the console encoding, otherwise it is encoded in 'utf-8'.
def util.string.String.String.getClipboardText | ( | inConsole = False | ) |
Get the last copied text in the clipboard. @return: A string.
def util.string.String.String.getLanguage | ( | text, | |
default = "en_US" |
|||
) |
Find the language of a text. @param text: Input text. @param default: Default returned language if the function can't retrieve the text language. @return: The text language.
def util.string.String.String.getTranslatedClipboardText | ( | toLang, | |
inConsole = False |
|||
) |
Get the last copied text in the clipboard, translated with language auto-detection. @param toLang: Language of the translated text. @param inConsole: If the text will be showed in the console. @return: A string.
def util.string.String.String.isUtf8 | ( | text | ) |
Check if the text is encoded in 'utf-8'. @param text: Input text to check. @return: A boolean.
def util.string.String.String.toUtf8 | ( | text, | |
detectConsole = False |
|||
) |
Force the text encoding to 'utf-8'. @param text: Input text in any encoding. @return: The 'utf-8' text.
def util.string.String.String.translate | ( | text, | |
fromLang, | |||
toLang, | |||
inConsole = False |
|||
) |
Translate a text. @param text: Text to translate. @param fromLang: Language of the original text. @param toLang: Language of the translated text. @param inConsole: If the text will be showed in the console. @return: The translated text in or empty string if fail. - If the text must be showed in the console, the output string is reencoded in the console encoding, otherwise it is encoded in 'utf-8'.
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |