Compare commits

..

No commits in common. "v2.00" and "master" have entirely different histories.

37 changed files with 151 additions and 1509 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
.idea/
.DS_Store
/build
/captures

12
.idea/.gitignore vendored
View File

@ -1,12 +0,0 @@
# Default ignored files
/shelf/
/usage.statistics.xml
/workspace.xml
#extra ignored files
/caches/
/gradle.xml
/dataSources.ids
/datasources.xml
/modules.xml
/dictionaries
/libraries

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownSettings">
<option name="previewPanelProviderInfo">
<ProviderInfo name="Compose (experimental)" className="com.intellij.markdown.compose.preview.ComposePanelProvider" />
</option>
</component>
</project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

View File

@ -1,9 +0,0 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,74 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<module name="RTranslator.app" />
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
<option name="CLEAR_APP_STORAGE" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="RESTORE_ENABLED" value="false" />
<option name="RESTORE_FILE" value="" />
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEBUGGER_TYPE" value="Auto" />
<Auto>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Auto>
<Hybrid>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Hybrid>
<Java>
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Java>
<Native>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
<option name="DEBUG_SANDBOX_SDK" value="false" />
</Native>
<Profilers>
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
<option name="STARTUP_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY" value="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
<method v="2">
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@ -106,9 +106,7 @@ To speak, RTranslator uses the system TTS of your phone, so the quality of the l
The supported languages seen above are all compatible with <a href="https://play.google.com/store/apps/details?id=com.google.android.tts&pcampaignid=web_share">Google TTS</a>, which is the recommended TTS (although you can use the TTS you want).
To change the system TTS (and therefore the TTS used by RTranslator), download the TTS you want to use from the Play Store, or from the source you prefer, and open RTranslator, then open its settings (top right) and, in the "Output" section, click on "Text to Speech", at this point the system settings will open in the section where you can select the preferred system TTS engine (among those installed), at this point, if you have changed the preferred engine, restart RTranslator to apply the changes (close it from the recent apps and then reopen it).
**Note:** If after that the TTS doesn't work, you can clear the cache of RTranslator and the TTS from Android Applications settings, reboot the phone and retry.
To change the system TTS (and therefore the TTS used by RTranslator), download the TTS you want to use from the Play Store, or from the source you prefer, and open RTranslator, then open its settings (top right) and, in the "Output" section, click on "Text to Speech", at this point the system settings will open in the section where you can select the preferred system TTS engine (among those installed), at this point, if you have changed the preferred engine, restart RTranslator to apply the changes.
<br /><br />
<h3>Privacy</h3>
@ -169,23 +167,6 @@ So, if you like the app and want to say thank you and support the project, you c
In case you will donate, or just live a star, thank you :heart:
<br /><br />
<h3>Connected external projects</h3>
Take a look at these awesome projects that use RTranslator code:
[**WhisperIMEplus**](https://github.com/woheller69/whisperIMEplus)
[**WhisperJET**](https://github.com/eix128/WhisperJET)
<br /><br />
<h3>Contributions</h3>
If you want to contribute to this project, first of all, thank you 🚀
If you don't know where to start, go check the [to-do list](https://github.com/niedev/RTranslator/blob/v2.00/TODO_LIST.md), and in any case, before starting, read the [contribution guidelines](https://github.com/niedev/RTranslator/blob/v2.00/CONTRIBUTING.md).
<br /><br />
<h3>Bugs and problems</h3>
I remind you that the app is still in beta. The bugs found are the following:

View File

@ -6,7 +6,7 @@ If you want to contribute to RTranslator but you don't know where to start, here
| Mic manual mode setting to choose whether to start with automatic or manual mic mode in WalkieTalkie or Conversation mode (separate settings for the two modes). | Not started |
| Button to stop and eventually repeat the TTS in the messages of WalkieTalkie and Conversation mode. | Not started |
| A new section in the settings that shows the version of the app, plus link to the releases of the app that also show if there is a new version. | Not started |
| A new option in the settings to show, in WalkieTalkie and Conversation modes, the original transcription of the message beyond the translation. | [Done](https://github.com/niedev/RTranslator/pull/128) |
| A new option in the settings to show, in WalkieTalkie and Conversation modes, the original transcription of the message beyond the translation. | Not started |
<br/><br/>
Here is also a list of more difficult things to do if you want (I don't expect to do one of these all by yourself, even pull requests that lay down the foundations or a one that do a small contribution about these features are higly appreciated):

View File

@ -86,6 +86,7 @@ android {
dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.github.okitcom:SwitchButton:1.4.5'
// Support libraries
implementation "com.google.android.material:material:1.9.0" //1.9.0
implementation "androidx.cardview:cardview:1.0.0"

View File

@ -51,7 +51,6 @@ public class Message implements Parcelable, Cloneable {
private Peer receiver; //if is null the message will be sent to all connected peers
private String header; // mandatory length: 1
private byte[] data;
private String textToTranslate;
/**
* @param context a context
@ -74,12 +73,6 @@ public class Message implements Parcelable, Cloneable {
this.data = text.getBytes(StandardCharsets.UTF_8);
}
public Message(String textToTranslate, Context context, @NonNull String text) {
this.textToTranslate = textToTranslate;
this.context = context;
this.data = text.getBytes(StandardCharsets.UTF_8);
}
/**
* @param context a context
* @param header must contain 1 character to avoid errors
@ -319,12 +312,4 @@ public class Message implements Parcelable, Cloneable {
parcel.writeString(header);
parcel.writeByteArray(this.data);
}
public String getTextToTranslate() {
return textToTranslate;
}
public void setTextToTranslate(String textToTranslate) {
this.textToTranslate = textToTranslate;
}
}

View File

@ -60,8 +60,6 @@ public class SettingsFragment extends PreferenceFragmentCompat {
private SettingsActivity activity;
private UserNamePreference userNamePreference;
private SupportLanguagesQuality supportLanguagesQualityPreference;
private ShowOriginalTranscriptionMsgPreference showOriginalTranscriptionMsgPreference;
private SupportTtsQualityPreference supportTtsQualityPreference;
private LanguagePreference languagePreference;
@ -163,10 +161,6 @@ public class SettingsFragment extends PreferenceFragmentCompat {
supportLanguagesQualityPreference = (SupportLanguagesQuality) findPreference("languagesNNQualityLow");
supportLanguagesQualityPreference.setFragment(this);
showOriginalTranscriptionMsgPreference = (ShowOriginalTranscriptionMsgPreference) findPreference("ShowOriginalTranscriptionMsgPreference");
showOriginalTranscriptionMsgPreference.setFragment(this);
// language support option with low quality tts initialization
supportTtsQualityPreference = (SupportTtsQualityPreference) findPreference("languagesQualityLow");
supportTtsQualityPreference.setFragment(this);

View File

@ -1,64 +0,0 @@
package nie.translator.rtranslator.settings;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import androidx.preference.SwitchPreference;
import java.util.ArrayList;
import nie.translator.rtranslator.Global;
import nie.translator.rtranslator.tools.CustomLocale;
import nie.translator.rtranslator.tools.ErrorCodes;
import nie.translator.rtranslator.voice_translation.neural_networks.translation.Translator;
public class ShowOriginalTranscriptionMsgPreference extends SwitchPreference {
private SettingsFragment fragment;
private Translator translator;
private Global global;
private SettingsActivity activity;
public ShowOriginalTranscriptionMsgPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public ShowOriginalTranscriptionMsgPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public ShowOriginalTranscriptionMsgPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ShowOriginalTranscriptionMsgPreference(Context context) {
super(context);
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
//translator = new Translator((Global) fragment.requireActivity().getApplication(), Translator.MADLAD_CACHE);
setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if(global != null) {
final SharedPreferences sharedPreferences = global.getSharedPreferences("default", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("ShowOriginalTranscriptionMsgPreference", (Boolean) newValue);
editor.apply();
}
return true;
}
});
}
public void setFragment(@NonNull SettingsFragment fragment) {
this.fragment = fragment;
this.activity = (SettingsActivity) fragment.requireActivity();
this.global = (Global) activity.getApplication();
}
}

View File

@ -53,7 +53,7 @@ public class ImageActivity extends Activity {
messages.add(new GuiMessage(new Message(this, new Peer(null, "Carlos11", true), "m", "Je vais bien"), false, true));
messages.add(new GuiMessage(new Message(this, "m", "Moi aussi"), true, true));*/
mAdapter = new MessagesAdapter(messages, this.getApplication(), new MessagesAdapter.Callback() {
mAdapter = new MessagesAdapter(messages, new MessagesAdapter.Callback() {
@Override
public void onFirstItemAdded() {
mRecyclerView.setVisibility(View.VISIBLE);

View File

@ -54,6 +54,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.card.MaterialCardView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.kyleduo.switchbutton.SwitchButton;
import nie.translator.rtranslator.R;
import nie.translator.rtranslator.tools.Tools;
import nie.translator.rtranslator.tools.gui.ButtonKeyboard;
@ -221,6 +222,24 @@ public class CustomAnimator {
micAnimator.start();
}
public void animatePairingSwitchActivation(SwitchButton switchButton){
AnimatorSet animatorSet= new AnimatorSet();
int duration=switchButton.getResources().getInteger(R.integer.durationLong);
Animator animatorThumb=createAnimatorColor(switchButton,switchButton.getThumbColor().getDefaultColor(), GuiTools.getColor(switchButton.getContext(),R.color.switch_color),duration,false);
Animator animatorBack=createAnimatorColor(switchButton,switchButton.getBackColor().getDefaultColor(),GuiTools.getColor(switchButton.getContext(),R.color.switch_background_color),duration,true);
animatorSet.play(animatorThumb).with(animatorBack);
animatorSet.start();
}
public void animatePairingSwitchDeactivation(SwitchButton switchButton){
AnimatorSet animatorSet= new AnimatorSet();
int duration=switchButton.getResources().getInteger(R.integer.durationLong);
Animator animatorThumb=createAnimatorColor(switchButton,switchButton.getThumbColor().getDefaultColor(),GuiTools.getColor(switchButton.getContext(),R.color.gray),duration,false);
Animator animatorBack=createAnimatorColor(switchButton,switchButton.getBackColor().getDefaultColor(),GuiTools.getColor(switchButton.getContext(),R.color.very_light_gray),duration,true);
animatorSet.play(animatorThumb).with(animatorBack);
animatorSet.start();
}
public void animateOnVoiceStart(Context context, final ButtonMic buttonMic, boolean instant){
int duration=buttonMic.getResources().getInteger(R.integer.durationStandard);
int finalSizeInPixels = Tools.convertDpToPixels(context, ButtonMic.SIZE_LISTENING_DP);
@ -1502,6 +1521,32 @@ public class CustomAnimator {
return animator;
}
public Animator createAnimatorColor(final SwitchButton drawable, int initialColor, int finalColor, int duration, boolean background){
final int[][] states = new int[][] {
new int[] {android.R.attr.state_checked}, // checked
new int[] {-android.R.attr.state_checked}, // unchecked
};
ValueAnimator animator = ValueAnimator.ofObject(new ArgbEvaluator(), initialColor, finalColor);
if(background) {
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animator) {
drawable.setBackColor(new ColorStateList(states,new int[]{(int) animator.getAnimatedValue(),(int) animator.getAnimatedValue()}));
}
});
}else{
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animator) {
drawable.setThumbColor(new ColorStateList(states,new int[]{(int) animator.getAnimatedValue(),(int) animator.getAnimatedValue()}));
}
});
}
animator.setDuration(duration);
return animator;
}
public Animator createAnimatorColor(final MaterialButton drawable, int initialColor, int finalColor, int duration){
ValueAnimator animator = ValueAnimator.ofObject(new ArgbEvaluator(), initialColor, finalColor);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

View File

@ -16,8 +16,6 @@
package nie.translator.rtranslator.tools.gui.messages;
import android.app.Application;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -32,7 +30,6 @@ import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import nie.translator.rtranslator.Global;
import nie.translator.rtranslator.R;
/** Is used to connect to the RecycleView, which functions as a ListView, a list of strings, which will be inserted in the ViewHolder layout and this will be inserted in the list**/
@ -43,9 +40,7 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
private ArrayList<GuiMessage> mResults = new ArrayList<>();
private Callback callback;
private static boolean showOriginalTranscriptionMsg;
public MessagesAdapter(ArrayList<GuiMessage> messages, Application application, @NonNull Callback callback) {
public MessagesAdapter(ArrayList<GuiMessage> messages, @NonNull Callback callback) {
this.callback = callback;
if (messages != null) {
if (messages.size() > 0) {
@ -54,7 +49,6 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
mResults.addAll(messages);
notifyItemRangeInserted(0, messages.size() - 1);
}
showOriginalTranscriptionMsg = application.getSharedPreferences("default", Context.MODE_PRIVATE).getBoolean("ShowOriginalTranscriptionMsgPreference", false);
}
@NonNull
@ -79,7 +73,7 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
((ReceivedHolder) holder).sender.setText(message.getMessage().getSender().getName());
Log.d("recyclerview", "RecyclerView bind sender");
}
((MessageHolder) holder).setText(message.getMessage().getTextToTranslate(), message.getMessage().getText());
((MessageHolder) holder).setText(message.getMessage().getText());
Log.d("recyclerview", "RecyclerView bind text");
//holder.itemView.requestLayout();
}
@ -162,7 +156,6 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
/** The layout for each item in the RecicleView list*/
private static class ReceivedHolder extends RecyclerView.ViewHolder implements MessageHolder {
TextView originalTextToBeTranslated;
TextView text;
LinearLayout containerSender;
TextView textSender;
@ -170,10 +163,6 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
ReceivedHolder(LayoutInflater inflater, ViewGroup parent) {
super(inflater.inflate(R.layout.component_message_received, parent, false));
originalTextToBeTranslated = itemView.findViewById(R.id.original_text_to_be_translated);
if (!showOriginalTranscriptionMsg) {
originalTextToBeTranslated.setVisibility(View.GONE);
}
text = itemView.findViewById(R.id.text_content);
containerSender = itemView.findViewById(R.id.sender_container);
@ -182,38 +171,31 @@ public class MessagesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
}
@Override
public void setText(String originalTextToBeTranslated, String text) {
public void setText(String text) {
this.textSender.setText(text);
this.originalTextToBeTranslated.setText(originalTextToBeTranslated);
this.text.setText(text);
}
}
/** The layout for each item in the RecicleView list*/
private static class SendHolder extends RecyclerView.ViewHolder implements MessageHolder {
TextView originalTextToBeTranslated;
TextView text;
CardView card;
SendHolder(LayoutInflater inflater, ViewGroup parent) {
super(inflater.inflate(R.layout.component_message_send, parent, false));
originalTextToBeTranslated = itemView.findViewById(R.id.original_text_to_be_translated);
if (!showOriginalTranscriptionMsg) {
originalTextToBeTranslated.setVisibility(View.GONE);
}
text = itemView.findViewById(R.id.text);
card = itemView.findViewById(R.id.card);
}
@Override
public void setText(String originalTextToBeTranslated, String text) {
this.originalTextToBeTranslated.setText(originalTextToBeTranslated);
public void setText(String text) {
this.text.setText(text);
}
}
interface MessageHolder {
void setText(String originalTextToBeTranslated, String text);
void setText(String text);
}
public interface Callback {

View File

@ -286,7 +286,7 @@ public class ConversationMainFragment extends VoiceTranslationFragment {
public void onSuccess(ArrayList<GuiMessage> messages, boolean isMicMute, boolean isAudioMute, boolean isTTSError, final boolean isEditTextOpen, boolean isBluetoothHeadsetConnected, boolean isMicAutomatic, boolean isMicActivated, int listeningMic) {
container.setVisibility(View.VISIBLE);
// initialization with service values
mAdapter = new MessagesAdapter(messages, global, new MessagesAdapter.Callback() {
mAdapter = new MessagesAdapter(messages, new MessagesAdapter.Callback() {
@Override
public void onFirstItemAdded() {
description.setVisibility(View.GONE);

View File

@ -229,7 +229,7 @@ public class TranslationFragment extends Fragment {
});
translateListener = new Translator.TranslateListener() {
@Override
public void onTranslatedText(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
public void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
outputText.setText(text);
if(isFinal){
activateTranslationButton();

View File

@ -367,7 +367,7 @@ public class WalkieTalkieFragment extends VoiceTranslationFragment {
public void onSuccess(ArrayList<GuiMessage> messages, boolean isMicMute, boolean isAudioMute, boolean isTTSError, final boolean isEditTextOpen, boolean isBluetoothHeadsetConnected, boolean isMicAutomatic, boolean isMicActivated, int listeningMic) {
// initialization with service values
//container.setVisibility(View.VISIBLE);
mAdapter = new MessagesAdapter(messages, global, new MessagesAdapter.Callback() {
mAdapter = new MessagesAdapter(messages, new MessagesAdapter.Callback() {
@Override
public void onFirstItemAdded() {
description.setVisibility(View.GONE);

View File

@ -289,14 +289,14 @@ public class WalkieTalkieService extends VoiceTranslationService {
};
firstResultTranslateListener = new Translator.TranslateListener() {
@Override
public void onTranslatedText(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
public void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
((Global) getApplication()).getTTSLanguages(true, new Global.GetLocalesListListener() {
@Override
public void onSuccess(ArrayList<CustomLocale> ttsLanguages) {
if(isFinal && CustomLocale.containsLanguage(ttsLanguages, languageOfText)) { // check if the text can be speak
speak(text, languageOfText);
}
GuiMessage message = new GuiMessage(new Message(textToTranslate, WalkieTalkieService.this, text), resultID, true, isFinal);
GuiMessage message = new GuiMessage(new Message(WalkieTalkieService.this, text), resultID, true, isFinal);
WalkieTalkieService.super.notifyMessage(message);
// we save every new message in the exchanged messages so that the fragment can restore them
WalkieTalkieService.super.addOrUpdateMessage(message);
@ -309,7 +309,7 @@ public class WalkieTalkieService extends VoiceTranslationService {
@Override
public void onFailure(int[] reasons, long value) {
GuiMessage message = new GuiMessage(new Message(textToTranslate, WalkieTalkieService.this, text), resultID, true, isFinal);
GuiMessage message = new GuiMessage(new Message(WalkieTalkieService.this, text), resultID, true, isFinal);
WalkieTalkieService.super.notifyMessage(message);
// we save every new message in the exchanged messages so that the fragment can restore them
WalkieTalkieService.super.addOrUpdateMessage(message);
@ -332,14 +332,14 @@ public class WalkieTalkieService extends VoiceTranslationService {
};
secondResultTranslateListener = new Translator.TranslateListener() {
@Override
public void onTranslatedText(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
public void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
((Global) getApplication()).getTTSLanguages(true, new Global.GetLocalesListListener() {
@Override
public void onSuccess(ArrayList<CustomLocale> ttsLanguages) {
if(isFinal && CustomLocale.containsLanguage(ttsLanguages, languageOfText)) { // check if the text can be speak
speak(text, languageOfText);
}
GuiMessage message = new GuiMessage(new Message(textToTranslate, WalkieTalkieService.this, text), resultID, false, isFinal);
GuiMessage message = new GuiMessage(new Message(WalkieTalkieService.this, text), resultID, false, isFinal);
WalkieTalkieService.super.notifyMessage(message);
// we save every new message in the exchanged messages so that the fragment can restore them
WalkieTalkieService.super.addOrUpdateMessage(message);
@ -352,7 +352,7 @@ public class WalkieTalkieService extends VoiceTranslationService {
@Override
public void onFailure(int[] reasons, long value) {
GuiMessage message = new GuiMessage(new Message(textToTranslate, WalkieTalkieService.this, text), resultID, false, isFinal);
GuiMessage message = new GuiMessage(new Message(WalkieTalkieService.this, text), resultID, false, isFinal);
WalkieTalkieService.super.notifyMessage(message);
// we save every new message in the exchanged messages so that the fragment can restore them
WalkieTalkieService.super.addOrUpdateMessage(message);

View File

@ -194,7 +194,7 @@ public class Translator extends NeuralNetworkApi {
}
public interface TranslateListener extends TranslatorListener {
void onTranslatedText(String textToTranslate, String TranslatedText, long resultID, boolean isFinal, CustomLocale languageOfText);
void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText);
}
public void translateMessage(final ConversationMessage conversationMessageToTranslate, final CustomLocale languageOutput, int beamSize, final TranslateMessageListener responseListener) { // what the thread does
@ -220,7 +220,7 @@ public class Translator extends NeuralNetworkApi {
if (!languageInput.equals(data.languageOutput)) {
performTextTranslation(text, languageInput, data.languageOutput, data.beamSize, false, new TranslateListener() {
@Override
public void onTranslatedText(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
public void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
data.conversationMessageToTranslate.getPayload().setText(text);
data.conversationMessageToTranslate.getPayload().setLanguage(data.languageOutput);
mainHandler.post(() -> data.responseListener.onTranslatedMessage(data.conversationMessageToTranslate, resultID, isFinal));
@ -431,9 +431,9 @@ public class Translator extends NeuralNetworkApi {
callbacks.remove(callback);
}
private void notifyResult(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
private void notifyResult(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
for (int i = 0; i < callbacks.size(); i++) {
callbacks.get(i).onTranslatedText(textToTranslate, text, resultID, isFinal, languageOfText);
callbacks.get(i).onTranslatedText(text, resultID, isFinal, languageOfText);
}
}
@ -514,7 +514,7 @@ public class Translator extends NeuralNetworkApi {
completeOutput.add(0); //tokenizer.PieceToID("<s>")
TranslateListener translateListener = new TranslateListener() {
@Override
public void onTranslatedText(String textToTranslate, String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
public void onTranslatedText(String text, long resultID, boolean isFinal, CustomLocale languageOfText) {
//we return the partial results
String outputText;
if(joinedStringOutput[0].equals("")){
@ -527,9 +527,9 @@ public class Translator extends NeuralNetworkApi {
}
final long currentResultIDCopy = currentResultID; //we do a copy because otherwise the currentResultID is incremented before notifying the message (due to the notification being executed in the mainThread)
if (responseListener != null) {
mainHandler.post(() -> responseListener.onTranslatedText(textToTranslate, outputText, currentResultIDCopy, false, outputLanguage));
mainHandler.post(() -> responseListener.onTranslatedText(outputText, currentResultIDCopy, false, outputLanguage));
} else {
mainHandler.post(() -> notifyResult(textToTranslate, outputText, currentResultIDCopy, false, outputLanguage));
mainHandler.post(() -> notifyResult(outputText, currentResultIDCopy, false, outputLanguage));
}
}
@ -544,9 +544,9 @@ public class Translator extends NeuralNetworkApi {
}
};
if (beamSize > 1) { //beam search
executeCacheDecoderBeam(textToTranslate, input, encoderResult, completeBeamOutput, beamsOutputsProbabilities, outputLanguage, beamSize, translateListener);
executeCacheDecoderBeam(input, encoderResult, completeBeamOutput, beamsOutputsProbabilities, outputLanguage, beamSize, translateListener);
} else if (beamSize == 1) { //greedy search (with kv cache)
executeCacheDecoderGreedy(textToTranslate, input, encoderResult, completeOutput, outputLanguage, translateListener);
executeCacheDecoderGreedy(input, encoderResult, completeOutput, outputLanguage, translateListener);
}
//we convert the ids of completeOutputs into a string and return it
encoderResult.close();
@ -577,9 +577,9 @@ public class Translator extends NeuralNetworkApi {
}
final long currentResultIDCopy = currentResultID; //we do a copy because otherwise the currentResultID is incremented before notifying the message (due to the notification being executed in the mainThread)
if (responseListener != null) {
mainHandler.post(() -> responseListener.onTranslatedText(textToTranslate, finalResult, currentResultIDCopy, true, outputLanguage));
mainHandler.post(() -> responseListener.onTranslatedText(finalResult, currentResultIDCopy, true, outputLanguage));
} else {
mainHandler.post(() -> notifyResult(textToTranslate, finalResult, currentResultIDCopy, true, outputLanguage));
mainHandler.post(() -> notifyResult(finalResult, currentResultIDCopy, true, outputLanguage));
}
currentResultID++;
}
@ -632,7 +632,7 @@ public class Translator extends NeuralNetworkApi {
}
}
public void executeCacheDecoderGreedy(String textToTranslate, TokenizerResult input, OnnxTensor encoderResult, ArrayList<Integer> completeOutput, final CustomLocale outputLanguage, @Nullable final TranslateListener responseListener){
public void executeCacheDecoderGreedy(TokenizerResult input, OnnxTensor encoderResult, ArrayList<Integer> completeOutput, final CustomLocale outputLanguage, @Nullable final TranslateListener responseListener){
try {
long time = System.currentTimeMillis();
long initialTime;
@ -773,9 +773,9 @@ public class Translator extends NeuralNetworkApi {
outputIDs = completeOutput.stream().mapToInt(i -> i).toArray();
String partialResult = tokenizer.decode(outputIDs);
if(responseListener != null) {
responseListener.onTranslatedText(textToTranslate, partialResult, currentResultID, false, outputLanguage);
responseListener.onTranslatedText(partialResult, currentResultID, false, outputLanguage);
}else{
notifyResult(textToTranslate, partialResult, currentResultID, false, outputLanguage);
notifyResult(partialResult, currentResultID, false, outputLanguage);
}
android.util.Log.i("result", partialResult);
j++;
@ -813,7 +813,7 @@ public class Translator extends NeuralNetworkApi {
}
// for now beam search is not included (and not updated, so it won't work with the final models) because with this implementation we have random crashes
public void executeCacheDecoderBeam(String textToTranslate, TokenizerResult input, OnnxTensor encoderResult, ArrayList<Integer>[] completeBeamOutput, double[] beamsOutputsProbabilities, final CustomLocale outputLanguage, int beamSize, @Nullable final TranslateListener responseListener) {
public void executeCacheDecoderBeam(TokenizerResult input, OnnxTensor encoderResult, ArrayList<Integer>[] completeBeamOutput, double[] beamsOutputsProbabilities, final CustomLocale outputLanguage, int beamSize, @Nullable final TranslateListener responseListener) {
final int eos = tokenizer.PieceToID("</s>");
int nLayers;
int hiddenSize;
@ -1140,9 +1140,9 @@ public class Translator extends NeuralNetworkApi {
int [] outputIDs = completeBeamOutput[indexMax].stream().mapToInt(k -> k).toArray();
String partialResult = tokenizer.decode(outputIDs);
if(responseListener != null) {
responseListener.onTranslatedText(textToTranslate, partialResult, currentResultID, false, outputLanguage);
responseListener.onTranslatedText(partialResult, currentResultID, false, outputLanguage);
}else {
notifyResult(textToTranslate, partialResult, currentResultID, false, outputLanguage);
notifyResult(partialResult, currentResultID, false, outputLanguage);
}
j++;
for(int i=0; i<beamSize; i++){

View File

@ -39,96 +39,73 @@
app:layout_constraintHorizontal_bias="0.037"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/text_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Ciao, come stai?"
tool:visibility="gone"/>
<LinearLayout
android:id="@+id/sender_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone"
tool:visibility="visible">
<TextView
android:id="@+id/original_text_to_be_translated"
android:layout_width="wrap_content"
android:id="@+id/text_sender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:textColor="@color/secondary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Original text to be translated"/>
<TextView
android:id="@+id/text_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:visibility="visible"
android:layout_marginBottom="4dp"
android:fontFamily="@font/nunito_sans"
android:textColor="@color/primary"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Ciao, come stai?"
tool:visibility="gone"/>
<LinearLayout
android:id="@+id/sender_container"
app:layout_constraintVertical_bias="0"
tool:text="Alice" />
<TextView
android:id="@+id/text_content2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
tool:visibility="visible">
<TextView
android:id="@+id/text_sender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="4dp"
android:fontFamily="@font/nunito_sans"
android:textColor="@color/primary"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0"
tool:text="Alice" />
<TextView
android:id="@+id/text_content2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="4dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/light_black"
android:textIsSelectable="true"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_sender"
tool:text="Ciao, come stai?"/>
</LinearLayout>
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="4dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@color/light_black"
android:textIsSelectable="true"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_sender"
tool:text="Ciao, come stai?"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>

View File

@ -40,45 +40,23 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1">
<LinearLayout
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/original_text_to_be_translated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:textColor="@color/secondary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Original text to be translated"/>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Ciao, come stai?"/>
</LinearLayout>
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textIsSelectable="true"
android:textSize="16sp"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tool:text="Ciao, come stai?"/>
</androidx.cardview.widget.CardView>
</RelativeLayout>

View File

@ -146,8 +146,6 @@
<string name="preference_description_mic_sensitivity">Seleziona il livello di volume che serve per avviare e mantenere il riconoscimento vocale</string>
<string name="preference_description_languages_quality">Permette di supportare anche le lingue che hanno una bassa qualità di traduzione o del riconoscimento vocale</string>
<string name="preference_title_show_original_transcription">Mostra le trascrizioni originali oltre la traduzione</string>
<string name="preference_description_show_original_transcription_msg_preference">Consente di mostrare la trascrizione originale oltre la traduzione del messaggio.</string>
<string name="preference_description_support_tts_quality">Permette di supportare anche le lingue che hanno una bassa qualità del sintetizzatore vocale</string>
<string name="preference_description_tts">Impostazioni di sistema del tts, un eventuale cambio del motore predefinito sarà applicato solo dopo il riavvio dell\'app</string>
<string name="preference_description_speech_timeout">Seleziona il tempo che deve trascorrere dopo aver smesso di parlare per inviare il testo trascritto</string>

View File

@ -132,8 +132,6 @@
<string name="preference_description_mic_sensitivity">Виберіть рівень гучності, який вам потрібно для запуску та підтримки розпізнавання голосу</string>
<string name="preference_description_languages_quality">Це дозволяє також підтримувати мови, які мають низьку якість перекладу або розпізнавання мовлення</string>
<string name="preference_title_show_original_transcription">Показати оригінальні транскрипції крім перекладу</string>
<string name="preference_description_show_original_transcription_msg_preference">Це дозволяє показувати оригінальну транскрипцію крім перекладу повідомлення.</string>
<string name="preference_description_support_tts_quality">Це дозволяє також підтримувати мови, які мають низькое якість синтезу мовлення</string>
<string name="preference_description_tts">Системні налаштування tts, будь-яка зміна вибраного двигуна буде застосована лише після перезапуску додатка</string>
<string name="preference_description_speech_timeout">Виберіть час, після якого ви перестаєте говорити, щоб надіслати транскрибований текст</string>

View File

@ -130,8 +130,6 @@
<string name="preference_description_mic_sensitivity">选择您需要的音量级别以启动和维持语音识别</string>
<string name="preference_description_languages_quality">它还允许支持翻译或语音识别质量较低的语言</string>
<string name="preference_title_show_original_transcription">显示翻译之外的原始转录内容</string>
<string name="preference_description_show_original_transcription_msg_preference">它允许显示消息翻译之外的原始转录内容。</string>
<string name="preference_description_support_tts_quality">此选项允许支持语音合成器质量较低的语言</string>
<string name="preference_description_tts">TTS 的系统设定,优先引擎的变更将仅在重新启动应用程序后生效</string>
<string name="preference_description_speech_timeout">选择您停止说话后发送转录文字的时间</string>

View File

@ -129,8 +129,6 @@
<string name="preference_description_mic_sensitivity">選擇您需要的音量級別以啟動和維持語音辨識</string>
<string name="preference_description_languages_quality">它還允許支援翻譯或語音識別品質較低的語言</string>
<string name="preference_title_show_original_transcription">顯示翻譯之外的原始轉錄內容</string>
<string name="preference_description_show_original_transcription_msg_preference">它允許顯示消息翻譯之外的原始轉錄內容。</string>
<string name="preference_description_support_tts_quality">此選項允許支持語音合成器品質較低的語言</string>
<string name="preference_description_tts">TTS 的系統設定,優先引擎的變更將僅在重新啟動應用程式後生效</string>
<string name="preference_description_speech_timeout">選擇您停止說話後發送轉錄文字的時間</string>

View File

@ -129,8 +129,6 @@
<string name="preference_description_mic_sensitivity">選擇您需要的音量級別以啟動和維持語音辨識</string>
<string name="preference_description_languages_quality">它還允許支援翻譯或語音識別品質較低的語言</string>
<string name="preference_title_show_original_transcription">顯示翻譯之外的原始轉錄內容</string>
<string name="preference_description_show_original_transcription_msg_preference">它允許顯示消息翻譯之外的原始轉錄內容。</string>
<string name="preference_description_support_tts_quality">此選項允許支持語音合成器品質較低的語言</string>
<string name="preference_description_tts">TTS 的系統設定,優先引擎的變更將僅在重新啟動應用程式後生效</string>
<string name="preference_description_speech_timeout">選擇您停止說話後發送轉錄文字的時間</string>

View File

@ -131,8 +131,6 @@
<string name="preference_description_mic_sensitivity">选择您需要的音量级别以启动和维持语音识别</string>
<string name="preference_description_languages_quality">它还允许支持翻译或语音识别质量较低的语言</string>
<string name="preference_title_show_original_transcription">显示翻译之外的原始转录内容</string>
<string name="preference_description_show_original_transcription_msg_preference">它允许显示消息翻译之外的原始转录内容。</string>
<string name="preference_description_support_tts_quality">此选项允许支持语音合成器质量较低的语言</string>
<string name="preference_description_tts">TTS 的系统设定,优先引擎的变更将仅在重新启动应用程序后生效</string>
<string name="preference_description_speech_timeout">选择您停止说话后发送转录文字的时间</string>

View File

@ -140,7 +140,6 @@
<string name="preference_title_mic_sensitivity">Microphone sensitivity</string>
<string name="preference_title_languages_quality">Support low quality languages</string>
<string name="preference_title_show_original_transcription">Show original transcriptions beyond the translation</string>
<string name="preference_title_support_tts_quality">Support languages with low quality tts</string>
<string name="preference_title_language">Personal language</string>
<string name="preference_title_tts">Text to speech</string>
@ -150,7 +149,6 @@
<string name="preference_description_mic_sensitivity">Select the volume level you need to start and maintain voice recognition</string>
<string name="preference_description_languages_quality">It allow to also supports languages that have low translation or speech recognition quality</string>
<string name="preference_description_show_original_transcription_msg_preference">It allows to show the original transcription beyond the translation of the message.</string>
<string name="preference_description_support_tts_quality">It allow to also supports languages that have a low quality speech synthesizer</string>
<string name="preference_description_tts">System settings of tts, an eventual change of the preferred engine will be applied only after the restart of the app</string>
<string name="preference_description_speech_timeout">Select the time after you stop talking to send the transcribed text</string>

View File

@ -79,12 +79,6 @@
android:title="@string/preference_header_advanced"
app:iconSpaceReserved="false"
app:allowDividerAbove="true">
<nie.translator.rtranslator.settings.ShowOriginalTranscriptionMsgPreference
android:defaultValue="false"
android:key="ShowOriginalTranscriptionMsgPreference"
android:title="@string/preference_title_show_original_transcription"
android:summary="@string/preference_description_show_original_transcription_msg_preference"
app:iconSpaceReserved="false" />
<nie.translator.rtranslator.settings.SeekBarPreference
android:key="BeamSizeSetting"
android:layout="@layout/preference_seekbar"