From 630999f26ee3485773f72b644a6a40282b1c2045 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 13 May 2020 17:42:48 +0300 Subject: [PATCH] Fix #8593 --- .../java/net/osmand/util/OpeningHoursParser.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java index a7da5e3ff5..780713b3c3 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/OpeningHoursParser.java @@ -1024,10 +1024,14 @@ public class OpeningHoursParser { @Override public String toRuleString() { - return toRuleString(daysStr, monthsStr); + return toRuleString(false); } - private String toRuleString(String[] dayNames, String[] monthNames) { + private String toRuleString(boolean useLocalization) { + String[] dayNames = useLocalization ? localDaysStr : daysStr; + String[] monthNames = useLocalization ? localMothsStr : monthsStr; + String offStr = useLocalization ? additionalStrings.get("off") : "off"; + StringBuilder b = new StringBuilder(25); boolean allMonths = true; for (int i = 0; i < months.length; i++) { @@ -1160,7 +1164,7 @@ public class OpeningHoursParser { b.append("24/7 "); } if (off) { - b.append(additionalStrings.get("off")); + b.append(offStr); } } else { if (isOpened24_7()) { @@ -1182,7 +1186,7 @@ public class OpeningHoursParser { formatTime(enHour, enTime, b); } if (off) { - b.append(" ").append(additionalStrings.get("off")); + b.append(" ").append(offStr); } } } @@ -1238,7 +1242,7 @@ public class OpeningHoursParser { @Override public String toLocalRuleString() { - return toRuleString(localDaysStr, localMothsStr); + return toRuleString(true); } @Override