Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Feature/navigatum localization #1529

Merged
merged 4 commits into from
Nov 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class NavigationDetailsFragment : BaseFragment<Unit>(
private fun showNavigationDetailsProperties(navigationDetails: NavigationDetails) {
navigationDetails.properties.forEach { property ->
val propertyRow = NavigationPropertyRowBinding.inflate(layoutInflater, binding.propsList, true)
propertyRow.propertyName.text = getTranslationForPropertyTitle(property.title)
propertyRow.propertyName.text = property.title
propertyRow.propertyValue.text = property.value
}
}
Comment on lines 110 to 116
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps someone with more android-fu can help me here. Is it possible to do this more elegantly with bindings, now that we don't do the translation anymore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know of a better way

Expand Down Expand Up @@ -162,17 +162,6 @@ class NavigationDetailsFragment : BaseFragment<Unit>(
.into(binding.photoView)
}

private fun getTranslationForPropertyTitle(title: String): String {
return when (title) {
"Raumkennung" -> getString(R.string.room_id)
"Adresse" -> getString(R.string.address)
"Architekten-Name" -> getString(R.string.architect_name)
"Sitzplätze" -> getString(R.string.seats)
"Anzahl Räume" -> getString(R.string.number_of_rooms)
else -> title
}
}

private fun getCapitalizeType(type: String): String {
return type.replaceFirstChar { it.titlecase() }
}
Expand Down