Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-08-10 15:56:54 +02:00
commit 14f557a83d
4 changed files with 31 additions and 1 deletions

View file

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="rendering_value_browse_map_name">Karte ansehen</string>
<string name="rendering_value_car_name">Auto</string>
<string name="rendering_value_bicycle_name">Fahrrad</string>
<string name="rendering_value_pedestrian_name">Fußgänger</string>
<string name="announce_nearby_favorites">Ansage von Favoriten in den Nähe</string>
<string name="rendering_attr_coloredBuildings_name">Gefärbte Gebäude</string>
<string name="continue_navigation">Navigation fortsetzen</string>

View file

@ -9,6 +9,10 @@
3. 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_value_browse_map_name">Browse map</string>
<string name="rendering_value_car_name">Car</string>
<string name="rendering_value_bicycle_name">Bicycle</string>
<string name="rendering_value_pedestrian_name">Pedestrian</string>
<string name="rendering_attr_coloredBuildings_name">Colored buildings</string>
<string name="osmo_invite">Invite...</string>
<string name="osmo_leave_confirmation_msg">Do you want to leave group %1$s?</string>

View file

@ -152,6 +152,20 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im
}
return defValue;
}
public static String getStringPropertyValue(Context ctx, String propertyValue) {
try {
final String propertyValueReplaced = propertyValue.replaceAll("\\s+","_");
Field f = R.string.class.getField("rendering_value_" + propertyValueReplaced + "_name");
if (f != null) {
Integer in = (Integer) f.get(null);
return ctx.getString(in);
}
} catch (Exception e) {
System.err.println(e.getMessage());
}
return propertyValue;
}
public SeekBarPreference createSeekBarPreference(OsmandPreference<Integer> b, int title, int summary, int dialogTextId, int defValue,
int maxValue) {

View file

@ -208,8 +208,16 @@ public class AppearanceWidgetsFactory {
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
//test old descr as title
b.setTitle(propertyDescr);
int i = Arrays.asList(p.getPossibleValues()).indexOf(pref.get());
b.setSingleChoiceItems(p.getPossibleValues(), i, new DialogInterface.OnClickListener() {
String[] possibleValuesString = new String[p.getPossibleValues().length];
for (int j = 0; j < p.getPossibleValues().length; j++) {
possibleValuesString[j] = SettingsActivity.getStringPropertyValue(view.getContext(), p.getPossibleValues()[j]);
}
b.setSingleChoiceItems(possibleValuesString, i, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
pref.set(p.getPossibleValues()[which]);