@@ -466,71 +466,71 @@ private fun EnvironmentMetrics(
466
466
if (hasTemperature()) {
467
467
InfoCard (
468
468
icon = Icons .Default .Thermostat ,
469
- text = " Temperature " ,
469
+ text = stringResource( R .string.temperature) ,
470
470
value = temperature.toTempString(isFahrenheit)
471
471
)
472
472
}
473
473
if (hasRelativeHumidity()) {
474
474
InfoCard (
475
475
icon = Icons .Default .WaterDrop ,
476
- text = " Humidity " ,
476
+ text = stringResource( R .string.humidity) ,
477
477
value = " %.0f%%" .format(relativeHumidity)
478
478
)
479
479
}
480
480
if (hasTemperature() && hasRelativeHumidity()) {
481
481
val dewPoint = calculateDewPoint(temperature, relativeHumidity)
482
482
InfoCard (
483
483
icon = ImageVector .vectorResource(R .drawable.ic_outlined_dew_point_24),
484
- text = " Dew Point " ,
484
+ text = stringResource( R .string.dew_point) ,
485
485
value = dewPoint.toTempString(isFahrenheit)
486
486
)
487
487
}
488
488
if (hasBarometricPressure()) {
489
489
InfoCard (
490
490
icon = Icons .Default .Speed ,
491
- text = " Pressure " ,
491
+ text = stringResource( R .string.pressure) ,
492
492
value = " %.0f hPa" .format(barometricPressure)
493
493
)
494
494
}
495
495
if (hasGasResistance()) {
496
496
InfoCard (
497
497
icon = Icons .Default .BlurOn ,
498
- text = " Gas Resistance " ,
498
+ text = stringResource( R .string.gas_resistance) ,
499
499
value = " %.0f MΩ" .format(gasResistance)
500
500
)
501
501
}
502
502
if (hasVoltage()) {
503
503
InfoCard (
504
504
icon = Icons .Default .Bolt ,
505
- text = " Voltage " ,
505
+ text = stringResource( R .string.voltage) ,
506
506
value = " %.2fV" .format(voltage)
507
507
)
508
508
}
509
509
if (hasCurrent()) {
510
510
InfoCard (
511
511
icon = Icons .Default .Power ,
512
- text = " Current " ,
512
+ text = stringResource( R .string.current) ,
513
513
value = " %.1fmA" .format(current)
514
514
)
515
515
}
516
516
if (hasIaq()) {
517
517
InfoCard (
518
518
icon = Icons .Default .Air ,
519
- text = " IAQ " ,
519
+ text = stringResource( R .string.iaq) ,
520
520
value = iaq.toString()
521
521
)
522
522
}
523
523
if (hasDistance()) {
524
524
InfoCard (
525
525
icon = Icons .Default .Height ,
526
- text = " Distance " ,
526
+ text = stringResource( R .string.distance) ,
527
527
value = " %.0f mm" .format(distance)
528
528
)
529
529
}
530
530
if (hasLux()) {
531
531
InfoCard (
532
532
icon = Icons .Default .LightMode ,
533
- text = " Lux " ,
533
+ text = stringResource( R .string.lux) ,
534
534
value = " %.0f lx" .format(lux)
535
535
)
536
536
}
@@ -539,22 +539,22 @@ private fun EnvironmentMetrics(
539
539
val normalizedBearing = (windDirection % 360 + 360 ) % 360
540
540
InfoCard (
541
541
icon = Icons .Outlined .Navigation ,
542
- text = " Wind " ,
542
+ text = stringResource( R .string.wind) ,
543
543
value = windSpeed.toSpeedString(),
544
544
rotateIcon = normalizedBearing.toFloat(),
545
545
)
546
546
}
547
547
if (hasWeight()) {
548
548
InfoCard (
549
549
icon = Icons .Default .Scale ,
550
- text = " Weight " ,
550
+ text = stringResource( R .string.weight) ,
551
551
value = " %.2f kg" .format(weight)
552
552
)
553
553
}
554
554
if (hasRadiation()) {
555
555
InfoCard (
556
556
icon = ImageVector .vectorResource(R .drawable.ic_filled_radioactive_24),
557
- text = " Radiation " ,
557
+ text = stringResource( R .string.radiation) ,
558
558
value = " %.1f µR/h" .format(radiation)
559
559
)
560
560
}
@@ -595,12 +595,12 @@ private fun PowerMetrics(node: Node) = with(node.powerMetrics) {
595
595
Column {
596
596
InfoCard (
597
597
icon = Icons .Default .Bolt ,
598
- text = " Channel 1 " ,
598
+ text = stringResource( R .string.channel_1) ,
599
599
value = " %.2fV" .format(ch1Voltage)
600
600
)
601
601
InfoCard (
602
602
icon = Icons .Default .Power ,
603
- text = " Channel 1 " ,
603
+ text = stringResource( R .string.channel_1) ,
604
604
value = " %.1fmA" .format(ch1Current)
605
605
)
606
606
}
@@ -609,12 +609,12 @@ private fun PowerMetrics(node: Node) = with(node.powerMetrics) {
609
609
Column {
610
610
InfoCard (
611
611
icon = Icons .Default .Bolt ,
612
- text = " Channel 2 " ,
612
+ text = stringResource( R .string.channel_2) ,
613
613
value = " %.2fV" .format(ch2Voltage)
614
614
)
615
615
InfoCard (
616
616
icon = Icons .Default .Power ,
617
- text = " Channel 2 " ,
617
+ text = stringResource( R .string.channel_2) ,
618
618
value = " %.1fmA" .format(ch2Current)
619
619
)
620
620
}
@@ -623,12 +623,12 @@ private fun PowerMetrics(node: Node) = with(node.powerMetrics) {
623
623
Column {
624
624
InfoCard (
625
625
icon = Icons .Default .Bolt ,
626
- text = " Channel 3 " ,
626
+ text = stringResource( R .string.channel_3) ,
627
627
value = " %.2fV" .format(ch3Voltage)
628
628
)
629
629
InfoCard (
630
630
icon = Icons .Default .Power ,
631
- text = " Channel 3 " ,
631
+ text = stringResource( R .string.channel_3) ,
632
632
value = " %.1fmA" .format(ch3Current)
633
633
)
634
634
}
0 commit comments