feat: add i18n support for skip button text

- Add player.skip_* translation keys for all 5 segment types
- Enable proper localization of skip button text
- Addresses GitHub Copilot review comment
This commit is contained in:
Uruk
2026-01-14 14:10:28 +01:00
committed by Gauvain
parent 92460cf202
commit 378288bf08
2 changed files with 12 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import type {
} from "@jellyfin/sdk/lib/generated-client";
import { useLocalSearchParams } from "expo-router";
import { type FC, useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { StyleSheet, useWindowDimensions, View } from "react-native";
import Animated, {
Easing,
@@ -394,10 +395,11 @@ export const Controls: FC<Props> = ({
? outroSkipper.currentSegment.endTime < maxSeconds
: false;
// Get button text based on segment type
// Get button text based on segment type using i18n
const { t } = useTranslation();
const skipButtonText = activeSegment
? `Skip ${activeSegment.type}`
: "Skip Intro";
? t(`player.skip_${activeSegment.type.toLowerCase()}`)
: t("player.skip_intro");
const goToItemCommon = useCallback(
(item: BaseItemDto) => {

View File

@@ -24,6 +24,13 @@
"too_old_server_text": "Unsupported Jellyfin Server Discovered",
"too_old_server_description": "Please update Jellyfin to the latest version"
},
"player": {
"skip_intro": "Skip Intro",
"skip_outro": "Skip Outro",
"skip_recap": "Skip Recap",
"skip_commercial": "Skip Commercial",
"skip_preview": "Skip Preview"
},
"server": {
"enter_url_to_jellyfin_server": "Enter the URL to your Jellyfin server",
"server_url_placeholder": "http(s)://your-server.com",