Skip to content

Commit 3f529e6

Browse files
authored
Removed comma separator (commons-app#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
1 parent cdb2e42 commit 3f529e6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/Contribution.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ data class Contribution constructor(
111111
*/
112112
fun formatDescriptions(descriptions: List<UploadMediaDetail>) =
113113
descriptions.filter { it.descriptionText.isNotEmpty() }
114-
.joinToString { "{{${it.languageCode}|1=${it.descriptionText}}}" }
114+
.joinToString(separator = "") { "{{${it.languageCode}|1=${it.descriptionText}}}" }
115115
}
116116
}

app/src/main/java/fr/free/nrw/commons/description/DescriptionEditActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class DescriptionEditActivity : BaseActivity(), UploadMediaDetailAdapter.EventLi
151151
buffer.append(uploadDetails.languageCode)
152152
buffer.append("|1=")
153153
buffer.append(uploadDetails.descriptionText)
154-
buffer.append("}}, ")
154+
buffer.append("}}")
155155
}
156156
}
157157
buffer.replace(", $".toRegex(), "")

0 commit comments

Comments
 (0)