Add translations

This commit is contained in:
Mygod
2018-01-21 13:58:20 -08:00
parent 1e97032630
commit 84cf926df1
5 changed files with 15 additions and 12 deletions

View File

@@ -84,7 +84,6 @@ class RepeaterFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClickL
val description get() = getString(when (neighbour?.state) {
IpNeighbour.State.INCOMPLETE, null -> R.string.connected_state_incomplete
IpNeighbour.State.VALID -> R.string.connected_state_valid
IpNeighbour.State.VALID_DELAY -> R.string.connected_state_valid_delay
IpNeighbour.State.FAILED -> R.string.connected_state_failed
else -> throw IllegalStateException()
}, iface)

View File

@@ -6,7 +6,7 @@ import java.io.IOException
data class IpNeighbour(val ip: String, val dev: String, val lladdr: String, val state: State) {
enum class State {
INCOMPLETE, VALID, VALID_DELAY, FAILED, DELETING
INCOMPLETE, VALID, FAILED, DELETING
}
companion object {
@@ -38,8 +38,7 @@ data class IpNeighbour(val ip: String, val dev: String, val lladdr: String, val
.singleOrNull() ?: "")
val state = if (match.groupValues[1].isNotEmpty()) State.DELETING else when (match.groupValues[9]) {
"", "INCOMPLETE" -> State.INCOMPLETE
"REACHABLE", "STALE", "PROBE", "PERMANENT" -> State.VALID
"DELAY" -> State.VALID_DELAY
"REACHABLE", "DELAY", "STALE", "PROBE", "PERMANENT" -> State.VALID
"FAILED" -> State.FAILED
"NOARP" -> return null // skip
else -> {