Show definitions of cross-straits or moe in search results, if cedict definitions are not available
This commit is contained in:
parent
898a5d3cc5
commit
33402c0fcb
@ -110,9 +110,15 @@ internal class EntryCell(private val resources: ResourceBundle, private val conf
|
||||
)
|
||||
)
|
||||
|
||||
val definition = entry.cedictDefinitions.joinToString(
|
||||
separator = " / "
|
||||
) { it.joinToString(separator = "; ") }
|
||||
val definition = when {
|
||||
entry.cedictDefinitions.isNotEmpty() -> entry.cedictDefinitions.joinToString(
|
||||
separator = " / "
|
||||
) { it.joinToString(separator = "; ") }
|
||||
|
||||
entry.crossStraitsDefinitions.isNotEmpty() -> entry.crossStraitsDefinitions.joinToString(separator = " / ") { it.definition }
|
||||
entry.moedictDefinitions.isNotEmpty() -> entry.moedictDefinitions.joinToString(separator = " / ") { it.definition }
|
||||
else -> error("No definition for entry")
|
||||
}
|
||||
labelDefinition.text = definition
|
||||
|
||||
contextMenu = createContextMenuForEntry(entry, resources)
|
||||
|
Loading…
Reference in New Issue
Block a user