Skip to content
Snippets Groups Projects
Unverified Commit d04d8deb authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #5082 from rcordovano/text-trans-api-mods-for-4.12.0

Text trans api mods for 4.12.0
parents 982d2f2e 755743e0
No related branches found
No related tags found
No related merge requests found
Showing
with 114 additions and 55 deletions
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
import java.util.Optional; import java.util.Optional;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferences;
import javax.annotation.concurrent.GuardedBy;
/** /**
* Performs a lookup for a TextTranslator service provider and if present, will * Performs a lookup for a TextTranslator service provider and if present, will
...@@ -33,6 +34,7 @@ public final class TextTranslationService { ...@@ -33,6 +34,7 @@ public final class TextTranslationService {
private final static TextTranslationService tts = new TextTranslationService(); private final static TextTranslationService tts = new TextTranslationService();
private final Collection<? extends TextTranslator> translators; private final Collection<? extends TextTranslator> translators;
@GuardedBy("this")
private Optional<TextTranslator> selectedTranslator; private Optional<TextTranslator> selectedTranslator;
private TextTranslationService() { private TextTranslationService() {
...@@ -50,7 +52,7 @@ public static TextTranslationService getInstance() { ...@@ -50,7 +52,7 @@ public static TextTranslationService getInstance() {
* Update the translator currently in use to match the one saved to the user * Update the translator currently in use to match the one saved to the user
* preferences * preferences
*/ */
public void updateSelectedTranslator() { synchronized void updateSelectedTranslator() {
String translatorName = UserPreferences.getTextTranslatorName(); String translatorName = UserPreferences.getTextTranslatorName();
for (TextTranslator translator : translators) { for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) { if (translator.getName().equals(translatorName)) {
...@@ -75,7 +77,7 @@ public void updateSelectedTranslator() { ...@@ -75,7 +77,7 @@ public void updateSelectedTranslator() {
* when specific translation * when specific translation
* implementations fail * implementations fail
*/ */
public String translate(String input) throws NoServiceProviderException, TranslationException { public synchronized String translate(String input) throws NoServiceProviderException, TranslationException {
if (hasProvider()) { if (hasProvider()) {
return selectedTranslator.get().translate(input); return selectedTranslator.get().translate(input);
} }
...@@ -92,7 +94,7 @@ public String translate(String input) throws NoServiceProviderException, Transla ...@@ -92,7 +94,7 @@ public String translate(String input) throws NoServiceProviderException, Transla
* *
* @throws NoServiceProviderException * @throws NoServiceProviderException
*/ */
public TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException { TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException {
for (TextTranslator translator : translators) { for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) { if (translator.getName().equals(translatorName)) {
return translator; return translator;
...@@ -107,7 +109,7 @@ public TextTranslator getTranslatorByName(String translatorName) throws NoServic ...@@ -107,7 +109,7 @@ public TextTranslator getTranslatorByName(String translatorName) throws NoServic
* *
* @return an unmodifiable collection of TextTranslators * @return an unmodifiable collection of TextTranslators
*/ */
public Collection<? extends TextTranslator> getTranslators() { Collection<? extends TextTranslator> getTranslators() {
return Collections.unmodifiableCollection(translators); return Collections.unmodifiableCollection(translators);
} }
...@@ -117,16 +119,16 @@ public Collection<? extends TextTranslator> getTranslators() { ...@@ -117,16 +119,16 @@ public Collection<? extends TextTranslator> getTranslators() {
* *
* @return * @return
*/ */
public boolean hasProvider() { public synchronized boolean hasProvider() {
return selectedTranslator.isPresent(); return selectedTranslator.isPresent();
} }
/** /**
* Returns the hard limit for translation request sizes. * Gets the maximum number of characters allowed in a translation request.
* *
* @return * @return The maximum character count.
*/ */
public int getMaxPayloadSize() { public synchronized int getMaxTextChars() {
return selectedTranslator.get().getMaxPayloadSize(); return selectedTranslator.get().getMaxTextChars();
} }
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
package org.sleuthkit.autopsy.texttranslation; package org.sleuthkit.autopsy.texttranslation;
import java.awt.Component; import javax.swing.JPanel;
/** /**
* Interface for creating text translators. Implementing classes will be picked * Interface for creating text translators. Implementing classes will be picked
...@@ -45,22 +45,24 @@ public interface TextTranslator { ...@@ -45,22 +45,24 @@ public interface TextTranslator {
String getName(); String getName();
/** /**
* Get the component to display on the settings options panel when this * Get the JPanel to display on the settings options panel when this
* TextTranslator is selected * TextTranslator is selected
* *
* @return the component which displays the settings options * @return the panel which displays the settings options
*/ */
Component getComponent(); JPanel getSettingsPanel();
/** /**
* Save the settings as they have been modified in the component. * Saves the current state of the settings in the settings panel.
*
* @throws TranslationConfigException
*/ */
void saveSettings(); void saveSettings() throws TranslationConfigException;
/** /**
* Returns the hard limit for translation request sizes. * Gets the maximum number of characters allowed in a translation request.
* *
* @return * @return The maximum character count.
*/ */
int getMaxPayloadSize(); int getMaxTextChars();
} }
/*
* Autopsy Forensic Browser
*
* Copyright 2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.texttranslation;
/**
* Instances of this exception class are thrown when there is an error
* configuring text translation.
*/
public class TranslationConfigException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public TranslationConfigException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public TranslationConfigException(String message, Throwable cause) {
super(message, cause);
}
}
...@@ -22,13 +22,8 @@ ...@@ -22,13 +22,8 @@
* Provides a system exception for Text Translation errors * Provides a system exception for Text Translation errors
*/ */
public class TranslationException extends Exception { public class TranslationException extends Exception {
/** private static final long serialVersionUID = 1L;
* Constructs a new exception with null as its message.
*/
public TranslationException() {
super();
}
/** /**
* Constructs a new exception with the specified message. * Constructs a new exception with the specified message.
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<Component class="javax.swing.JLabel" name="translationServiceLabel"> <Component class="javax.swing.JLabel" name="translationServiceLabel">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<Component class="javax.swing.JLabel" name="translationOptionsDescription"> <Component class="javax.swing.JLabel" name="translationOptionsDescription">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.sleuthkit.autopsy.texttranslation.ui; package org.sleuthkit.autopsy.texttranslation;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
...@@ -27,14 +27,12 @@ ...@@ -27,14 +27,12 @@
import javax.swing.JLabel; import javax.swing.JLabel;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.texttranslation.NoServiceProviderException;
import org.sleuthkit.autopsy.texttranslation.TextTranslationService;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
* Options panel to display translation options * Options panel to display translation options
*/ */
public class TranslationOptionsPanel extends javax.swing.JPanel { final class TranslationOptionsPanel extends javax.swing.JPanel {
private final static Logger logger = Logger.getLogger(TranslationOptionsPanel.class.getName()); private final static Logger logger = Logger.getLogger(TranslationOptionsPanel.class.getName());
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -45,7 +43,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel { ...@@ -45,7 +43,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
* Creates new form TranslationOptionsPanel * Creates new form TranslationOptionsPanel
*/ */
@Messages({"TranslationOptionsPanel.translationDisabled.text=Translation disabled"}) @Messages({"TranslationOptionsPanel.translationDisabled.text=Translation disabled"})
public TranslationOptionsPanel(TranslationOptionsPanelController theController) { TranslationOptionsPanel(TranslationOptionsPanelController theController) {
initComponents(); initComponents();
controller = theController; controller = theController;
translatorComboBox.addItem(Bundle.TranslationOptionsPanel_translationDisabled_text()); translatorComboBox.addItem(Bundle.TranslationOptionsPanel_translationDisabled_text());
...@@ -78,7 +76,7 @@ private void loadSelectedPanelSettings() { ...@@ -78,7 +76,7 @@ private void loadSelectedPanelSettings() {
translationServicePanel.removeAll(); translationServicePanel.removeAll();
if (translatorComboBox.getSelectedItem() != null && !translatorComboBox.getSelectedItem().toString().equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) { if (translatorComboBox.getSelectedItem() != null && !translatorComboBox.getSelectedItem().toString().equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try { try {
Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getComponent(); Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getSettingsPanel();
panel.addPropertyChangeListener(new PropertyChangeListener() { panel.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
...@@ -126,7 +124,7 @@ void store() { ...@@ -126,7 +124,7 @@ void store() {
if (currentSelection != null && !currentSelection.equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) { if (currentSelection != null && !currentSelection.equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try { try {
TextTranslationService.getInstance().getTranslatorByName(currentSelection).saveSettings(); TextTranslationService.getInstance().getTranslatorByName(currentSelection).saveSettings();
} catch (NoServiceProviderException ex) { } catch (NoServiceProviderException | TranslationConfigException ex) {
logger.log(Level.WARNING, "Unable to save settings for TextTranslator named: " + currentSelection, ex); logger.log(Level.WARNING, "Unable to save settings for TextTranslator named: " + currentSelection, ex);
} }
} }
...@@ -172,7 +170,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ...@@ -172,7 +170,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGap(10, 10, 10) .addGap(10, 10, 10)
.addComponent(translatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(translatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addComponent(translationOptionsDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)) .addComponent(translationOptionsDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 462, Short.MAX_VALUE))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.sleuthkit.autopsy.texttranslation.ui; package org.sleuthkit.autopsy.texttranslation;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;
......
...@@ -26,11 +26,12 @@ ...@@ -26,11 +26,12 @@
import com.squareup.okhttp.Request; import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody; import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response; import com.squareup.okhttp.Response;
import java.awt.Component;
import java.io.IOException; import java.io.IOException;
import javax.swing.JPanel;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.texttranslation.TextTranslator; import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException; import org.sleuthkit.autopsy.texttranslation.TranslationException;
/** /**
...@@ -132,12 +133,12 @@ public String getName() { ...@@ -132,12 +133,12 @@ public String getName() {
} }
@Override @Override
public Component getComponent() { public JPanel getSettingsPanel() {
return settingsPanel; return settingsPanel;
} }
@Override @Override
public void saveSettings() { public void saveSettings() throws TranslationConfigException {
settings.setAuthenticationKey(settingsPanel.getAuthenticationKey()); settings.setAuthenticationKey(settingsPanel.getAuthenticationKey());
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode()); settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.saveSettings(); settings.saveSettings();
...@@ -173,7 +174,7 @@ private String parseJSONResponse(String json_text) throws TranslationException { ...@@ -173,7 +174,7 @@ private String parseJSONResponse(String json_text) throws TranslationException {
} }
@Override @Override
public int getMaxPayloadSize() { public int getMaxTextChars() {
return MAX_STRING_LENGTH; return MAX_STRING_LENGTH;
} }
} }
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
import com.google.cloud.translate.Translate; import com.google.cloud.translate.Translate;
import com.google.cloud.translate.TranslateOptions; import com.google.cloud.translate.TranslateOptions;
import com.google.cloud.translate.Translation; import com.google.cloud.translate.Translation;
import java.awt.Component;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
...@@ -31,12 +30,14 @@ ...@@ -31,12 +30,14 @@
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JPanel;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.texttranslation.TextTranslator; import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException; import org.sleuthkit.autopsy.texttranslation.TranslationException;
/** /**
...@@ -133,7 +134,7 @@ public String getName() { ...@@ -133,7 +134,7 @@ public String getName() {
} }
@Override @Override
public Component getComponent() { public JPanel getSettingsPanel() {
return settingsPanel; return settingsPanel;
} }
...@@ -172,7 +173,7 @@ private void loadTranslator() { ...@@ -172,7 +173,7 @@ private void loadTranslator() {
} }
@Override @Override
public void saveSettings() { public void saveSettings() throws TranslationConfigException {
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode()); settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.setCredentialPath(settingsPanel.getCredentialsPath()); settings.setCredentialPath(settingsPanel.getCredentialsPath());
settings.saveSettings(); settings.saveSettings();
...@@ -180,7 +181,7 @@ public void saveSettings() { ...@@ -180,7 +181,7 @@ public void saveSettings() {
} }
@Override @Override
public int getMaxPayloadSize() { public int getMaxTextChars() {
return MAX_PAYLOAD_SIZE; return MAX_PAYLOAD_SIZE;
} }
} }
OptionsCategory_Name_Machine_Translation=Machine Translation OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR: TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete. TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show: TranslationContentPanel.showLabel.text=Show:
...@@ -17,12 +17,6 @@ TranslatedTextViewer.title=Translation ...@@ -17,12 +17,6 @@ TranslatedTextViewer.title=Translation
TranslatedTextViewer.toolTip=Displays translated file text. TranslatedTextViewer.toolTip=Displays translated file text.
TranslationContentPanel.autoDetectOCR=Autodetect language TranslationContentPanel.autoDetectOCR=Autodetect language
TranslationContentPanel.ocrLabel.text=OCR: TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete. TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show: TranslationContentPanel.showLabel.text=Show:
...@@ -96,7 +96,7 @@ public void setNode(final Node node) { ...@@ -96,7 +96,7 @@ public void setNode(final Node node) {
} }
} }
int payloadMaxInKB = TextTranslationService.getInstance().getMaxPayloadSize() / 1000; int payloadMaxInKB = TextTranslationService.getInstance().getMaxTextChars() / 1000;
panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB)); panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB));
//Force a background task. //Force a background task.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment