Skip to content

Commit

Permalink
Milestones list localization
Browse files Browse the repository at this point in the history
  • Loading branch information
UEvgeniy committed Dec 16, 2017
1 parent ae5596c commit 2d6fe3f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*/
public class MilestoneListAdapter extends SingleTypeAdapter<Milestone> {

private final Context context;
/**
* Create milestone list adapter
*
Expand All @@ -40,6 +41,7 @@ public class MilestoneListAdapter extends SingleTypeAdapter<Milestone> {
public MilestoneListAdapter(final Context context,
final Milestone[] elements, final AvatarLoader avatars) {
super(LayoutInflater.from(context), R.layout.milestone_item);
this.context = context.getApplicationContext();
setItems(elements);
}

Expand All @@ -60,11 +62,11 @@ protected int[] getChildViewIds() {

@Override
protected void update(int position, Milestone milestone) {
SimpleDateFormat sdf = new SimpleDateFormat("dd.MMM.yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy");

setText(0, milestone.getTitle());
setText(1, "Due by " + sdf.format(milestone.getDueOn()));
setText(2, "Opened: " + String.valueOf(milestone.getOpenIssues()));
setText(3, "Closed: " + String.valueOf(milestone.getClosedIssues()));
setText(1, context.getString(R.string.ms_due_by) + sdf.format(milestone.getDueOn()));
setText(2, context.getString(R.string.ms_opened_issues) + String.valueOf(milestone.getOpenIssues()));
setText(3, context.getString(R.string.ms_closed_issues) + String.valueOf(milestone.getClosedIssues()));
}
}
3 changes: 3 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,5 +344,8 @@
<string name="render_markdown">Отобразить Markdown</string>
<string name="copy_hash">Копировать хэш</string>
<string name="toast_msg_copied">Скопировано в буфер обмена</string>
<string name="ms_closed_issues">"Закрытые: "</string>
<string name="ms_due_by">"До "</string>
<string name="ms_opened_issues">"Открытые: "</string>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -346,5 +346,8 @@
<string name="copy_hash">Copy hash</string>
<string name="toast_msg_copied">Copied to clipboard</string>
<string name="parent_repo">Parent repository</string>
<string name="ms_due_by">Due by</string>
<string name="ms_opened_issues">Opened:</string>
<string name="ms_closed_issues">Closed:</string>

</resources>

0 comments on commit 2d6fe3f

Please sign in to comment.