mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-01 19:48:28 +01:00
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:
@@ -5,6 +5,7 @@ import type {
|
|||||||
} from "@jellyfin/sdk/lib/generated-client";
|
} from "@jellyfin/sdk/lib/generated-client";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import { type FC, useCallback, useEffect, useState } from "react";
|
import { type FC, useCallback, useEffect, useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
import { StyleSheet, useWindowDimensions, View } from "react-native";
|
import { StyleSheet, useWindowDimensions, View } from "react-native";
|
||||||
import Animated, {
|
import Animated, {
|
||||||
Easing,
|
Easing,
|
||||||
@@ -394,10 +395,11 @@ export const Controls: FC<Props> = ({
|
|||||||
? outroSkipper.currentSegment.endTime < maxSeconds
|
? outroSkipper.currentSegment.endTime < maxSeconds
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
// Get button text based on segment type
|
// Get button text based on segment type using i18n
|
||||||
|
const { t } = useTranslation();
|
||||||
const skipButtonText = activeSegment
|
const skipButtonText = activeSegment
|
||||||
? `Skip ${activeSegment.type}`
|
? t(`player.skip_${activeSegment.type.toLowerCase()}`)
|
||||||
: "Skip Intro";
|
: t("player.skip_intro");
|
||||||
|
|
||||||
const goToItemCommon = useCallback(
|
const goToItemCommon = useCallback(
|
||||||
(item: BaseItemDto) => {
|
(item: BaseItemDto) => {
|
||||||
|
|||||||
@@ -24,6 +24,13 @@
|
|||||||
"too_old_server_text": "Unsupported Jellyfin Server Discovered",
|
"too_old_server_text": "Unsupported Jellyfin Server Discovered",
|
||||||
"too_old_server_description": "Please update Jellyfin to the latest version"
|
"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": {
|
"server": {
|
||||||
"enter_url_to_jellyfin_server": "Enter the URL to your Jellyfin server",
|
"enter_url_to_jellyfin_server": "Enter the URL to your Jellyfin server",
|
||||||
"server_url_placeholder": "http(s)://your-server.com",
|
"server_url_placeholder": "http(s)://your-server.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user