From e08e7245738ca8ee5dab4dc5801dc6d35399873a Mon Sep 17 00:00:00 2001 From: bopol Date: Sat, 18 Jan 2020 10:46:53 +0100 Subject: [PATCH] upload date in description now matches newpipe's language --- .../main/java/org/schabi/newpipe/util/Localization.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/util/Localization.java b/app/src/main/java/org/schabi/newpipe/util/Localization.java index 3f555fcfd..d2fbd3a65 100644 --- a/app/src/main/java/org/schabi/newpipe/util/Localization.java +++ b/app/src/main/java/org/schabi/newpipe/util/Localization.java @@ -1,5 +1,6 @@ package org.schabi.newpipe.util; +import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; @@ -118,12 +119,13 @@ public class Localization { return nf.format(number); } - public static String formatDate(Date date) { - return DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()).format(date); + public static String formatDate(Date date, Context context) { + return DateFormat.getDateInstance(DateFormat.MEDIUM, getAppLocale(context)).format(date); } + @SuppressLint("StringFormatInvalid") public static String localizeUploadDate(Context context, Date date) { - return context.getString(R.string.upload_date_text, formatDate(date)); + return context.getString(R.string.upload_date_text, formatDate(date, context)); } public static String localizeViewCount(Context context, long viewCount) {