Skip to content

Commit

Permalink
Language resource strings for 'points' and 'started at'
Browse files Browse the repository at this point in the history
Issue #1172
  • Loading branch information
mendhak committed Nov 7, 2024
1 parent 1ffb84a commit be3f77b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.slf4j.Logger;

import java.text.DateFormat;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -395,7 +396,7 @@ public void displayLocationInfo(Location locationInfo){
}

double distanceValue = session.getTotalTravelled();
txtTravelled.setText(Strings.getDistanceDisplay(getActivity(), distanceValue, preferenceHelper.shouldDisplayImperialUnits(), true) + " (" + session.getNumLegs() + " points)");
txtTravelled.setText(MessageFormat.format("{0} ({1} {2})", Strings.getDistanceDisplay(getActivity(), distanceValue, preferenceHelper.shouldDisplayImperialUnits(), true), session.getNumLegs(), getString(R.string.points)));

long startTime = session.getStartTimeStamp();
Date d = new Date(startTime);
Expand All @@ -405,10 +406,7 @@ public void displayLocationInfo(Location locationInfo){

DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getActivity().getApplicationContext());
txtTime.setText(duration + " (started at " + dateFormat.format(d) + " " + timeFormat.format(d) + ")");



txtTime.setText(MessageFormat.format("{0} ({1} {2} {3})", duration, getString(R.string.started_at), dateFormat.format(d), timeFormat.format(d)));
}


Expand Down
1 change: 1 addition & 0 deletions gpslogger/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@
<string name="distance_filter_title">Distance filter</string>
<string name="distance_filter_summary">The minimum distance required between current and previous for a point to be saved, otherwise the point will be discarded.</string>
<string name="points">points</string>
<string name="started_at">started at</string>
<string name="txt_number_of_points">Number of points</string>
<string name="save">Save</string>

Expand Down

0 comments on commit be3f77b

Please sign in to comment.