Added translations for hillshade

This commit is contained in:
Denis 2014-07-14 15:26:14 +04:00
parent cccd67fb7a
commit 56954f9baa
2 changed files with 14 additions and 0 deletions

View file

@ -204,6 +204,9 @@ public class DownloadActivityType {
if (bn.endsWith(FileNameTranslationHelper.WIKI_NAME)){
return FileNameTranslationHelper.getWikiName(ctx,bn);
}
if (bn.startsWith(FileNameTranslationHelper.HILL_SHADE)){
return FileNameTranslationHelper.getHillShadeName(ctx, osmandRegions, bn);
}
final String lc = bn.toLowerCase();
String std = FileNameTranslationHelper.getStandardMapName(ctx, lc);
if (std != null) {

View file

@ -14,6 +14,7 @@ import java.lang.reflect.Field;
public class FileNameTranslationHelper {
public static final String WIKI_NAME = "_wiki";
public static final String HILL_SHADE = "Hillshade";
public static String getFileName(Context ctx, OsmandRegions regions, String fileName) {
String basename = getBasename(fileName);
@ -21,6 +22,8 @@ public class FileNameTranslationHelper {
return getWikiName(ctx,basename);
} else if (fileName.endsWith("tts")) { //tts files
return getVoiceName(ctx, fileName);
} else if (fileName.startsWith(HILL_SHADE)){
return getHillShadeName(ctx, regions, basename);
} else if (fileName.length() == 2) { //voice recorded files
try {
Field f = R.string.class.getField("lang_"+fileName);
@ -47,6 +50,14 @@ public class FileNameTranslationHelper {
return null;
}
public static String getHillShadeName(Context ctx, OsmandRegions regions, String basename) {
String intermName = basename.replace(HILL_SHADE,"");
String hillsh = ctx.getString(R.string.download_hillshade_item) + " ";
String locName = regions.getLocaleName(intermName.trim().replace(" ", "_"));
return hillsh + locName;
}
public static String getWikiName(Context ctx, String basename){
String cutted = basename.substring(0, basename.indexOf("_wiki"));
String wikiName = getStandardLangName(ctx, cutted);