Make more strings translatable
This commit is contained in:
parent
063e105028
commit
cdfa3f8fce
2 changed files with 13 additions and 7 deletions
|
@ -55,16 +55,16 @@ abstract class UsbWriteService(name: String) : IntentService(name) {
|
||||||
|
|
||||||
val resultChannel = NotificationChannel(
|
val resultChannel = NotificationChannel(
|
||||||
WRITE_RESULT_CHANNEL_ID,
|
WRITE_RESULT_CHANNEL_ID,
|
||||||
"USB write result notifications",
|
getString(R.string.result_channel_name),
|
||||||
NotificationManager.IMPORTANCE_DEFAULT
|
NotificationManager.IMPORTANCE_DEFAULT
|
||||||
)
|
)
|
||||||
resultChannel.description = "Used to display the result of a finished write operation"
|
resultChannel.description = getString(R.string.result_channel_desc)
|
||||||
|
|
||||||
// Register the channel with the system; you can't change the importance
|
// Register the channel with the system; you can't change the importance
|
||||||
// or other notification behaviors after this
|
// or other notification behaviors after this
|
||||||
val notificationManager = getSystemService(NotificationManager::class.java)
|
val notificationManager = getSystemService(NotificationManager::class.java)
|
||||||
notificationManager!!.createNotificationChannel(statusChannel)
|
notificationManager!!.createNotificationChannel(statusChannel)
|
||||||
notificationManager!!.createNotificationChannel(resultChannel)
|
notificationManager.createNotificationChannel(resultChannel)
|
||||||
}
|
}
|
||||||
notifyChanRegistered = true
|
notifyChanRegistered = true
|
||||||
}
|
}
|
||||||
|
@ -98,13 +98,13 @@ abstract class UsbWriteService(name: String) : IntentService(name) {
|
||||||
val dt = System.currentTimeMillis() - startTime
|
val dt = System.currentTimeMillis() - startTime
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
b.setContentTitle("Write failed")
|
b.setContentTitle(getString(R.string.write_failed))
|
||||||
.setContentText("$usbDevice may have been unplugged while writing.")
|
.setContentText(getString(R.string.error_notif_content_text, usbDevice))
|
||||||
.setSubText(dt.toHRTime())
|
.setSubText(dt.toHRTime())
|
||||||
else {
|
else {
|
||||||
val speed = max(bytes.toDouble() / dt.toDouble() * 1000, 0.0).toHRSize() + "/s"
|
val speed = max(bytes.toDouble() / dt.toDouble() * 1000, 0.0).toHRSize() + "/s"
|
||||||
b.setContentTitle("Write finished")
|
b.setContentTitle(getString(R.string.write_finished))
|
||||||
.setContentText("$filename successfully written to $usbDevice")
|
.setContentText(getString(R.string.success_notif_content_text, filename, usbDevice))
|
||||||
.setSubText("${dt.toHRTime()} • ${bytes.toHRSize()} • $speed")
|
.setSubText("${dt.toHRTime()} • ${bytes.toHRSize()} • $speed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,4 +101,10 @@
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="license_mpl_2_0">MPL-2.0</string>
|
<string name="license_mpl_2_0">MPL-2.0</string>
|
||||||
<string name="storagechooser_license_description">DMG file selector</string>
|
<string name="storagechooser_license_description">DMG file selector</string>
|
||||||
|
<string name="result_channel_desc">Used to display the result of a finished write operation</string>
|
||||||
|
<string name="result_channel_name">USB write result notifications</string>
|
||||||
|
<string name="write_failed">Write failed</string>
|
||||||
|
<string name="write_finished">Write finished</string>
|
||||||
|
<string name="error_notif_content_text">%1$s may have been unplugged while writing.</string>
|
||||||
|
<string name="success_notif_content_text">%1$s successfully written to %2$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue