aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-05-20 20:36:15 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-05-20 20:36:15 +0200
commit45cae4a34041f8c73c380d073ef7d170e2467ed0 (patch)
tree6d5d35201f85b9f68800054b337b55834bd662d9 /src
parentff6e51356f2e76418ed71f19b7232c840a1b6bce (diff)
parentaba1ca7918c0797987a185e67f7d6986f88b2314 (diff)
Merge pull request #133 from kruks23/development
Update Spanish Translations + harcoded just_now
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java2
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java2
-rw-r--r--src/eu/siacs/conversations/utils/UIHelper.java12
3 files changed, 8 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index 346cd2fc..f1995935 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -223,7 +223,7 @@ public class ConversationActivity extends XmppActivity {
}
((TextView) view.findViewById(R.id.conversation_lastupdate))
- .setText(UIHelper.readableTimeDifference(conv
+ .setText(UIHelper.readableTimeDifference(getContext(), conv
.getLatestMessage().getTimeSent()));
ImageView profilePicture = (ImageView) view
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 7ab01936..41837d8f 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -233,7 +233,7 @@ public class ConversationFragment extends Fragment {
viewHolder.indicator.setVisibility(View.VISIBLE);
}
- String formatedTime = UIHelper.readableTimeDifference(message
+ String formatedTime = UIHelper.readableTimeDifference(getContext(), message
.getTimeSent());
if (message.getStatus() <= Message.STATUS_RECIEVED) {
if ((filesize != null) && (info != null)) {
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java
index ff99c091..d626d421 100644
--- a/src/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/eu/siacs/conversations/utils/UIHelper.java
@@ -50,16 +50,16 @@ public class UIHelper {
private static final int FG_COLOR = 0xFFE5E5E5;
private static final int TRANSPARENT = 0x00000000;
- public static String readableTimeDifference(long time) {
+ public static String readableTimeDifference(Context context, long time) {
if (time == 0) {
- return "just now";
+ return context.getString(R.string.just_now);
}
Date date = new Date(time);
long difference = (System.currentTimeMillis() - time) / 1000;
if (difference < 60) {
- return "just now";
+ return context.getString(R.string.just_now);
} else if (difference < 60 * 10) {
- return difference / 60 + " min ago";
+ return difference / 60 + " " + context.getString(R.string.minutes_ago);
} else if (difference < 60 * 60 * 24) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm",Locale.US);
return sdf.format(date);
@@ -395,7 +395,7 @@ public class UIHelper {
.bigText(bigText.toString()));
} else {
NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();
- style.setBigContentTitle(unread.size() + " unread Conversations");
+ style.setBigContentTitle(unread.size() + " " + context.getString(R.string.unread_conversations));
StringBuilder names = new StringBuilder();
for (int i = 0; i < unread.size(); ++i) {
targetUuid = unread.get(i).getUuid();
@@ -407,7 +407,7 @@ public class UIHelper {
style.addLine(Html.fromHtml("<b>" + unread.get(i).getName(useSubject)
+ "</b> " + unread.get(i).getLatestMessage().getReadableBody(context)));
}
- mBuilder.setContentTitle(unread.size() + " unread Conversations");
+ mBuilder.setContentTitle(unread.size() + " " + context.getString(R.string.unread_conversations));
mBuilder.setContentText(names.toString());
mBuilder.setStyle(style);
}