|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.translate.E4ExternalTranslation
public final class E4ExternalTranslation
Embedd some external translation tool.
The tool needs to understand the translation request using a URL connection,
and the result must be embedded in either &tt;HTML> or <XML< output
with a unique identification. This identification might be a sequence of
HTML or XML tags. Beside this, the language codes (Language
must match in lower case letters the languages provided.
Additionally, some settings are required in your properties file (@link #externalTranslationPossible()}.
Please note, that you might require some license agreement for the translation services embedded! This is
not part of the e4s, and it depends on the tool and license you require.
E4Label,
Language| Field Summary | |
|---|---|
static java.lang.String |
SETTINGS_CREDITS
Some external translation services are free, but they require the display of an logo. |
static java.lang.String |
SETTINGS_RESULT_POSTFIX
Definition for an external translation program result (ending with). |
static java.lang.String |
SETTINGS_RESULT_PREFIX
Definition for an external translation program result (beginning with). |
static java.lang.String |
SETTINGS_URL_REQUEST_PATTERN
Definition for an external translation program call. |
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
E4ExternalTranslation()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
Get version info string from subversion. |
static java.lang.String |
externalTranslation(java.lang.String txt,
Language src_lan,
Language dest_lan)
Get an online translation from any external translation service, connected using a URL. |
static boolean |
externalTranslationPossible()
Test, if the necessary settings are contained in the property file. |
static java.lang.String |
getCredits()
Get external translation logo. |
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SETTINGS_URL_REQUEST_PATTERN
E4Settings), and
the <SLAN> will be replaced using the source language, the <DLAN> will be replaced using the destination
language and the <TEXT> tag will be replaced the text for translation in URL encoding.
This setting is required.
E4Settings,
Language,
E4ExternalTranslation(),
SETTINGS_RESULT_PREFIX,
SETTINGS_RESULT_POSTFIX,
Constant Field Valuespublic static final java.lang.String SETTINGS_RESULT_PREFIX
SETTINGS_RESULT_POSTFIX.
This setting is required.
SETTINGS_URL_REQUEST_PATTERN,
Constant Field Valuespublic static final java.lang.String SETTINGS_RESULT_POSTFIX
SETTINGS_URL_REQUEST_PATTERN,
Constant Field Valuespublic static final java.lang.String SETTINGS_CREDITS
getCredits(),
Constant Field Values| Constructor Detail |
|---|
public E4ExternalTranslation()
| Method Detail |
|---|
public static java.lang.String externalTranslation(java.lang.String txt,
Language src_lan,
Language dest_lan)
SETTINGS_URL_REQUEST_PATTERN, SETTINGS_RESULT_PREFIX and SETTINGS_RESULT_POSTFIX.
txt - the text for translationsrc_lan - the source languagedest_lan - the destination language
externalTranslationPossible()public static boolean externalTranslationPossible()
SETTINGS_URL_REQUEST_PATTERN, SETTINGS_RESULT_PREFIX
and SETTINGS_RESULT_POSTFIX are defined in the E4Settings.E4ExternalTranslation()public static java.lang.String getCredits()
SETTINGS_CREDITSpublic static java.lang.String _getSVNVersionString()
E4Util.getRevisionCodeFromSVN(Class)
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||