diff --git a/app/src/main/java/com/github/libretube/util/TextUtils.kt b/app/src/main/java/com/github/libretube/util/TextUtils.kt
index e853764c1..5bb5f4f7b 100644
--- a/app/src/main/java/com/github/libretube/util/TextUtils.kt
+++ b/app/src/main/java/com/github/libretube/util/TextUtils.kt
@@ -6,13 +6,14 @@ import android.os.Build
import android.text.format.DateUtils
import com.github.libretube.R
import java.time.Instant
+import java.time.LocalDate
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.format.FormatStyle
import java.time.temporal.ChronoUnit
import kotlin.time.Duration
-import kotlinx.datetime.LocalDate
+import kotlinx.datetime.LocalDate as KotlinLocalDate
import kotlinx.datetime.toJavaLocalDate
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
@@ -37,7 +38,7 @@ object TextUtils {
* @param date The date to parse
* @return localized date string
*/
- fun localizeDate(date: LocalDate): String {
+ fun localizeDate(date: KotlinLocalDate): String {
return date.toJavaLocalDate().format(MEDIUM_DATE_FORMATTER)
}
@@ -66,31 +67,32 @@ object TextUtils {
// TODO: Use LocalDate.ofInstant() when it is available in SDK 34.
val date = LocalDateTime.ofInstant(Instant.ofEpochMilli(unixTime), ZoneId.systemDefault())
.toLocalDate()
- val now = java.time.LocalDate.now()
- val weeks = date.until(now, ChronoUnit.WEEKS)
+ val now = LocalDate.now()
+ val months = date.until(now, ChronoUnit.MONTHS)
- return if (weeks > 0) {
- val months = date.until(now, ChronoUnit.MONTHS)
+ return if (months > 0) {
val years = months / 12
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
- val (timeFormat, time) = when {
- years > 0 -> RelativeDateTimeFormatter.RelativeUnit.YEARS to years
- months > 0 -> RelativeDateTimeFormatter.RelativeUnit.MONTHS to months
- else -> RelativeDateTimeFormatter.RelativeUnit.WEEKS to weeks
+ val (timeFormat, time) = if (years > 0) {
+ RelativeDateTimeFormatter.RelativeUnit.YEARS to years
+ } else {
+ RelativeDateTimeFormatter.RelativeUnit.MONTHS to months
}
RelativeDateTimeFormatter.getInstance()
.format(time.toDouble(), RelativeDateTimeFormatter.Direction.LAST, timeFormat)
} else {
- val (timeAgoRes, time) = when {
- years > 0 -> R.plurals.years_ago to years
- months > 0 -> R.plurals.months_ago to months
- else -> R.plurals.weeks_ago to weeks
+ val (timeAgoRes, time) = if (years > 0) {
+ R.plurals.years_ago to years
+ } else {
+ R.plurals.months_ago to months
}
context.resources.getQuantityString(timeAgoRes, time.toInt(), time)
}
} else {
- DateUtils.getRelativeTimeSpanString(unixTime)
+ val weeks = date.until(now, ChronoUnit.WEEKS)
+ val minResolution = if (weeks > 0) DateUtils.WEEK_IN_MILLIS else 0L
+ DateUtils.getRelativeTimeSpanString(unixTime, System.currentTimeMillis(), minResolution)
}
}
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
index d300a3cd8..652a5f331 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -471,14 +471,6 @@
- %d منذ أشهر
- %d منذ أشهر
-
- - %d منذ أسبوع
- - %d منذ أسبوع
- - %d منذ أسبوعين
- - %d منذ أسابيع
- - %d منذ أسابيع
- - %d منذ أسابيع
-
LBRY HLS
استخدم LBRY HLS للبث إذا كان متاحا.
مشتركون %1$s • فيديوهات %2$d
diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml
index ea7718aa5..822ccfa19 100644
--- a/app/src/main/res/values-az/strings.xml
+++ b/app/src/main/res/values-az/strings.xml
@@ -459,10 +459,6 @@
- %d ay əvvəl
- %d ay əvvəl
-
- - %d həftə əvvəl
- - %d həftə əvvəl
-
- %d il əvvəl
- %d il əvvəl
diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml
index 300accb37..d3f5cf434 100644
--- a/app/src/main/res/values-be/strings.xml
+++ b/app/src/main/res/values-be/strings.xml
@@ -427,12 +427,6 @@
Кодэкі
Пазначыць як прагледжанае
Карыстальніцкая хуткасць
-
- - %d тыдзень таму
- - %d тыдні таму
- - %d тыдняў таму
- - %d тыдняў таму
-
Альтэрнатыўныя элементы кіравання PiP
Паказваць толькі аўдыя і прапускаць элементы кіравання ў PiP замест перамоткі наперад і назад
Выкарыстоўвайце іншую хуткасць прайгравання, чым для звычайнага прайгравальніка.
diff --git a/app/src/main/res/values-ckb/strings.xml b/app/src/main/res/values-ckb/strings.xml
index 3a73c72d3..92b746797 100644
--- a/app/src/main/res/values-ckb/strings.xml
+++ b/app/src/main/res/values-ckb/strings.xml
@@ -111,10 +111,6 @@
پیشاندانی ناوەڕۆکە هاوشێوەکان لەکاتی سەیرکردندا.
فرمانە بنەڕەتییەکان
ناونیشانی ڕاستەوخۆ
-
- - %d هەفتە لەمەوپێش
- - %d هەفتە لەمەوپێش
-
زیادکردن…
پیشاندانی بەشەکان
شاردنەوەی بەشەکان
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index b13f2848c..0652c3949 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -465,11 +465,6 @@
- Před %d měsíci
- Před %d měsíci
-
- - Před týdnem
- - Před %d týdny
- - Před %d týdny
-
LBRY HLS
Pro streamování použít LBRY HLS, pokud je k dispozici.
%1$s • %2$d videí
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index d72402974..f2a71e304 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -463,10 +463,6 @@
- Vor %d Jahr
- Vor %d Jahren
-
- - Vor %d Woche
- - Vor %d Wochen
-
Falls verfügbar, LBRY HLS für das Streaming verwenden.
LBRY HLS
%1$s • %2$d Videos
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 971f704e3..b070df823 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -465,11 +465,6 @@
- Hace %d meses
- Hace %d meses
-
- - Hace %d semana
- - Hace %d semanas
- - Hace %d semanas
-
Utilice LBRY HLS para el streaming si está disponible.
LBRY HLS
%1$s suscriptores • %2$d vídeos
diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml
index 56ab4ca25..4242922f4 100644
--- a/app/src/main/res/values-fa/strings.xml
+++ b/app/src/main/res/values-fa/strings.xml
@@ -327,10 +327,6 @@
تنظیم کاره به سلیقهتان.
این نظر پاسخی ندارد.
هشدار محرمانگی
-
- - %d هفته پیش
- - %d هفته پیش
-
رمزینهها
از سر گیری
مکث
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index 3f89c3186..cc32d8726 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -465,8 +465,4 @@
- %d kuukausi sitten
- %d kuukautta sitten
-
- - %d viikko sitten
- - %d viikkoa sitten
-
\ No newline at end of file
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 422c4a4f5..618965d70 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -469,11 +469,6 @@
- il y a %d mois
- il y a %d mois
-
- - il y a %d semaine
- - il y a %d semaines
- - il y a %d semaines
-
Désactiver le proxy Piped
Chargez des vidéos et des images directement depuis les serveurs de YouTube. N\'activez cette option que si vous utilisez un VPN ! Notez que cela peut ne pas fonctionner avec le contenu de Youtube music.
Plein écran automatique sur les vidéos courtes
diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml
index 8fcb13af0..ba0f84d17 100644
--- a/app/src/main/res/values-hi/strings.xml
+++ b/app/src/main/res/values-hi/strings.xml
@@ -463,10 +463,6 @@
- %d महीना पहले
- %d महीने पहले
-
- - %d सप्ताह पहले
- - %d हफ्तों पहले
-
LBRY HLS
उपलब्ध होने पर स्ट्रीमिंग के लिए LBRY HLS का प्रयोग करें।
%1$s • %2$d वीडियोज
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 1ddea0a86..c70a73eea 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -470,10 +470,6 @@
- %d hónapja
- %d hónapja
-
- - %d hete
- - %d hete
-
Új
Csoportnév
Csoport szerkesztése
diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml
index 6cc5f6c7c..e91f91bac 100644
--- a/app/src/main/res/values-in/strings.xml
+++ b/app/src/main/res/values-in/strings.xml
@@ -458,9 +458,6 @@
- %d bulan yang lalu
-
- - %d minggu yang lalu
-
- %d tahun yang lalu
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index c2b8d3444..df0280926 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -460,11 +460,6 @@
- %d mesi fa
- %d mesi fa
-
- - %d settimana fa
- - %d settimane fa
- - %d settimane fa
-
- %d anno fa
- %d anni fa
diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml
index fccc9e1cc..d22c1896a 100644
--- a/app/src/main/res/values-iw/strings.xml
+++ b/app/src/main/res/values-iw/strings.xml
@@ -461,12 +461,6 @@
- לפני %d חודשים
-
- - לפני שבוע
- - לפני שבועיים
- - לפני %d שבועות
-
-
- לפני שנה
- לפני שנתיים
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index a70c96e1c..b8a1c5fcb 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -449,9 +449,6 @@
- %d か月前
-
- - %d 週間前
-
同時ダウンロード数の上限に達しました。
サブタイトルなし
ダウンロードを一時停止しました
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index 110b7e91f..788833028 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -463,9 +463,6 @@
- %d개월 전
-
- - %d주 전
-
재개하다
빨리 감기
Piped 프록시 비활성화
diff --git a/app/src/main/res/values-lv/strings.xml b/app/src/main/res/values-lv/strings.xml
index f5102a759..d6da6f12a 100644
--- a/app/src/main/res/values-lv/strings.xml
+++ b/app/src/main/res/values-lv/strings.xml
@@ -445,11 +445,6 @@
- pirms %d gada
- pirms %d gadiem
-
- - pirms %d nedēļām
- - pirms %d nedēļas
- - pirms %d nedēļām
-
Sasniegts vienlaikus atļauto lejuipelāžu skaits.
Atsākt
Vienlaikus atļautās lejupielādes
diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml
index 66cd3daa3..0cf32b3d1 100644
--- a/app/src/main/res/values-ml/strings.xml
+++ b/app/src/main/res/values-ml/strings.xml
@@ -201,10 +201,6 @@
കയറ്റുമതി ചെയ്തു.
സഹായം
പതിവുചോദ്യങ്ങൾ
-
- - %d ആഴ്ച മുമ്പ്
- - %d ആഴ്ചകൾ മുമ്പ്
-
- %d മാസം മുമ്പ്
- %d മാസങ്ങൾ മുമ്പ്
diff --git a/app/src/main/res/values-mr/strings.xml b/app/src/main/res/values-mr/strings.xml
index 367bcd438..e816f441e 100644
--- a/app/src/main/res/values-mr/strings.xml
+++ b/app/src/main/res/values-mr/strings.xml
@@ -465,10 +465,6 @@
- %d महिन्यापूर्वी
- %d महिन्यांपूर्वी
-
- - %d आठवड्यापूर्वी
- - %d आठवड्यांपूर्वी
-
- %d वर्षापूर्वी
- %d वर्षांपूर्वी
diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml
index 253014480..f04d3f5b8 100644
--- a/app/src/main/res/values-nb-rNO/strings.xml
+++ b/app/src/main/res/values-nb-rNO/strings.xml
@@ -461,10 +461,6 @@
- %d måned siden
- %d måneder siden
-
- - %d uke siden
- - %d uker siden
-
Vis 5 sekunders nedtelling før autospilling av neste video.
Spiller neste om %1$s
Hent videostrøm i LBRY HLS-format hvis tilgjengelig.
diff --git a/app/src/main/res/values-or/strings.xml b/app/src/main/res/values-or/strings.xml
index 8ad06e1d4..0bcfc8553 100644
--- a/app/src/main/res/values-or/strings.xml
+++ b/app/src/main/res/values-or/strings.xml
@@ -463,10 +463,6 @@
- %d ମାସ ପୂର୍ବେ
- %d ମାସ ପୂର୍ବରୁ
-
- - %d ସପ୍ତାହ ପୂର୍ବେ
- - %d ସପ୍ତାହ ପୂର୍ବରୁ
-
LBRY HLS
ଉପଲବ୍ଧ ଥିଲେ ଷ୍ଟ୍ରିମିଂ ପାଇଁ LBRY HLS ବ୍ୟବହାର କରନ୍ତୁ ।
%1$s ଗ୍ରାହକ • %2$d ଭିଡିଓ
diff --git a/app/src/main/res/values-pa/strings.xml b/app/src/main/res/values-pa/strings.xml
index 204f7cc80..aa10e52c3 100644
--- a/app/src/main/res/values-pa/strings.xml
+++ b/app/src/main/res/values-pa/strings.xml
@@ -463,10 +463,6 @@
- %d ਮਹੀਨਾ ਪਹਿਲਾਂ
- %d ਮਹੀਨੇ ਪਹਿਲਾਂ
-
- - %d ਹਫ਼ਤਾ ਪਹਿਲਾਂ
- - %d ਹਫ਼ਤੇ ਪਹਿਲਾਂ
-
ਲਿਬਰੀ HLS
ਉਪਲਬਧ ਹੋਵੇ ਤਾਂ ਸਟ੍ਰੀਮਿੰਗ ਲਈ ਲੀਬਰ HLS ਵਰਤੋ।
%1$s ਸਬਸਕ੍ਰਾਈਬਰ• %2$d ਵੀਡੀਓ
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 84b71c5aa..d3ab4208c 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -467,12 +467,6 @@
- %d miesięcy temu
- %d miesięcy temu
-
- - %d tydzień temu
- - %d tygodnie temu
- - %d tygodni temu
- - %d tygodni temu
-
Użyj LBRY HLS do transmisji strumieniowej, jeśli jest dostępna.
LBRY HLS
%1$s • %2$d filmów
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 4c28db0de..aa3ed617e 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -460,11 +460,6 @@
- %d anos atrás
- %d anos atrás
-
- - %d semana atrás
- - %d semanas atrás
- - %d semanas atrás
-
- %d mês atrás
- %d meses atrás
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 3589162cd..90d70ff72 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -460,11 +460,6 @@
- %d meses atrás
- %d meses atrás
-
- - %d semana atrás
- - %d semanas atrás
- - %d semanas atrás
-
- %d ano atrás
- %d anos atrás
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index c270ac19b..55bdef8ac 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -448,11 +448,6 @@
- acum %d luni
- acum %d de luni
-
- - acum %d săptămână
- - acum %d săptămâni
- - acum %d de săptămâni
-
Violet polivalent
Automat
Înălțime
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index ca21f43a5..3dcece2f1 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -467,12 +467,6 @@
- %d лет назад
- %d лет назад
-
- - %d неделю назад
- - %d недели назад
- - %d недель назад
- - %d недель назад
-
LBRY HLS
Использовать LBRY HLS для трансляции, если доступно.
%1$s • %2$d видео
diff --git a/app/src/main/res/values-si/strings.xml b/app/src/main/res/values-si/strings.xml
index be8534323..dc37f1d8b 100644
--- a/app/src/main/res/values-si/strings.xml
+++ b/app/src/main/res/values-si/strings.xml
@@ -462,10 +462,6 @@
- මාස %dකට පෙර
- මාස %dකට පෙර
-
- - සති %d කට පෙර
- - සති %d කට පෙර
-
ස්වයංක්රීය වාදනය ගණන් කිරීම
මීළඟ වීඩියෝව %1$s හි වාදනය වේ
නර්ඩ්ස් සඳහා සංඛ්යාලේඛන
diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml
index f4612dd6e..48e7cbf2a 100644
--- a/app/src/main/res/values-sr/strings.xml
+++ b/app/src/main/res/values-sr/strings.xml
@@ -458,11 +458,6 @@
- Пре %d година
- Пре %d година
-
- - Пре %d недељу
- - Пре %d недеље
- - Пре %d недеље
-
- Пре %d месец
- Пре %d месеци
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 181a2e8ac..9cdadb055 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -463,10 +463,6 @@
- %d ay önce
- %d ay önce
-
- - %d hafta önce
- - %d hafta önce
-
LBRY HLS
%1$s • %2$d video
%1$s abone • %2$d video
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index 00599bfe8..02c364590 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -467,12 +467,6 @@
- %d місяців тому
- %d місяців тому
-
- - %d тиждень тому
- - %d тижні тому
- - %d тижнів тому
- - %d тижнів тому
-
Використовувати LBRY HLS для стримінгу, якщо це можливо.
LBRY HLS
%1$s • %2$d відео
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index ac48904ad..982912375 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -461,9 +461,6 @@
- %d 个月前
-
- - %d 周前
-
若可用则使用 LBRY HLS 进行流式传输。
LBRY HLS
%1$s • %2$d 个视频
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index e1782805c..71a6f9eb6 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -458,9 +458,6 @@
- %d 個月前
-
- - %d 週前
-
%1$s 訂閱者 • %2$d 個視頻
%1$s • %2$d 個視頻
如果可用,請使用 LBRY HLS 進行流式傳輸。
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 89bb00c11..3aa1d601f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -483,10 +483,6 @@
- %d month ago
- %d months ago
-
- - %d week ago
- - %d weeks ago
-
- %d new stream
- %d new streams