Add systran support

This commit is contained in:
tom79 2019-11-24 16:15:29 +01:00
parent ce05666038
commit d9b6d8f8c4
1 changed files with 7 additions and 15 deletions

View File

@ -1859,38 +1859,30 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
case 0:
your_api_key.setVisibility(View.VISIBLE);
editor.putInt(Helper.SET_TRANSLATOR, Helper.TRANS_YANDEX);
editor.apply();
if (sharedpreferences.getString(Helper.SET_YANDEX_API_KEY, null) != null)
your_api_key.setText(sharedpreferences.getString(Helper.SET_YANDEX_API_KEY, null));
editor.commit();
your_api_key.setText(sharedpreferences.getString(Helper.SET_YANDEX_API_KEY, ""));
break;
case 1:
your_api_key.setVisibility(View.VISIBLE);
editor.putInt(Helper.SET_TRANSLATOR, Helper.TRANS_DEEPL);
editor.apply();
if (sharedpreferences.getString(Helper.SET_DEEPL_API_KEY, null) != null)
your_api_key.setText(sharedpreferences.getString(Helper.SET_DEEPL_API_KEY, ""));
editor.commit();
your_api_key.setText(sharedpreferences.getString(Helper.SET_DEEPL_API_KEY, ""));
break;
case 2:
your_api_key.setVisibility(View.VISIBLE);
editor.putInt(Helper.SET_TRANSLATOR, Helper.TRANS_SYSTRAN);
editor.apply();
if (sharedpreferences.getString(Helper.SET_SYSTRAN_API_KEY, null) != null)
your_api_key.setText(sharedpreferences.getString(Helper.SET_SYSTRAN_API_KEY, ""));
editor.commit();
your_api_key.setText(sharedpreferences.getString(Helper.SET_SYSTRAN_API_KEY, ""));
break;
case 3:
your_api_key.setVisibility(View.GONE);
set_trans_forced.isChecked();
editor.putBoolean(Helper.SET_TRANS_FORCED, false);
editor.putInt(Helper.SET_TRANSLATOR, Helper.TRANS_NONE);
editor.apply();
editor.commit();
break;
}
if (getActivity() != null)
getActivity().recreate();
Intent intent = new Intent(context, MainActivity.class);
intent.putExtra(Helper.INTENT_ACTION, Helper.BACK_TO_SETTINGS);
startActivity(intent);
} else {
countTrans++;
}