diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java index 66fe0fa5ad..da870d898e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapTransportReaderAdapter.java @@ -435,7 +435,7 @@ public class BinaryMapTransportReaderAdapter { dataObject.setEnName(stringTable.get(dataObject.getEnName(false).charAt(0))); } if(dataObject.getName().length() > 0 && dataObject.getName("en").length() == 0){ - dataObject.setEnName(TransliterationHelper.getInstance().transliterate(dataObject.getName())); + dataObject.setEnName(TransliterationHelper.transliterate(dataObject.getName())); } if(dataObject.getOperator() != null && dataObject.getOperator().length() > 0){ dataObject.setOperator(stringTable.get(dataObject.getOperator().charAt(0))); @@ -547,7 +547,7 @@ public class BinaryMapTransportReaderAdapter { case 0: dataObject.setReferencesToRoutes(req.cacheTypes.toArray()); if(dataObject.getName("en").length() == 0){ - dataObject.setEnName(TransliterationHelper.getInstance().transliterate(dataObject.getName())); + dataObject.setEnName(TransliterationHelper.transliterate(dataObject.getName())); } return dataObject; case OsmandOdb.TransportStop.ROUTES_FIELD_NUMBER : @@ -611,7 +611,7 @@ public class BinaryMapTransportReaderAdapter { switch (tag) { case 0: if (dataObject.getName("en").length() == 0) { - dataObject.setEnName(TransliterationHelper.getInstance().transliterate(dataObject.getName())); + dataObject.setEnName(TransliterationHelper.transliterate(dataObject.getName())); } if (x != 0 || y != 0) { dataObject.setLocation(BinaryMapIndexReader.TRANSPORT_STOP_ZOOM, x, y); diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java index 85af1b2cf8..ee716fcbb9 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java @@ -261,7 +261,7 @@ public class RouteDataObject { } String nmDef = names.get(region.nameTypeRule); if(transliterate && nmDef != null && nmDef.length() > 0) { - return TransliterationHelper.getInstance().transliterate(nmDef); + return TransliterationHelper.transliterate(nmDef); } return nmDef; } @@ -295,7 +295,7 @@ public class RouteDataObject { } String refDefault = names.get(region.refTypeRule); if(transliterate && refDefault != null && refDefault.length() > 0) { - return TransliterationHelper.getInstance().transliterate(refDefault); + return TransliterationHelper.transliterate(refDefault); } return refDefault; } @@ -358,13 +358,13 @@ public class RouteDataObject { int k = kt[i]; if(region.routeEncodingRules.size() > k) { if(!Algorithms.isEmpty(lang) && destinationTagLangFB.equals(region.routeEncodingRules.get(k).getTag())) { - return destRef1 + ((transliterate) ? TransliterationHelper.getInstance().transliterate(names.get(k)) : names.get(k)); + return destRef1 + ((transliterate) ? TransliterationHelper.transliterate(names.get(k)) : names.get(k)); } if(destinationTagFB.equals(region.routeEncodingRules.get(k).getTag())) { - return destRef1 + ((transliterate) ? TransliterationHelper.getInstance().transliterate(names.get(k)) : names.get(k)); + return destRef1 + ((transliterate) ? TransliterationHelper.transliterate(names.get(k)) : names.get(k)); } if(!Algorithms.isEmpty(lang) && destinationTagLang.equals(region.routeEncodingRules.get(k).getTag())) { - return destRef1 + ((transliterate) ? TransliterationHelper.getInstance().transliterate(names.get(k)) : names.get(k)); + return destRef1 + ((transliterate) ? TransliterationHelper.transliterate(names.get(k)) : names.get(k)); } if(destinationTagDefault.equals(region.routeEncodingRules.get(k).getTag())) { destinationDefault = names.get(k); @@ -372,7 +372,7 @@ public class RouteDataObject { } } if(destinationDefault != null) { - return destRef1 + ((transliterate) ? TransliterationHelper.getInstance().transliterate(destinationDefault) : destinationDefault); + return destRef1 + ((transliterate) ? TransliterationHelper.transliterate(destinationDefault) : destinationDefault); } } return "".equals(destRef) ? null : destRef; diff --git a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java index f326d02a6c..e27a04d1a1 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java @@ -28,8 +28,6 @@ public abstract class MapObject implements Comparable { public static final byte WAY_MODULO_REMAINDER = 1; - private int obfCountryLang = 0; - protected String name = null; protected String enName = null; @@ -184,8 +182,7 @@ public abstract class MapObject implements Comparable { return nm; } if (transliterate) { - return TransliterationHelper.getInstance().transliterate(getName()); -// return Junidecode.unidecode(getName()); + return TransliterationHelper.transliterate(getName()); } } } @@ -197,8 +194,7 @@ public abstract class MapObject implements Comparable { if (!Algorithms.isEmpty(enName)) { return this.enName; } else if (!Algorithms.isEmpty(getName()) && transliterate) { - return TransliterationHelper.getInstance().transliterate(getName()); -// return Junidecode.unidecode(getName()); + return TransliterationHelper.transliterate(getName()); } return ""; //$NON-NLS-1$ } diff --git a/OsmAnd-java/src/main/java/net/osmand/util/TransliterationHelper.java b/OsmAnd-java/src/main/java/net/osmand/util/TransliterationHelper.java index 76ecab9ebc..274b254c6e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/TransliterationHelper.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/TransliterationHelper.java @@ -39,7 +39,17 @@ public class TransliterationHelper { } public static void setCountry(String countryName) { - TransliterationHelper.country = countryName; + if (!countryName.equals(country)) { + switch (countryName) { + case "Japan": { + country = JAPAN; + break; + } + default: + country = DEFAULT; + break; + } + } } public static String getCountry() { diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index 8d65a120ae..7fc9fe8726 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -373,50 +373,49 @@ task appStart(type: Exec) { project.logger.warn("Analytics enabled for free version: $analytics") dependencies { - implementation project(path: ':OsmAnd-java', configuration: 'android') - if (analytics) { - implementation 'com.google.firebase:firebase-core:12.0.1' - implementation 'com.google.firebase:firebase-messaging:12.0.1' - implementation 'com.google.firebase:firebase-iid:12.0.1' - implementation 'com.google.firebase:firebase-config:12.0.1' - implementation 'com.facebook.android:facebook-android-sdk:4.31.0' - } - implementation 'com.android.support:multidex:1.0.1' - implementation 'com.android.support:gridlayout-v7:27.1.1' - implementation 'com.android.support:cardview-v7:27.1.1' - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:design:27.1.1' - implementation 'com.android.support:customtabs:27.1.1' - implementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') - implementation 'commons-logging:commons-logging:1.2' - implementation 'commons-codec:commons-codec:1.11' - implementation 'it.unibo.alice.tuprolog:tuprolog:3.2.1' - implementation 'org.beanshell:bsh-core:2.0b4' - implementation 'org.apache.commons:commons-compress:1.17' - implementation 'com.moparisthebest:junidecode:0.1.1' - implementation 'org.immutables:gson:2.5.0' - implementation 'com.vividsolutions:jts-core:1.14.0' - implementation 'com.squareup.picasso:picasso:2.71828' - // JS core - implementation 'org.mozilla:rhino:1.7.9' - // size restrictions - // implementation 'com.ibm.icu:icu4j:50.1' - // implementation 'net.sf.trove4j:trove4j:3.0.3' - qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs') - qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs') - legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar" - qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar" - qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" - qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar" - qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" - implementation('com.getkeepsafe.taptargetview:taptargetview:1.12.0') { - exclude group: 'com.android.support' - } - implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1' - implementation('com.github.HITGIF:TextFieldBoxes:1.3.5') { - exclude group: 'com.android.support' - } - implementation 'com.atilika.kuromoji:kuromoji-ipadic:0.9.0' + implementation project(path: ':OsmAnd-java', configuration: 'android') + if (analytics) { + implementation 'com.google.firebase:firebase-core:12.0.1' + implementation 'com.google.firebase:firebase-messaging:12.0.1' + implementation 'com.google.firebase:firebase-iid:12.0.1' + implementation 'com.google.firebase:firebase-config:12.0.1' + implementation 'com.facebook.android:facebook-android-sdk:4.31.0' + } + implementation 'com.android.support:multidex:1.0.1' + implementation 'com.android.support:gridlayout-v7:27.1.1' + implementation 'com.android.support:cardview-v7:27.1.1' + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:design:27.1.1' + implementation 'com.android.support:customtabs:27.1.1' + implementation fileTree(include: ['gnu-trove-osmand.jar', 'icu4j-49_1_patched.jar'], dir: 'libs') + implementation 'commons-logging:commons-logging:1.2' + implementation 'commons-codec:commons-codec:1.11' + implementation 'it.unibo.alice.tuprolog:tuprolog:3.2.1' + implementation 'org.beanshell:bsh-core:2.0b4' + implementation 'org.apache.commons:commons-compress:1.17' + implementation 'com.moparisthebest:junidecode:0.1.1' + implementation 'org.immutables:gson:2.5.0' + implementation 'com.vividsolutions:jts-core:1.14.0' + implementation 'com.squareup.picasso:picasso:2.71828' + // JS core + implementation 'org.mozilla:rhino:1.7.9' + // size restrictions + // implementation 'com.ibm.icu:icu4j:50.1' + // implementation 'net.sf.trove4j:trove4j:3.0.3' + qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs') + qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs') + legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar" + qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar" + qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" + qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar" + qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar" + implementation('com.getkeepsafe.taptargetview:taptargetview:1.12.0') { + exclude group: 'com.android.support' + } + implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1' + implementation('com.github.HITGIF:TextFieldBoxes:1.3.5') { + exclude group: 'com.android.support' + } } if(analytics) { println "Apply GMS plugin" diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index a2e0ff5537..e423db4294 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -43,7 +43,6 @@ import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; import android.widget.TextView; -import java.lang.Character.UnicodeBlock; import net.osmand.plus.R; import net.osmand.plus.download.DownloadActivity; @@ -526,13 +525,4 @@ public class AndroidUtils { return result; } - public static boolean checkIfKana(String string) { - boolean isKana = false; - for (char c : string.toCharArray()) { - isKana = UnicodeBlock.of(c) == UnicodeBlock.KATAKANA; - } - return isKana; - } - - } diff --git a/OsmAnd/src/net/osmand/plus/helpers/CustomTransliterationHelper.java b/OsmAnd/src/net/osmand/plus/helpers/CustomTransliterationHelper.java deleted file mode 100644 index fef0399fbd..0000000000 --- a/OsmAnd/src/net/osmand/plus/helpers/CustomTransliterationHelper.java +++ /dev/null @@ -1,225 +0,0 @@ -package net.osmand.plus.helpers; - -import com.atilika.kuromoji.ipadic.Token; -import com.atilika.kuromoji.ipadic.Tokenizer; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class CustomTransliterationHelper { - - public static String japanese2Romaji(String input) { - - boolean capitalizeWords = true; - - Tokenizer tokenizer = new Tokenizer(); - List tokens = tokenizer.tokenize(input); - StringBuffer buffer = new StringBuffer(); - KanaToRomaji kanaToRomaji = new KanaToRomaji(); - String lastTokenToMerge = ""; - for (Token token : tokens) { - String type = token.getAllFeaturesArray()[1]; - - if (token.getAllFeaturesArray()[0].equals("記号")) { - buffer.append(token.getSurface()); - continue; - } - switch (token.getAllFeaturesArray()[1]) { - case "数": - case "アルファベット": - case "サ変接続": - buffer.append(token.getSurface()); - continue; - default: - String lastFeature = token.getAllFeaturesArray()[8]; - if (lastFeature.equals("*")) { - buffer.append(token.getSurface()); - } else { - String romaji = kanaToRomaji.convert(token.getAllFeaturesArray()[8]); - if (lastFeature.endsWith("ッ")) { - lastTokenToMerge = lastFeature; - continue; - } else { - lastTokenToMerge = ""; - } - - if (capitalizeWords) { - buffer.append(romaji.substring(0, 1).toUpperCase()); - buffer.append(romaji.substring(1)); - } else { - // Convert foreign katakana words to uppercase - if (token.getSurface() - .equals(token.getPronunciation())) // detect katakana - { - romaji = romaji.toUpperCase(); - } - buffer.append(romaji); - } - } - } - buffer.append(" "); - } - return buffer.toString(); - } - - - public static boolean isCharFromCJK(final char c) { - return (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.HIRAGANA) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.KATAKANA) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_COMPATIBILITY_FORMS) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS) - || (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.ENCLOSED_CJK_LETTERS_AND_MONTHS); - } - - public static void main(String[] args) { - System.out.println(japanese2Romaji("川名本町")); - System.out.println(japanese2Romaji("明岸寺")); - System.out.println(japanese2Romaji("つきしま")); - - } - - private static class KanaToRomaji { - - Map m = new HashMap(); - - // Constructor - public KanaToRomaji() { - m.put("ア", "a"); - m.put("イ", "i"); - m.put("ウ", "u"); - m.put("エ", "e"); - m.put("オ", "o"); - m.put("カ", "ka"); - m.put("キ", "ki"); - m.put("ク", "ku"); - m.put("ケ", "ke"); - m.put("コ", "ko"); - m.put("サ", "sa"); - m.put("シ", "shi"); - m.put("ス", "su"); - m.put("セ", "se"); - m.put("ソ", "so"); - m.put("タ", "ta"); - m.put("チ", "chi"); - m.put("ツ", "tsu"); - m.put("テ", "te"); - m.put("ト", "to"); - m.put("ナ", "na"); - m.put("ニ", "ni"); - m.put("ヌ", "nu"); - m.put("ネ", "ne"); - m.put("ノ", "no"); - m.put("ハ", "ha"); - m.put("ヒ", "hi"); - m.put("フ", "fu"); - m.put("ヘ", "he"); - m.put("ホ", "ho"); - m.put("マ", "ma"); - m.put("ミ", "mi"); - m.put("ム", "mu"); - m.put("メ", "me"); - m.put("モ", "mo"); - m.put("ヤ", "ya"); - m.put("ユ", "yu"); - m.put("ヨ", "yo"); - m.put("ラ", "ra"); - m.put("リ", "ri"); - m.put("ル", "ru"); - m.put("レ", "re"); - m.put("ロ", "ro"); - m.put("ワ", "wa"); - m.put("ヲ", "wo"); - m.put("ン", "n"); - m.put("ガ", "ga"); - m.put("ギ", "gi"); - m.put("グ", "gu"); - m.put("ゲ", "ge"); - m.put("ゴ", "go"); - m.put("ザ", "za"); - m.put("ジ", "ji"); - m.put("ズ", "zu"); - m.put("ゼ", "ze"); - m.put("ゾ", "zo"); - m.put("ダ", "da"); - m.put("ヂ", "ji"); - m.put("ヅ", "zu"); - m.put("デ", "de"); - m.put("ド", "do"); - m.put("バ", "ba"); - m.put("ビ", "bi"); - m.put("ブ", "bu"); - m.put("ベ", "be"); - m.put("ボ", "bo"); - m.put("パ", "pa"); - m.put("ピ", "pi"); - m.put("プ", "pu"); - m.put("ペ", "pe"); - m.put("ポ", "po"); - m.put("キャ", "kya"); - m.put("キュ", "kyu"); - m.put("キョ", "kyo"); - m.put("シャ", "sha"); - m.put("シュ", "shu"); - m.put("ショ", "sho"); - m.put("チャ", "cha"); - m.put("チュ", "chu"); - m.put("チョ", "cho"); - m.put("ニャ", "nya"); - m.put("ニュ", "nyu"); - m.put("ニョ", "nyo"); - m.put("ヒャ", "hya"); - m.put("ヒュ", "hyu"); - m.put("ヒョ", "hyo"); - m.put("リャ", "rya"); - m.put("リュ", "ryu"); - m.put("リョ", "ryo"); - m.put("ギャ", "gya"); - m.put("ギュ", "gyu"); - m.put("ギョ", "gyo"); - m.put("ジャ", "ja"); - m.put("ジュ", "ju"); - m.put("ジョ", "jo"); - m.put("ティ", "ti"); - m.put("ディ", "di"); - m.put("ツィ", "tsi"); - m.put("ヂャ", "dya"); - m.put("ヂュ", "dyu"); - m.put("ヂョ", "dyo"); - m.put("ビャ", "bya"); - m.put("ビュ", "byu"); - m.put("ビョ", "byo"); - m.put("ピャ", "pya"); - m.put("ピュ", "pyu"); - m.put("ピョ", "pyo"); - m.put("ー", "-"); - } - - public String convert(String s) { - StringBuilder t = new StringBuilder(); - for (int i = 0; i < s.length(); i++) { - if (i <= s.length() - 2) { - if (m.containsKey(s.substring(i, i + 2))) { - t.append(m.get(s.substring(i, i + 2))); - i++; - } else if (m.containsKey(s.substring(i, i + 1))) { - t.append(m.get(s.substring(i, i + 1))); - } else if (s.charAt(i) == 'ッ') { - t.append(m.get(s.substring(i + 1, i + 2)).charAt(0)); - } else { - t.append(s.charAt(i)); - } - } else { - if (m.containsKey(s.substring(i, i + 1))) { - t.append(m.get(s.substring(i, i + 1))); - } else { - t.append(s.charAt(i)); - } - } - } - return t.toString(); - } - } -} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/poi/NominatimPoiFilter.java b/OsmAnd/src/net/osmand/plus/poi/NominatimPoiFilter.java index 4831b8a16d..0b9dbe299d 100644 --- a/OsmAnd/src/net/osmand/plus/poi/NominatimPoiFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/NominatimPoiFilter.java @@ -137,7 +137,7 @@ public class NominatimPoiFilter extends PoiUIFilter { a.setId(Long.parseLong(parser.getAttributeValue("", "place_id"))); //$NON-NLS-1$ //$NON-NLS-2$ String name = parser.getAttributeValue("", "display_name"); //$NON-NLS-1$//$NON-NLS-2$ a.setName(name); - a.setEnName(TransliterationHelper.getInstance().transliterate(getName())); + a.setEnName(TransliterationHelper.transliterate(getName())); a.setSubType(parser.getAttributeValue("", "type")); //$NON-NLS-1$//$NON-NLS-2$ PoiType pt = poiTypes.getPoiTypeByKey(a.getSubType()); a.setType(pt != null ? pt.getCategory() : poiTypes.getOtherPoiCategory()); @@ -153,7 +153,7 @@ public class NominatimPoiFilter extends PoiUIFilter { String name = parser.getText(); if (name != null) { a.setName(name); - a.setEnName(TransliterationHelper.getInstance().transliterate(getName())); + a.setEnName(TransliterationHelper.transliterate(getName())); } } } diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 2d22766f89..4917dd9608 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -308,8 +308,8 @@ public class MapRenderRepositories { BinaryMapIndexReader fr = files.get(mapName); if (fr != null && (fr.containsMapData(leftX, topY, rightX, bottomY, zoom) || fr.containsRouteData(leftX, topY, rightX, bottomY, zoom))) { - if(!Algorithms.isEmpty(fr.getCountryName())) { - setCountryForTransliterationMethod(fr.getCountryName()); + if (!Algorithms.isEmpty(fr.getCountryName())) { + TransliterationHelper.setCountry(fr.getCountryName()); } if (!nativeFiles.contains(mapName)) { long time = System.currentTimeMillis(); @@ -546,9 +546,8 @@ public class MapRenderRepositories { res = new ArrayList(); log.debug("Search failed " + c.getRegionNames(), e); //$NON-NLS-1$ } - if(res.size() > 0) { - log.debug("Country name:" + c.getCountryName()); - setCountryForTransliterationMethod(c.getCountryName()); + if (res.size() > 0) { + TransliterationHelper.setCountry(c.getCountryName()); if(basemap) { renderedState |= 1; } else { @@ -596,20 +595,6 @@ public class MapRenderRepositories { return mi; } - private void setCountryForTransliterationMethod(String countryName) { - if(!countryName.equals(TransliterationHelper.getCountry())) { - switch (countryName) { - case "Japan": { - setCountry(countryName); - break; - } - default: - setCountry(TransliterationHelper.DEFAULT); - break; - } - } - } - private void validateLatLonBox(QuadRect box) { if (box.top > 90) { box.top = 85.5f; diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index 4ad4990e95..2d2397f5ef 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -241,11 +241,9 @@ public class TextRenderer { TextDrawInfo text = rc.textToDraw.get(i); if (text.text != null && text.text.length() > 0) { if (preferredLocale.length() > 0) { - text.text = TransliterationHelper.getInstance().transliterate(text.text); + text.text = TransliterationHelper.transliterate(text.text); } - - // sest text size before finding intersection (it is used there) float textSize = text.textSize * rc.textScale ; paintText.setTextSize(textSize); diff --git a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java index 23d5bf25c2..27559ee966 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java +++ b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java @@ -45,11 +45,9 @@ public class AsyncLoadingThread extends Thread { if (req instanceof TileLoadDownloadRequest) { TileLoadDownloadRequest r = (TileLoadDownloadRequest) req; tileLoaded |= resourceManger.hasRequestedTile(r); - } else if (req instanceof MapLoadRequest) { if (!mapLoaded) { MapLoadRequest r = (MapLoadRequest) req; - resourceManger.getRenderer().loadMap(r.tileBox, resourceManger.getMapTileDownloader()); mapLoaded = !resourceManger.getRenderer().wasInterrupted(); if (r.mapLoadedListener != null) {