--- android/TrainInfo/src/dk/thoerup/traininfo/TimetableListAdapter.java 2011/04/04 11:58:30 1256 +++ android/TrainInfo/src/dk/thoerup/traininfo/TimetableListAdapter.java 2011/04/04 15:28:12 1257 @@ -1,6 +1,7 @@ package dk.thoerup.traininfo; import android.content.Context; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -50,6 +51,14 @@ return position; } + String getTranslated(String str) { + if (str == null) + return str; + + str = str.replace("Aflyst", context.getString(R.string.timetablelist_cancel) ); + return str; + } + @Override public View getView(int position, View convertView, ViewGroup parent) { TimetableEntry entry = timetable.entries.get(position); @@ -57,13 +66,13 @@ View root = inflater.inflate(R.layout.timetablerow , parent, false); TextView station = (TextView) root.findViewById(R.id.Station); - station.setText(entry.getStation()); + station.setText( entry.getStation() ); TextView arrival = (TextView) root.findViewById(R.id.Arrival); - arrival.setText(entry.getArrival()); + arrival.setText( getTranslated(entry.getArrival()) ); TextView departure = (TextView) root.findViewById(R.id.Departure); - departure.setText(entry.getDeparture()); + departure.setText( getTranslated(entry.getDeparture()) ); if (entry.isCurrent()) {