From 6b7ee0514f001aceda8654789ef6a7f520d568c5 Mon Sep 17 00:00:00 2001 From: Felix Schneider Date: Sun, 31 May 2026 23:45:45 +0200 Subject: [PATCH] feat(i18n): add new translations for action sheet options (#1475) Co-authored-by: lance chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Gauvain --- components/common/TouchableItemRouter.tsx | 15 ++++++++++----- translations/de.json | 3 +++ translations/en.json | 3 +++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/components/common/TouchableItemRouter.tsx b/components/common/TouchableItemRouter.tsx index cc40d2dc7..fed45dc99 100644 --- a/components/common/TouchableItemRouter.tsx +++ b/components/common/TouchableItemRouter.tsx @@ -2,6 +2,7 @@ import { useActionSheet } from "@expo/react-native-action-sheet"; import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { useSegments } from "expo-router"; import { type PropsWithChildren, useCallback } from "react"; +import { useTranslation } from "react-i18next"; import { Platform, TouchableOpacity, @@ -149,6 +150,7 @@ export const TouchableItemRouter: React.FC> = ({ children, ...props }) => { + const { t } = useTranslation(); const segments = useSegments(); const { showActionSheetWithOptions } = useActionSheet(); const markAsPlayedStatus = useMarkAsPlayed([item]); @@ -182,11 +184,13 @@ export const TouchableItemRouter: React.FC> = ({ return; const options: string[] = [ - "Mark as Played", - "Mark as Not Played", - isFavorite ? "Unmark as Favorite" : "Mark as Favorite", - ...(isOffline ? ["Delete Download"] : []), - "Cancel", + t("common.mark_as_played"), + t("common.mark_as_not_played"), + isFavorite + ? t("music.track_options.remove_from_favorites") + : t("music.track_options.add_to_favorites"), + ...(isOffline ? [t("home.downloads.delete_download")] : []), + t("common.cancel"), ]; const cancelButtonIndex = options.length - 1; const destructiveButtonIndex = isOffline @@ -219,6 +223,7 @@ export const TouchableItemRouter: React.FC> = ({ isOffline, deleteFile, item.Id, + t, ]); if ( diff --git a/translations/de.json b/translations/de.json index 87df58142..4cc148aa6 100644 --- a/translations/de.json +++ b/translations/de.json @@ -456,6 +456,7 @@ "new_app_version_requires_re_download_description": "Die neue App-Version erfordert das erneute Herunterladen von Filmen und Serien. Bitte lösche alle heruntergeladenen Elemente und starte den Download erneut.", "back": "Zurück", "delete": "Löschen", + "delete_download": "Download löschen", "something_went_wrong": "Etwas ist schiefgelaufen", "could_not_get_stream_url_from_jellyfin": "Konnte keine Stream-URL von Jellyfin erhalten", "eta": "ETA {{eta}}", @@ -498,6 +499,8 @@ "audio": "Audio", "subtitle": "Untertitel", "play": "Abspielen", + "mark_as_played": "Als gesehen markieren", + "mark_as_not_played": "Als ungesehen markieren", "none": "Keine", "track": "Spur", "cancel": "Abbrechen", diff --git a/translations/en.json b/translations/en.json index 320526063..95e4e18bf 100644 --- a/translations/en.json +++ b/translations/en.json @@ -534,6 +534,7 @@ "new_app_version_requires_re_download_description": "The new update requires content to be downloaded again. Please remove all downloaded content and try again.", "back": "Back", "delete": "Delete", + "delete_download": "Delete Download", "something_went_wrong": "Something Went Wrong", "could_not_get_stream_url_from_jellyfin": "Could not get the stream URL from Jellyfin", "eta": "ETA {{eta}}", @@ -577,6 +578,8 @@ "audio": "Audio", "subtitle": "Subtitle", "play": "Play", + "mark_as_played": "Mark as Played", + "mark_as_not_played": "Mark as not Played", "none": "None", "track": "Track", "cancel": "Cancel",