Made some map styles translatable

This commit is contained in:
PaulStets 2018-01-23 17:51:39 +02:00
parent 1aee5df49d
commit 3eb7dd5165
4 changed files with 18 additions and 3 deletions

View file

@ -2810,4 +2810,7 @@
<string name="shared_string_without_name">Без имени</string> <string name="shared_string_without_name">Без имени</string>
<string name="lang_lo">Лаосский</string> <string name="lang_lo">Лаосский</string>
<string name="day_off_label">Выходной</string> <string name="day_off_label">Выходной</string>
<string name="winter_and_ski_renderer">Зимний/лыжный</string>
<string name="touring_view_renderer">Туристический (контраст и детали)</string>
<string name="nautical_renderer">Морской</string>
</resources> </resources>

View file

@ -3158,4 +3158,8 @@
<string name="osm_recipients_label">OSM-одержувачі</string> <string name="osm_recipients_label">OSM-одержувачі</string>
<string name="total_donations">Всього пожертвувань</string> <string name="total_donations">Всього пожертвувань</string>
<string name="day_off_label">Вихідний</string> <string name="day_off_label">Вихідний</string>
<string name="winter_and_ski_renderer">Зимовий/лижний</string>
<string name="touring_view_renderer">Туристичний (контраст і деталі)</string>
<string name="nautical_renderer">Морський</string>
</resources> </resources>

View file

@ -2842,4 +2842,7 @@
<string name="osm_recipients_label">OSM recipients</string> <string name="osm_recipients_label">OSM recipients</string>
<string name="total_donations">Total donations</string> <string name="total_donations">Total donations</string>
<string name="day_off_label">off</string> <string name="day_off_label">off</string>
<string name="winter_and_ski_renderer">Winter and ski</string>
<string name="touring_view_renderer">Touring view (contrast and details)</string>
<string name="nautical_renderer">Nautical</string>
</resources> </resources>

View file

@ -15,6 +15,7 @@ import net.osmand.IProgress;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleProperty;
import net.osmand.render.RenderingRulesStorage; import net.osmand.render.RenderingRulesStorage;
import net.osmand.render.RenderingRulesStorage.RenderingRulesStorageResolver; import net.osmand.render.RenderingRulesStorage.RenderingRulesStorageResolver;
@ -31,11 +32,12 @@ public class RendererRegistry {
public final static String DEFAULT_RENDER = "OsmAnd"; //$NON-NLS-1$ public final static String DEFAULT_RENDER = "OsmAnd"; //$NON-NLS-1$
public final static String DEFAULT_RENDER_FILE_PATH = "default.render.xml"; public final static String DEFAULT_RENDER_FILE_PATH = "default.render.xml";
public final static String TOURING_VIEW = "Touring view (contrast and details)"; //$NON-NLS-1$
public final static String WINTER_SKI_RENDER = "Winter and ski"; //$NON-NLS-1$
public final static String NAUTICAL_RENDER = "Nautical"; //$NON-NLS-1$
public final static String TOPO_RENDER = "Topo"; //$NON-NLS-1$ public final static String TOPO_RENDER = "Topo"; //$NON-NLS-1$
public final static String MAPNIK_RENDER = "Mapnik"; //$NON-NLS-1$ public final static String MAPNIK_RENDER = "Mapnik"; //$NON-NLS-1$
// Translatable renders
public static String TOURING_VIEW;
public static String WINTER_SKI_RENDER;
public static String NAUTICAL_RENDER;
private RenderingRulesStorage defaultRender = null; private RenderingRulesStorage defaultRender = null;
private RenderingRulesStorage currentSelectedRender = null; private RenderingRulesStorage currentSelectedRender = null;
@ -55,6 +57,9 @@ public class RendererRegistry {
public RendererRegistry(OsmandApplication app){ public RendererRegistry(OsmandApplication app){
this.app = app; this.app = app;
WINTER_SKI_RENDER = app.getResources().getString(R.string.winter_and_ski_renderer);
TOURING_VIEW = app.getResources().getString(R.string.touring_view_renderer);
NAUTICAL_RENDER = app.getResources().getString(R.string.nautical_renderer);
internalRenderers.put(DEFAULT_RENDER, DEFAULT_RENDER_FILE_PATH); internalRenderers.put(DEFAULT_RENDER, DEFAULT_RENDER_FILE_PATH);
internalRenderers.put(TOURING_VIEW, "Touring-view_(more-contrast-and-details)" +".render.xml"); internalRenderers.put(TOURING_VIEW, "Touring-view_(more-contrast-and-details)" +".render.xml");
internalRenderers.put(TOPO_RENDER, "topo" + ".render.xml"); internalRenderers.put(TOPO_RENDER, "topo" + ".render.xml");