From 2243426d5a2134600c29deac71b7cec2f0d6a3c3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 4 Jun 2015 10:16:21 +0200 Subject: [PATCH] Improve parsing --- OsmAnd-java/src/net/osmand/map/OsmandRegions.java | 10 ++++++---- .../osmand/plus/helpers/FileNameTranslationHelper.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java index fae252dd3f..59da177fe1 100644 --- a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java @@ -261,15 +261,17 @@ public class OsmandRegions { public boolean publish(BinaryMapDataObject object) { initTypes(object); String downloadName = getDownloadName(object); - if(downloadName == null) { - return false; - } - downloadName = downloadName.toLowerCase(); String parentFullName = getParentFullName(object); String fullName = getFullName(object); if(!Algorithms.isEmpty(parentFullName)) { parentRelations.put(fullName, parentFullName); } + + if(downloadName == null) { + // continent + return false; + } + downloadName = downloadName.toLowerCase(); downloadNames.put(fullName, downloadName); String locName = getLocaleName(object); if(locName != null && locName.length() > 0){ diff --git a/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java index 51fd41e232..4bb492f2bf 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/FileNameTranslationHelper.java @@ -68,7 +68,7 @@ public class FileNameTranslationHelper { int index = wikiWord.indexOf("("); if (index >= 0) { //removing word in "()" from recourse file - return wikiName + wikiWord.substring(0, index); + return wikiName + " " + wikiWord.substring(0, index).trim(); } return wikiName + " " + ctx.getString(R.string.amenity_type_osmwiki); }