Localize strings

This commit is contained in:
Mygod
2020-07-04 04:34:58 +08:00
parent 5e5016b059
commit 46d0544df2
5 changed files with 27 additions and 15 deletions

View File

@@ -44,7 +44,7 @@ enum class TetherType(@DrawableRes val icon: Int) {
private fun Pair<String?, Resources>.getRegexs(name: String) = second.getIdentifier(name, "array", first).let {
if (it == 0) {
Timber.i("$name is empty")
if (name == "config_tether_wigig_regexs") Timber.i("$name is empty") else Timber.w(Exception(name))
emptyList()
} else second.getStringArray(it).filterNotNull().map { it.toPattern() }
}

View File

@@ -148,7 +148,8 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
if (!arg.readOnly) dialogView.password.addTextChangedListener(this@WifiApDialogFragment)
if (!arg.p2pMode && Build.VERSION.SDK_INT < 28) dialogView.autoShutdown.isGone = true
if (arg.p2pMode || Build.VERSION.SDK_INT >= 30) {
dialogView.timeoutWrapper.helperText = "Default timeout: ${TetherTimeoutMonitor.defaultTimeout}ms"
dialogView.timeoutWrapper.helperText = getString(R.string.wifi_hotspot_timeout_default,
TetherTimeoutMonitor.defaultTimeout)
if (!arg.readOnly) dialogView.timeout.addTextChangedListener(this@WifiApDialogFragment)
} else dialogView.timeoutWrapper.isGone = true
if (Build.VERSION.SDK_INT >= 23 || arg.p2pMode) dialogView.band.apply {