diff --git a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java index 5a28644611..81db96e7ae 100644 --- a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java @@ -17,9 +17,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import net.osmand.Collator; -import net.osmand.CollatorStringMatcher; -import net.osmand.OsmAndCollator; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapDataObject; import net.osmand.binary.BinaryMapIndexReader; @@ -244,11 +241,9 @@ public class OsmandRegions { @Override public boolean publish(BinaryMapDataObject object) { - if (object.getPointsLength() < 1) { - return false; - } initTypes(object); String downloadName = object.getNameByType(downloadNameType).toLowerCase(); + String prefix = object.getNameByType(prefixType); String locName = getLocaleName(object); if(locName != null && locName.length() > 0){ downloadNamesToLocaleNames.put(downloadName, locName); @@ -257,6 +252,8 @@ public class OsmandRegions { TIntObjectIterator it = object.getObjectNames().iterator(); StringBuilder ind = new StringBuilder(); + String pr = getDownloadNameIndexLowercase(prefix); + ind.append(pr == null ? prefix.toLowerCase() : pr.toLowerCase()).append(" "); while(it.hasNext()) { it.advance(); TagValuePair tp = mi.decodeType(it.key()); diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index b48553697b..97fc59b013 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,13 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + addresses nationwide + World altitude correcion + World seamarks + World bitcoin payments + World overview map + World ski map + Croatian Chinese Portuguese (Brazil) English diff --git a/OsmAnd/src/net/osmand/plus/download/IndexItem.java b/OsmAnd/src/net/osmand/plus/download/IndexItem.java index 66df8696c9..4f195905d7 100644 --- a/OsmAnd/src/net/osmand/plus/download/IndexItem.java +++ b/OsmAnd/src/net/osmand/plus/download/IndexItem.java @@ -66,7 +66,7 @@ public class IndexItem implements Comparable { public String getVoiceName(Context ctx) { try { String nm = getBasename().replace('-', '_').replace(' ', '_'); - if (nm.endsWith("-tts")) { + if (nm.endsWith("_tts")) { nm = nm.substring(0, nm.length() - 4); } Field f = R.string.class.getField("lang_"+nm); @@ -86,7 +86,35 @@ public class IndexItem implements Comparable { } else if (fileName.endsWith(IndexConstants.TTSVOICE_INDEX_EXT_ZIP)) { return ctx.getString(R.string.ttsvoice) + "\n" + getVoiceName(ctx); } - return osmandRegions.getLocaleName(getBasename()); + final String bn = getBasename(); + final String lc = bn.toLowerCase(); + String std = getStandardMapName(ctx, lc); + if (std != null) { + return std; + } + if (bn.contains("addresses-nationwide")) { + final int ind = bn.indexOf("addresses-nationwide"); + String downloadName = bn.substring(0, ind - 1) + bn.substring(ind + "addresses-nationwide".length()); + return osmandRegions.getLocaleName(downloadName) + + " "+ ctx.getString(R.string.index_item_nation_addresses); + } + + return osmandRegions.getLocaleName(lc); + } + + private String getStandardMapName(Context ctx, String basename) { + if(basename.equals("world-ski")) { + return ctx.getString(R.string.index_item_world_ski); + } else if(basename.equals("world_altitude_correction_ww15mgh")) { + return ctx.getString(R.string.index_item_world_altitude_correction); + } else if(basename.equals("world_basemap")) { + return ctx.getString(R.string.index_item_world_basemap); + } else if(basename.equals("world_bitcoin_payments")) { + return ctx.getString(R.string.index_item_world_bitcoin_payments); + } else if(basename.equals("world_seamarks")) { + return ctx.getString(R.string.index_item_world_seamarks); + } + return null; } public boolean isVoiceItem() {