Merge pull request #748 from Bars107/master
Added translations for hillshade
This commit is contained in:
commit
c227231254
3 changed files with 15 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -854,7 +854,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
|||
R.drawable.ic_action_gshare_light, R.drawable.ic_action_gshare_dark,
|
||||
MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
createMenuItem(menu, CREATE_GROUP, R.string.osmo_create_group,
|
||||
0, 0,/*R.drawable.ic_action_marker_light,*/
|
||||
R.drawable.ic_action_plus_light, R.drawable.ic_action_plus_dark,
|
||||
MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||
createMenuItem(menu, SETTINGS_ID, R.string.settings,
|
||||
R.drawable.ic_action_settings_light, R.drawable.ic_action_settings_dark,
|
||||
|
|
Loading…
Reference in a new issue