Removed comma separator (#5261)

* Removed comma separator from file descriptions

* Removed a redundant line that deleted the last comma of the descriptions

* Added a line to formatDescriptions that replaces every instance of "}}, " with "}}" to remove the comma between descriptions.

* Specified separator as an empty string instead of default value ", " for .joinToString method. Deleted previous fix using .replace method.

* Restored buffer.replace() in updateDescription
This commit is contained in:
paco-arana 2023-07-20 07:14:21 -07:00 committed by GitHub
parent cdb2e4278c
commit 3f529e674f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -111,6 +111,6 @@ data class Contribution constructor(
*/
fun formatDescriptions(descriptions: List<UploadMediaDetail>) =
descriptions.filter { it.descriptionText.isNotEmpty() }
.joinToString { "{{${it.languageCode}|1=${it.descriptionText}}}" }
.joinToString(separator = "") { "{{${it.languageCode}|1=${it.descriptionText}}}" }
}
}

View file

@ -151,7 +151,7 @@ class DescriptionEditActivity : BaseActivity(), UploadMediaDetailAdapter.EventLi
buffer.append(uploadDetails.languageCode)
buffer.append("|1=")
buffer.append(uploadDetails.descriptionText)
buffer.append("}}, ")
buffer.append("}}")
}
}
buffer.replace(", $".toRegex(), "")