mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-04-04 22:20:02 +03:00
Fix a crash when translating media descriptions
This commit is contained in:
parent
b961145575
commit
2f663d1bd9
1 changed files with 2 additions and 2 deletions
|
@ -190,7 +190,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|||
binding.mediaDescription.setText(description);
|
||||
binding.translate.setOnClickListener(v -> {
|
||||
String descriptionToTranslate = attachments.get(mediaPosition - 1).description;
|
||||
TranslateHelper.translate(MediaActivity.this, descriptionToTranslate, status.language, translated -> {
|
||||
TranslateHelper.translate(MediaActivity.this, descriptionToTranslate, status!=null?status.language:"en", translated -> {
|
||||
if (translated != null) {
|
||||
attachments.get(mediaPosition - 1).translation = translated;
|
||||
binding.mediaDescriptionTranslated.setText(translated);
|
||||
|
@ -239,7 +239,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|||
}
|
||||
binding.translate.setOnClickListener(v -> {
|
||||
String descriptionToTranslate = attachments.get(position).description;
|
||||
TranslateHelper.translate(MediaActivity.this, descriptionToTranslate, status.language, translated -> {
|
||||
TranslateHelper.translate(MediaActivity.this, descriptionToTranslate, status!=null?status.language:"en", translated -> {
|
||||
if (translated != null) {
|
||||
attachments.get(position).translation = translated;
|
||||
binding.mediaDescriptionTranslated.setText(translated);
|
||||
|
|
Loading…
Reference in a new issue