From 2f29b93a9999e05018877ac3e7a424f1ee71db19 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 9 Jan 2021 14:39:08 +0100 Subject: [PATCH] EN-UI: Make legend translateable --- .../main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt | 4 ++-- .../src/main/res/values-de/strings.xml | 2 ++ play-services-nearby-core-ui/src/main/res/values/strings.xml | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt index dff5f504..ab4882c5 100644 --- a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt +++ b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/DotChartView.kt @@ -163,7 +163,7 @@ class DotChartView : View { canvas.drawMyRect(subLeft, subTop.toFloat(), perWidth.toFloat(), perHeight.toFloat(), grayBoxColor) - val strNoRecords = "No records" + val strNoRecords = context.getString(R.string.pref_exposure_rpis_histogram_legend_no_records) fontPaint.textAlign = Paint.Align.LEFT fontPaint.getTextBounds(strNoRecords, 0, strNoRecords.length, fontTempRect) canvas.drawText(strNoRecords, (subLeft + perWidth + 4 * d).toFloat(), (subTop + perHeight / 2.0 + fontTempRect.height() / 2.0).toFloat(), fontPaint) @@ -172,7 +172,7 @@ class DotChartView : View { canvas.drawMyRect((subLeft + (perWidth + innerPadding) * 2 + 12 * d + fontTempRect.width()).toFloat(), subTop.toFloat(), perWidth.toFloat(), perHeight.toFloat(), accentColor and (128 shl 24 or 0xffffff)) canvas.drawMyRect((subLeft + (perWidth + innerPadding) * 3 + 12 * d + fontTempRect.width()).toFloat(), subTop.toFloat(), perWidth.toFloat(), perHeight.toFloat(), accentColor) - val strRecords = "0 / $averageValue / $maxValue IDs per hour" + val strRecords = context.getString(R.string.pref_exposure_rpis_histogram_legend_records, 0, averageValue, maxValue) canvas.drawText(strRecords, (subLeft + (perWidth + innerPadding) * 3 + 16 * d + fontTempRect.width() + perWidth).toFloat(), (subTop + perHeight / 2.0 + fontTempRect.height() / 2.0).toFloat(), fontPaint) } } diff --git a/play-services-nearby-core-ui/src/main/res/values-de/strings.xml b/play-services-nearby-core-ui/src/main/res/values-de/strings.xml index a80b38f4..cb705e43 100644 --- a/play-services-nearby-core-ui/src/main/res/values-de/strings.xml +++ b/play-services-nearby-core-ui/src/main/res/values-de/strings.xml @@ -30,6 +30,8 @@ Nutzung der API in den letzten 14 Tagen %1$d Aufrufe von %2$s %1$d gesammelte IDs + Keine Daten + %1$d / %2$d / %3$d IDs pro Stunde Löschen Alle gesammelten IDs löschen Nach dem Löschen der gesammelten IDs kannst du nicht mehr informiert werden, falls einer deiner Kontakte der letzten 14 Tage positiv getested wurde. diff --git a/play-services-nearby-core-ui/src/main/res/values/strings.xml b/play-services-nearby-core-ui/src/main/res/values/strings.xml index 8b14db24..e639afd3 100644 --- a/play-services-nearby-core-ui/src/main/res/values/strings.xml +++ b/play-services-nearby-core-ui/src/main/res/values/strings.xml @@ -40,6 +40,8 @@ API usage in the last 14 days %1$d calls to %2$s %1$d IDs collected + No records + %1$d / %2$d / %3$d IDs per hour Delete Delete all collected IDs Deleting collected IDs will make it impossible to notify you in case any of your contacts of the last 14 days is diagnosed.