Screen Orientation Enum + Subtitle Mode

This commit is contained in:
Simon Caron
2025-01-13 22:30:57 -05:00
parent 5703279b46
commit 364ce46fe5
5 changed files with 65 additions and 17 deletions

View File

@@ -98,17 +98,17 @@ export const OtherSettings: React.FC = () => {
disabled={pluginSettings?.defaultVideoOrientation?.locked || settings.autoRotate}
keyExtractor={String}
titleExtractor={(item) =>
ScreenOrientationEnum[item]
t(ScreenOrientationEnum[item])
}
title={
<TouchableOpacity className="flex flex-row items-center justify-between py-3 pl-3">
<Text className="mr-1 text-[#8E8D91]">
{ScreenOrientationEnum[settings.defaultVideoOrientation]}
{t(ScreenOrientationEnum[settings.defaultVideoOrientation])}
</Text>
<Ionicons name="chevron-expand-sharp" size={18} color="#5A5960"/>
</TouchableOpacity>
}
label="Orientation"
label={t("home.settings.other.orientation")}
onSelected={(defaultVideoOrientation) =>
updateSettings({defaultVideoOrientation})
}

View File

@@ -31,6 +31,14 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
SubtitlePlaybackMode.None,
];
const subtitleModeKeys = {
[SubtitlePlaybackMode.Default]: "home.settings.subtitles.modes.Default",
[SubtitlePlaybackMode.Smart]: "home.settings.subtitles.modes.Smart",
[SubtitlePlaybackMode.OnlyForced]: "home.settings.subtitles.modes.OnlyForced",
[SubtitlePlaybackMode.Always]: "home.settings.subtitles.modes.Always",
[SubtitlePlaybackMode.None]: "home.settings.subtitles.modes.None",
};
return (
<View {...props}>
<ListGroup
@@ -77,11 +85,11 @@ export const SubtitleToggles: React.FC<Props> = ({ ...props }) => {
data={subtitleModes}
disabled={pluginSettings?.subtitleMode?.locked}
keyExtractor={String}
titleExtractor={String}
titleExtractor={(item) => t(subtitleModeKeys[item]) || String(item)}
title={
<TouchableOpacity className="flex flex-row items-center justify-between py-3 pl-3">
<Text className="mr-1 text-[#8E8D91]">
{settings?.subtitleMode || t("home.settings.subtitles.loading")}
{t(subtitleModeKeys[settings?.subtitleMode]) || t("home.settings.subtitles.loading")}
</Text>
<Ionicons
name="chevron-expand-sharp"

View File

@@ -102,12 +102,32 @@
"subtitle_hint": "Configure subtitle preference.",
"none": "None",
"language": "Language",
"loading": "Loading"
"loading": "Loading",
"modes": {
"Default": "Default",
"Smart": "Smart",
"Always": "Always",
"None": "None",
"OnlyForced": "OnlyForced"
}
},
"other": {
"other_title": "Other",
"auto_rotate": "Auto rotate",
"video_orientation": "Video orientation",
"orientation": "Orientation",
"orientations": {
"DEFAULT": "Default",
"ALL": "All",
"PORTRAIT": "Portrait",
"PORTRAIT_UP": "Portrait Up",
"PORTRAIT_DOWN": "Portrait Down",
"LANDSCAPE": "Landscape",
"LANDSCAPE_LEFT": "Landscape Left",
"LANDSCAPE_RIGHT": "Landscape Right",
"OTHER": "Other",
"UNKNOWN": "Unknown"
},
"safe_area_in_controls": "Safe area in controls",
"show_custom_menu_links": "Show Custom Menu Links",
"hide_libraries": "Hide Libraries",

View File

@@ -102,12 +102,32 @@
"subtitle_hint": "Configurez les préférences des sous-titres.",
"none": "Aucune",
"language": "Langage",
"loading": "Chargement"
"loading": "Chargement",
"modes": {
"Default": "Par défaut",
"Smart": "Intelligent",
"Always": "Toujours",
"None": "Aucun",
"OnlyForced": "Forcés seulement"
}
},
"other": {
"other_title": "Autres",
"auto_rotate": "Rotation automatique",
"video_orientation": "Orientation vidéo",
"orientation": "Orientation",
"orientations": {
"DEFAULT": "Par défaut",
"ALL": "Toutes",
"PORTRAIT": "Portrait",
"PORTRAIT_UP": "Portrait Haut",
"PORTRAIT_DOWN": "Portrait Bas",
"LANDSCAPE": "Paysage",
"LANDSCAPE_LEFT": "Paysage Gauche",
"LANDSCAPE_RIGHT": "Paysage Droite",
"OTHER": "Autre",
"UNKNOWN": "Inconnu"
},
"safe_area_in_controls": "Zone de sécurité dans les contrôles",
"show_custom_menu_links": "Afficher les liens personnalisés",
"hide_libraries": "Cacher des bibliothèques",

View File

@@ -28,16 +28,16 @@ export const ScreenOrientationEnum: Record<
ScreenOrientation.OrientationLock,
string
> = {
[ScreenOrientation.OrientationLock.DEFAULT]: "Default",
[ScreenOrientation.OrientationLock.ALL]: "All",
[ScreenOrientation.OrientationLock.PORTRAIT]: "Portrait",
[ScreenOrientation.OrientationLock.PORTRAIT_UP]: "Portrait Up",
[ScreenOrientation.OrientationLock.PORTRAIT_DOWN]: "Portrait Down",
[ScreenOrientation.OrientationLock.LANDSCAPE]: "Landscape",
[ScreenOrientation.OrientationLock.LANDSCAPE_LEFT]: "Landscape Left",
[ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT]: "Landscape Right",
[ScreenOrientation.OrientationLock.OTHER]: "Other",
[ScreenOrientation.OrientationLock.UNKNOWN]: "Unknown",
[ScreenOrientation.OrientationLock.DEFAULT]: "home.settings.other.orientations.DEFAULT",
[ScreenOrientation.OrientationLock.ALL]: "home.settings.other.orientations.ALL",
[ScreenOrientation.OrientationLock.PORTRAIT]: "home.settings.other.orientations.PORTRAIT",
[ScreenOrientation.OrientationLock.PORTRAIT_UP]: "home.settings.other.orientations.PORTRAIT_UP",
[ScreenOrientation.OrientationLock.PORTRAIT_DOWN]: "home.settings.other.orientations.PORTRAIT_DOWN",
[ScreenOrientation.OrientationLock.LANDSCAPE]: "home.settings.other.orientations.LANDSCAPE",
[ScreenOrientation.OrientationLock.LANDSCAPE_LEFT]: "home.settings.other.orientations.LANDSCAPE_LEFT",
[ScreenOrientation.OrientationLock.LANDSCAPE_RIGHT]: "home.settings.other.orientations.LANDSCAPE_RIGHT",
[ScreenOrientation.OrientationLock.OTHER]: "home.settings.other.orientations.OTHER",
[ScreenOrientation.OrientationLock.UNKNOWN]: "home.settings.other.orientations.UNKNOWN",
};
export const DownloadOptions: DownloadOption[] = [