diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 896112ff..053c299b 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 136 - versionName "1.9.19" + versionCode 137 + versionName "1.9.20" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index b7a8ca03..0e423078 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -71,7 +71,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.9.20 + + https://github.com/Materialious/Materialious/releases/tag/1.9.19 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index 2732fc6e..84691dd3 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.9.19", + "version": "1.9.20", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", @@ -44,4 +44,4 @@ "capacitor", "electron" ] -} +} \ No newline at end of file diff --git a/materialious/package-lock.json b/materialious/package-lock.json index 4d8a99b6..d27176be 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -1,12 +1,12 @@ { "name": "materialious", - "version": "1.9.18", + "version": "1.9.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "materialious", - "version": "1.9.18", + "version": "1.9.19", "hasInstallScript": true, "dependencies": { "@capacitor-community/electron": "^5.0.1", diff --git a/materialious/package.json b/materialious/package.json index 52d70d0c..a18d9add 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.9.19", + "version": "1.9.20", "private": true, "scripts": { "dev": "vite dev", diff --git a/materialious/src/lib/components/Comment.svelte b/materialious/src/lib/components/Comment.svelte index f5832f49..400c609b 100644 --- a/materialious/src/lib/components/Comment.svelte +++ b/materialious/src/lib/components/Comment.svelte @@ -7,6 +7,7 @@ import { onMount } from 'svelte'; import CommentSelf from './Comment.svelte'; import { insecureRequestImageHandler } from '$lib/misc'; + import { _ } from '$lib/i18n'; interface Props { comment: Comment; @@ -17,7 +18,7 @@ let replies: Comments | undefined = $state(undefined); - const replyText: string = comment.replies?.replyCount > 1 ? 'replies' : 'reply'; + const replyText: string = comment.replies?.replyCount > 1 ? $_('replies') : $_('reply'); async function loadReplies(continuation: string) { try { diff --git a/materialious/src/lib/i18n/index.ts b/materialious/src/lib/i18n/index.ts index e4f3f121..e62b5313 100644 --- a/materialious/src/lib/i18n/index.ts +++ b/materialious/src/lib/i18n/index.ts @@ -23,8 +23,16 @@ const resources: Record Promise>> = { function getUserLocale(): string { if (typeof navigator !== 'undefined') { - const lang = navigator.language; - return resources[lang] ? lang : defaultLocale; + for (const lang of navigator.languages) { + if (resources[lang]) { + return lang; + } + // In case of a regional code (e.g. 'de-CH'), fallback to the more general lang + const baseLang = lang.split('-')[0] + if (resources[baseLang]) { + return baseLang + } + } } return defaultLocale; } diff --git a/materialious/src/lib/i18n/locales/de.json b/materialious/src/lib/i18n/locales/de.json index 83ee1fdf..2ab9c5cd 100644 --- a/materialious/src/lib/i18n/locales/de.json +++ b/materialious/src/lib/i18n/locales/de.json @@ -13,7 +13,9 @@ "donate": "Spenden", "deleteAllHistory": "Gesamten Verlauf löschen", "skipping": "Überspringen", - "replies": "antworten", + "comments": "Kommentare", + "reply": "Antwort", + "replies": "Antworten", "region": "Region", "noResult": "Keine Ergebnisse", "language": "Sprache", diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index 1e1f9beb..001824f9 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -19,6 +19,8 @@ "donate": "Donate", "deleteAllHistory": "Delete all history", "skipping": "Skipping", + "comments": "comments", + "reply": "reply", "replies": "replies", "region": "Region", "noResult": "No results", diff --git a/materialious/src/routes/(app)/watch/[slug]/+page.svelte b/materialious/src/routes/(app)/watch/[slug]/+page.svelte index 3edcfc25..b6e98a0d 100644 --- a/materialious/src/routes/(app)/watch/[slug]/+page.svelte +++ b/materialious/src/routes/(app)/watch/[slug]/+page.svelte @@ -469,7 +469,7 @@
diff --git a/update_versions.py b/update_versions.py index f8e24a04..bc45c1c9 100644 --- a/update_versions.py +++ b/update_versions.py @@ -3,7 +3,7 @@ import os import re from datetime import datetime -LATEST_VERSION = "1.9.19" +LATEST_VERSION = "1.9.20" RELEASE_DATE = datetime.now().strftime("%Y-%-m-%d") # Format: YYYY-M-D WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")