![]() |
Learning with Texts - Fork
2.10.0-fork
Learn foreign languages with texts
|
Public Member Functions | |
setLangFrom ($lang) | |
setLangTo ($lang) | |
__construct ($from, $to) | |
translate ($string) | |
Static Public Member Functions | |
static | getDomain ($domain) |
static | array_iunique ($array) |
static | setDomain ($domain) |
static | makeCurl ($url, $cookieSet=false) |
static | staticTranslate ( $string, $from, $to, $time_token=null, $domain=self::DEFAULT_DOMAIN) |
Data Fields | |
$lastResult = "" | |
const | DEFAULT_DOMAIN = null |
Wrapper class to get translation.
See staticTranslate for a clssical translation.
|
static |
Return the current domain.
string | void | $domain | (Optionnal) Google Translate domain to use.
|
|
static |
Returns an array of Translations
string | $string | Word to translate |
string | $from | Source language code (i.e. en,de,fr,...) |
string | $to | Target language code (i.e. en,de,fr,...) all supported language codes can be found here: https://cloud.google.com/translate/docs/basic/discovering-supported-languages#getting_a_list_of_supported_languages |
int[] | null | $time_token | (optional) array() from https://translate.google.com. If empty, array(408254,585515986) is used |
string | $domain | (optional) Connect to Google Domain (i.e. 'com' for https://translate.google.com). If empty, a random domain will be used (the default value can be altered by changing DEFAULT_DOMAIN) Possible values: ('com.ar', 'at', 'com.au', 'be', 'com.br', 'ca', 'cat', 'ch', 'cl', 'cn', 'cz', 'de', 'dk', 'es', 'fi', 'fr', 'gr', 'com.hk', 'hr', 'hu', 'co.id', 'ie', 'co.il', 'im', 'co.in', 'it', 'co.jp', 'co.kr', 'com.mx', 'nl', 'no', 'pl', 'pt', 'ru', 'se', 'com.sg', 'co.th', 'com.tw', 'co.uk', 'com') |