diff options
| -rw-r--r-- | main/src/cgeo/geocaching/files/GPXParser.java | 12 | ||||
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXParserTest.java | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java index fbe1b65..f8ec61c 100644 --- a/main/src/cgeo/geocaching/files/GPXParser.java +++ b/main/src/cgeo/geocaching/files/GPXParser.java @@ -790,9 +790,17 @@ public abstract class GPXParser extends FileParser { return WaypointType.TRAILHEAD; } else if ("final location".equalsIgnoreCase(sym)) { return WaypointType.FINAL; - } else { - return WaypointType.WAYPOINT; } + // this is not fully correct, but lets also look for localized waypoint types + for (WaypointType waypointType : WaypointType.ALL_TYPES_EXCEPT_OWN) { + final String localized = waypointType.getL10n(); + if (StringUtils.isNotEmpty(localized)) { + if (localized.equalsIgnoreCase(sym)) { + return waypointType; + } + } + } + return WaypointType.WAYPOINT; } private void findGeoCode(final String input) { diff --git a/tests/src/cgeo/geocaching/files/GPXParserTest.java b/tests/src/cgeo/geocaching/files/GPXParserTest.java index 8193fd8..5ba4081 100644 --- a/tests/src/cgeo/geocaching/files/GPXParserTest.java +++ b/tests/src/cgeo/geocaching/files/GPXParserTest.java @@ -107,6 +107,8 @@ public class GPXParserTest extends AbstractResourceInstrumentationTestCase { assertEquals(WaypointType.TRAILHEAD, GPXParser.convertWaypointSym2Type("Trailhead")); assertEquals(WaypointType.FINAL, GPXParser.convertWaypointSym2Type("Final location")); assertEquals(WaypointType.WAYPOINT, GPXParser.convertWaypointSym2Type("Reference point")); + + assertEquals(WaypointType.PARKING, GPXParser.convertWaypointSym2Type(WaypointType.PARKING.getL10n())); } private static void assertGc31j2h(final cgCache cache) { |
