private static final Log log = LogFactory.getLog(DocumentTranslator_Impl.class);
public TDocument translate(TTranslationRequest translationRequest)
throws TDictionaryNotAvailable, TTextNotTranslatable, RemoteException {
TDocument document = translationRequest.getDocument();
Locale sourceLocale = new Locale(document.getHead().getLanguage());
Locale targetLocale = new Locale(translationRequest.getTargetLanguage());
DictionaryFactory dictionaryFactory = DictionaryFactory.getInstance(sourceLocale, targetLocale);
Dictionary dictionary = dictionaryFactory.createDictionary(sourceLocale, targetLocale);
return dictionary.translate(document);
}