diff --git a/app/src/main/java/org/woheller69/weather/activities/RadiusSearchActivity.java b/app/src/main/java/org/woheller69/weather/activities/RadiusSearchActivity.java
index 72bbca9..cadcb05 100644
--- a/app/src/main/java/org/woheller69/weather/activities/RadiusSearchActivity.java
+++ b/app/src/main/java/org/woheller69/weather/activities/RadiusSearchActivity.java
@@ -131,7 +131,7 @@ public void run() {
sbEdgeLength.setMax(edgeRange);
sbEdgeLength.setProgress(((edgeRange + minEdgeLength) >> 1) - minEdgeLength);
tvEdgeLengthValue.setText(
- String.format(FORMAT_EDGE_LENGTH_VALUE, sbEdgeLength.getProgress() + minEdgeLength, prefManager.getDistanceUnit())
+ String.format(FORMAT_EDGE_LENGTH_VALUE, sbEdgeLength.getProgress() + minEdgeLength, prefManager.getDistanceUnit(getApplicationContext()))
);
sbNumReturns.setMax(numberOfReturnsRange);
@@ -203,7 +203,7 @@ private class OnSeekBarEdgeLengthChange implements SeekBar.OnSeekBarChangeListen
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- String text = String.format("%s %s", progress + minEdgeLength, prefManager.getDistanceUnit());
+ String text = String.format("%s %s", progress + minEdgeLength, prefManager.getDistanceUnit(getApplicationContext()));
tvEdgeLengthValue.setText(text);
}
diff --git a/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java b/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java
index 6873cc6..5d26e5f 100644
--- a/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java
+++ b/app/src/main/java/org/woheller69/weather/preferences/AppPreferencesManager.java
@@ -111,11 +111,12 @@ public String getWeatherUnit() {
/**
* @return Returns "km" in case kilometer is set and "mi" if miles was selected.
+ * @param applicationContext
*/
- public String getDistanceUnit() {
+ public String getDistanceUnit(Context applicationContext) {
int prefValue = Integer.parseInt(preferences.getString("distanceUnit", "1"));
if (prefValue == 1) {
- return "km";
+ return applicationContext.getString(R.string.units_km);
} else {
return "mi";
}
diff --git a/app/src/main/res/layout/card_details.xml b/app/src/main/res/layout/card_details.xml
index 57b29ff..208f84b 100644
--- a/app/src/main/res/layout/card_details.xml
+++ b/app/src/main/res/layout/card_details.xml
@@ -42,7 +42,7 @@
android:layout_column="0"
android:layout_marginBottom="5dp"
android:layout_row="0"
- android:text="@string/units_rain60min_prefix"
+ android:text="@string/card_details_rain60min"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/colorPrimaryDark" />
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index e82f57f..af8c63f 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -112,7 +112,8 @@
Diagramm
%rh
mm
+ km
hPa
Bft
- ☔ 60 min:
+ ☔ 60 min:
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index eb51997..0b77d16 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -108,9 +108,10 @@
Суббота
Воскресенье
Диаграмма
- %rh
+ %отн
мм
- hPa
+ км
+ гПа
Bft
- ☔ 60 min:
+ ☔ 60 мин:
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bce6d2d..c3b424f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -120,7 +120,8 @@
Chart
%rh
mm
+ km
hPa
Bft
- ☔ 60 min:
+ ☔ 60 min: