Translate rendering settings
This commit is contained in:
parent
4e9088af31
commit
7b3191b209
2 changed files with 37 additions and 2 deletions
|
@ -9,6 +9,14 @@
|
|||
1. 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
|
||||
-->
|
||||
<string name="rendering_attr_noPolygons_description">Make all areal land features on map transparent</string>
|
||||
<string name="rendering_attr_noPolygons_name">No polygons</string>
|
||||
<string name="rendering_attr_appMode_name">Rendering mode</string>
|
||||
<string name="rendering_attr_appMode_description">Map optimization for respective User Profile</string>
|
||||
<string name="rendering_attr_contourLines_description">Select minimum zoom level to display in map if available. Separate SRTM-file may be needed.</string>
|
||||
<string name="rendering_attr_contourLines_name">Show contour lines</string>
|
||||
<string name="rendering_attr_hmRendered_description">Increase amount of map detail shown</string>
|
||||
<string name="rendering_attr_hmRendered_name">Show more map detail</string>
|
||||
<string name="local_index_routing_data">Routing data</string>
|
||||
<string name="navigate_point_format">Format :</string>
|
||||
<string name="poi_search_desc">POI (Point of interest) search</string>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -110,6 +111,32 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
|||
seekBarPreferences.put(b.getId(), b);
|
||||
}
|
||||
|
||||
public String getStringPropertyName(String propertyName, String defValue) {
|
||||
try {
|
||||
Field f = R.string.class.getField("rendering_attr_"+propertyName+"_name");
|
||||
if(f != null) {
|
||||
Integer in = (Integer) f.get(null);
|
||||
return getString(in);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return defValue;
|
||||
}
|
||||
|
||||
public String getStringPropertyDescription(String propertyName, String defValue) {
|
||||
try {
|
||||
Field f = R.string.class.getField("rendering_attr_"+propertyName+"_description");
|
||||
if(f != null) {
|
||||
Integer in = (Integer) f.get(null);
|
||||
return getString(in);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return defValue;
|
||||
}
|
||||
|
||||
public SeekBarPreference createSeekBarPreference(OsmandPreference<Integer> b, int title, int summary, int dialogTextId,
|
||||
int defValue, int maxValue){
|
||||
SeekBarPreference p = new SeekBarPreference(this, dialogTextId, defValue, maxValue);
|
||||
|
@ -373,8 +400,8 @@ public class SettingsActivity extends PreferenceActivity implements OnPreference
|
|||
ListPreference lp = new ListPreference(this);
|
||||
lp.setOnPreferenceChangeListener(this);
|
||||
lp.setKey(custom.getId());
|
||||
lp.setTitle(p.getName());
|
||||
lp.setSummary(p.getDescription());
|
||||
lp.setTitle(getStringPropertyName(custom.getId(), p.getName()));
|
||||
lp.setSummary(getStringPropertyDescription(p.getAttrName(), p.getDescription()));
|
||||
cat.addPreference(lp);
|
||||
|
||||
LinkedHashMap<String, Object> vals = new LinkedHashMap<String, Object>();
|
||||
|
|
Loading…
Reference in a new issue